summaryrefslogtreecommitdiff
path: root/drivers/platform/x86
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2017-07-19 00:49:37 +0300
committerDarren Hart (VMware) <dvhart@infradead.org>2017-07-25 19:56:38 +0300
commit6d8d556262965bf7133b2540f293eaa1bc1e40d1 (patch)
tree9cfb80dec0fb326565b5fea15bbc3f95ad1f05c8 /drivers/platform/x86
parent890f658c101df5842ce8aaec1b0833cf1ba37eb3 (diff)
downloadlinux-6d8d556262965bf7133b2540f293eaa1bc1e40d1.tar.xz
platform/x86: msi-wmi: remove unnecessary static in msi_wmi_notify()
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 Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r--drivers/platform/x86/msi-wmi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/x86/msi-wmi.c b/drivers/platform/x86/msi-wmi.c
index f6209b739ec0..620138236c89 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;