All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Arnd Bergmann <arnd@arndb.de>,
	Michael Krufky <mkrufky@linuxtv.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tuners: tda8290: reduce stack usage with kasan
Date: Mon, 11 Dec 2017 11:34:28 -0800	[thread overview]
Message-ID: <1513020868.3036.0.camel@perches.com> (raw)
In-Reply-To: <20171211120612.3775893-1-arnd@arndb.de>

On Mon, 2017-12-11 at 13:06 +0100, Arnd Bergmann wrote:
> With CONFIG_KASAN enabled, we get a relatively large stack frame in one function
> 
> drivers/media/tuners/tda8290.c: In function 'tda8290_set_params':
> drivers/media/tuners/tda8290.c:310:1: warning: the frame size of 1520 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> 
> With CONFIG_KASAN_EXTRA this goes up to
> 
> drivers/media/tuners/tda8290.c: In function 'tda8290_set_params':
> drivers/media/tuners/tda8290.c:310:1: error: the frame size of 3200 bytes is larger than 3072 bytes [-Werror=frame-larger-than=]
> 
> We can significantly reduce this by marking local arrays as 'static const', and
> this should result in better compiled code for everyone.
[]
> diff --git a/drivers/media/tuners/tda8290.c b/drivers/media/tuners/tda8290.c
[]
> @@ -63,8 +63,8 @@ static int tda8290_i2c_bridge(struct dvb_frontend *fe, int close)
>  {
>  	struct tda8290_priv *priv = fe->analog_demod_priv;
>  
> -	unsigned char  enable[2] = { 0x21, 0xC0 };
> -	unsigned char disable[2] = { 0x21, 0x00 };
> +	static unsigned char  enable[2] = { 0x21, 0xC0 };
> +	static unsigned char disable[2] = { 0x21, 0x00 };

Doesn't match commit message.

static const or just static?

> @@ -84,9 +84,9 @@ static int tda8295_i2c_bridge(struct dvb_frontend *fe, int close)
>  {
>  	struct tda8290_priv *priv = fe->analog_demod_priv;
>  
> -	unsigned char  enable[2] = { 0x45, 0xc1 };
> -	unsigned char disable[2] = { 0x46, 0x00 };
> -	unsigned char buf[3] = { 0x45, 0x01, 0x00 };
> +	static unsigned char  enable[2] = { 0x45, 0xc1 };
> +	static unsigned char disable[2] = { 0x46, 0x00 };

etc.

  parent reply	other threads:[~2017-12-11 19:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 12:06 [PATCH] tuners: tda8290: reduce stack usage with kasan Arnd Bergmann
2017-12-11 15:09 ` Michael Ira Krufky
2017-12-11 19:34 ` Joe Perches [this message]
2017-12-11 21:17   ` Michael Ira Krufky
2017-12-12 10:24     ` Arnd Bergmann
2017-12-12 11:42       ` Joe Perches
2017-12-12 12:45         ` Mauro Carvalho Chehab
2017-12-12 14:21           ` Arnd Bergmann
2017-12-12 16:02             ` Joe Perches

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=1513020868.3036.0.camel@perches.com \
    --to=joe@perches.com \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mkrufky@linuxtv.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.