OSDN Git Service

platform/x86: ibm_rtl: remove unnecessary static in ibm_rtl_write()
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Tue, 18 Jul 2017 22:01:45 +0000 (17:01 -0500)
committerDarren Hart (VMware) <dvhart@infradead.org>
Tue, 25 Jul 2017 16:56:38 +0000 (09:56 -0700)
commitcd0223c64c604b2aff2aa7b7576ef7693b0b10ae
treef03e60c79fe2263c30b958237b1f6b090b2988fd
parent6d8d556262965bf7133b2540f293eaa1bc1e40d1
platform/x86: ibm_rtl: remove unnecessary static in ibm_rtl_write()

Remove unnecessary static on local variable cmd_port_val. 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 difference in the object file size.
This log is the output of the size command, before and after the code
change:

before:
   text    data     bss     dec     hex filename
   3932    3440     512    7884    1ecc drivers/platform/x86/ibm_rtl.o

after:
   text    data     bss     dec     hex filename
   3887    3384     448    7719    1e27 drivers/platform/x86/ibm_rtl.o

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/ibm_rtl.c