public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>,
	"Noralf Trønnes" <noralf@tronnes.org>,
	"Anson Jacob" <ansonjacob.aj@gmail.com>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: fbtft: change 'gamma' array to u32
Date: Thu, 02 Feb 2017 16:11:27 -0800	[thread overview]
Message-ID: <1486080687.22276.59.camel@perches.com> (raw)
In-Reply-To: <20170202144544.3680633-1-arnd@arndb.de>

On Thu, 2017-02-02 at 15:43 +0100, Arnd Bergmann wrote:
> 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.
[]
> diff --git a/drivers/staging/fbtft/fb_hx8347d.c b/drivers/staging/fbtft/fb_hx8347d.c
[]
> @@ -102,7 +102,7 @@ static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
>   *   VRN0 VRN1 VRN2 VRN3 VRN4 VRN5 PRN0 PRN1 PKN0 PKN1 PKN2 PKN3 PKN4 CGM
>   */
>  #define CURVE(num, idx)  curves[num * par->gamma.num_values + idx]
> -static int set_gamma(struct fbtft_par *par, unsigned long *curves)
> +static int set_gamma(struct fbtft_par *par, u32 *curves)
>  {
>  	unsigned long mask[] = {
>  		0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x7f, 0x7f, 0x1f, 0x1f,

presumably these should be static const and maybe u8 or u32 too

> diff --git a/drivers/staging/fbtft/fb_ili9163.c b/drivers/staging/fbtft/fb_ili9163.c
[]
> @@ -202,7 +202,7 @@ static int set_var(struct fbtft_par *par)
>  
>  #ifdef GAMMA_ADJ
>  #define CURVE(num, idx)  curves[num * par->gamma.num_values + idx]
> -static int gamma_adj(struct fbtft_par *par, unsigned long *curves)
> +static int gamma_adj(struct fbtft_par *par, u32 *curves)
>  {
>  	unsigned long mask[] = {
>  		0x3F, 0x3F, 0x3F, 0x3F, 0x3F,

etc...

      reply	other threads:[~2017-02-03  0:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-02 14:43 [PATCH] staging: fbtft: change 'gamma' array to u32 Arnd Bergmann
2017-02-03  0:11 ` Joe Perches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1486080687.22276.59.camel@perches.com \
    --to=joe@perches.com \
    --cc=ansonjacob.aj@gmail.com \
    --cc=arnd@arndb.de \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=noralf@tronnes.org \
    --cc=thomas.petazzoni@free-electrons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox