public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: rsnd: remove unnecessary static in rsnd_ssiu_probe()
Date: Mon, 17 Jul 2017 09:31:36 -0700	[thread overview]
Message-ID: <1500309096.25934.11.camel@perches.com> (raw)
In-Reply-To: <20170717153020.GA19704@embeddedgus>

On Mon, 2017-07-17 at 10:30 -0500, Gustavo A. R. Silva wrote:
> Remove unnecessary static on local variable ops.
> Such variable is initialized before being used,
> on every execution path throughout the function.
> The static has no benefit and, removing it reduces
> the code size.
[]
> In the following log you can see the difference in the code size. Also,
> there is a significant difference in the bss segment. This log is the
> output of the size command, before and after the code change:
> 
> before:
>    text    data     bss     dec     hex filename
>    3211     680      64    3955     f73 sound/soc/sh/rcar/ssiu.o
> 
> after:
>    text    data     bss     dec     hex filename
>    3207     592       0    3799     ed7 sound/soc/sh/rcar/ssiu.o
[]
> diff --git a/sound/soc/sh/rcar/ssiu.c b/sound/soc/sh/rcar/ssiu.c
[]
> @@ -250,7 +250,7 @@ int rsnd_ssiu_probe(struct rsnd_priv *priv)
>  {
>  	struct device *dev = rsnd_priv_to_dev(priv);
>  	struct rsnd_ssiu *ssiu;
> -	static struct rsnd_mod_ops *ops;
> +	struct rsnd_mod_ops *ops;
>  	int i, nr, ret;
>  
>  	/* same number to SSI */

I'm not an sh user anymore, but it's curious to me why
the static removal has such a large impact on data size.

Is this for an allyesconfig with debug symbols?

btw: this does compile for x86 and those sizes seem
     more sensible.

$ size sound/soc/sh/rcar/ssiu.o*   text	   data	    bss	    dec	    hex	filename
   1950	    248	      0	   2198	    896	sound/soc/sh/rcar/ssiu.o.defconfig.new
   1950	    248	      8	   2206	    89e	sound/soc/sh/rcar/ssiu.o.defconfig.old
   2692	    248	      0	   2940	    b7c	sound/soc/sh/rcar/ssiu.o.allyesconfig.new
   2692	    248	      8	   2948	    b84	sound/soc/sh/rcar/ssiu.o.allyesconfig.old

      reply	other threads:[~2017-07-17 16:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-17 15:30 [PATCH] ASoC: rsnd: remove unnecessary static in rsnd_ssiu_probe() Gustavo A. R. Silva
2017-07-17 16:31 ` 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=1500309096.25934.11.camel@perches.com \
    --to=joe@perches.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=gustavo@embeddedor.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.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