diff options
author | Arnd Bergmann <arnd@arndb.de> | 2017-02-02 15:43:42 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-02-03 13:01:36 +0100 |
commit | 22eb36b8142b1f07f23c365e87a5dad6c9f233f1 (patch) | |
tree | ce2d04c6b75134688627a29ac28504dcf227cc5f /drivers/staging/fbtft/fbtft-sysfs.c | |
parent | 26190d41b97734eee9ec076c12d6defe42de7efc (diff) | |
download | op-kernel-dev-22eb36b8142b1f07f23c365e87a5dad6c9f233f1.zip op-kernel-dev-22eb36b8142b1f07f23c365e87a5dad6c9f233f1.tar.gz |
staging: fbtft: change 'gamma' array to u32
Having a local variable of 1024 bytes on 64-bit architectures is a bit
too much, and I ran into this warning while trying to see what functions
use the largest stack:
drivers/staging/fbtft/fbtft-sysfs.c: In function 'store_gamma_curve':
drivers/staging/fbtft/fbtft-sysfs.c:132:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]
As there is no need for 64-bit gamma values (on 32-bit architectures,
we don't use those either), I'm changing the type from 'unsigned long'
to 'u32' here, which cuts the required space in half everywhere.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/fbtft/fbtft-sysfs.c')
-rw-r--r-- | drivers/staging/fbtft/fbtft-sysfs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/fbtft/fbtft-sysfs.c b/drivers/staging/fbtft/fbtft-sysfs.c index 5922f1b..6b6fbaa 100644 --- a/drivers/staging/fbtft/fbtft-sysfs.c +++ b/drivers/staging/fbtft/fbtft-sysfs.c @@ -16,7 +16,7 @@ static int get_next_ulong(char **str_p, unsigned long *val, char *sep, int base) return kstrtoul(p_val, base, val); } -int fbtft_gamma_parse_str(struct fbtft_par *par, unsigned long *curves, +int fbtft_gamma_parse_str(struct fbtft_par *par, u32 *curves, const char *str, int size) { char *str_p, *curve_p = NULL; @@ -89,7 +89,7 @@ out: } static ssize_t -sprintf_gamma(struct fbtft_par *par, unsigned long *curves, char *buf) +sprintf_gamma(struct fbtft_par *par, u32 *curves, char *buf) { ssize_t len = 0; unsigned int i, j; @@ -98,7 +98,7 @@ sprintf_gamma(struct fbtft_par *par, unsigned long *curves, char *buf) for (i = 0; i < par->gamma.num_curves; i++) { for (j = 0; j < par->gamma.num_values; j++) len += scnprintf(&buf[len], PAGE_SIZE, - "%04lx ", curves[i * par->gamma.num_values + j]); + "%04x ", curves[i * par->gamma.num_values + j]); buf[len - 1] = '\n'; } mutex_unlock(&par->gamma.lock); @@ -112,7 +112,7 @@ static ssize_t store_gamma_curve(struct device *device, { struct fb_info *fb_info = dev_get_drvdata(device); struct fbtft_par *par = fb_info->par; - unsigned long tmp_curves[FBTFT_GAMMA_MAX_VALUES_TOTAL]; + u32 tmp_curves[FBTFT_GAMMA_MAX_VALUES_TOTAL]; int ret; ret = fbtft_gamma_parse_str(par, tmp_curves, buf, count); |