mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Darren Hart <dvhart@infradead.org>,
	Andy Shevchenko <andy@infradead.org>,
	Platform Driver <platform-driver-x86@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] msi-wmi: remove unnecessary static in msi_wmi_notify()
Date: Wed, 19 Jul 2017 21:11:39 +0300	[thread overview]
Message-ID: <CAHp75VebNSGoHC-dVHsORh1np-RwvmxC1ACqGeGAJ6EqT4m4Ug@mail.gmail.com> (raw)
In-Reply-To: <20170718214937.GA27363@embeddedgus>

On Wed, Jul 19, 2017 at 12:49 AM, Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
> Remove unnecessary static on local variable _key_. Such variable is
> initialized before being used, on every execution path throughout
> the function. The static has no benefit and, removing it reduces
> the object file size.
>
> This issue was detected using Coccinelle and the following semantic patch:
> https://github.com/GustavoARSilva/coccinelle/blob/master/static/static_unused.cocci
>
> In the following log you can see a significant difference in the object
> file 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
>    6530    3736     320   10586    295a drivers/platform/x86/msi-wmi.o
>
> after:
>    text    data     bss     dec     hex filename
>    6494    3648     256   10398    289e drivers/platform/x86/msi-wmi.o
>

Pushed to testing, thanks.

P.S. Please, use subsystem prefix next time.

> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
>  drivers/platform/x86/msi-wmi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/msi-wmi.c b/drivers/platform/x86/msi-wmi.c
> index f6209b7..6201382 100644
> --- a/drivers/platform/x86/msi-wmi.c
> +++ b/drivers/platform/x86/msi-wmi.c
> @@ -184,7 +184,7 @@ static const struct backlight_ops msi_backlight_ops = {
>  static void msi_wmi_notify(u32 value, void *context)
>  {
>         struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL };
> -       static struct key_entry *key;
> +       struct key_entry *key;
>         union acpi_object *obj;
>         acpi_status status;
>
> --
> 2.5.0
>



-- 
With Best Regards,
Andy Shevchenko

      reply	other threads:[~2017-07-19 18:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-18 21:49 Gustavo A. R. Silva
2017-07-19 18:11 ` Andy Shevchenko [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=CAHp75VebNSGoHC-dVHsORh1np-RwvmxC1ACqGeGAJ6EqT4m4Ug@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=andy@infradead.org \
    --cc=dvhart@infradead.org \
    --cc=gustavo@embeddedor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®