power: supply: cpcap-battery: make array cpcap_battery_irqs static, shrinks object...
authorColin Ian King <colin.king@canonical.com>
Thu, 29 Nov 2018 23:03:42 +0000 (23:03 +0000)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Tue, 4 Dec 2018 23:24:36 +0000 (00:24 +0100)
Don't populate the array cpcap_battery_irqs  on the stack but instead
make it static. Makes the object code smaller by 99 bytes:

Before:
   text    data     bss     dec     hex filename
  13673    2448       0   16121    3ef9 cpcap-battery.o

After:
   text    data     bss     dec     hex filename
  13510    2512       0   16022    3e96 cpcap-battery.o

(gcc version 8.2.0 x86_64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/cpcap-battery.c

index 98ba07869c3b00afb16d8f4d71d4ece9f855c40d..08d5037fd0521523dcfb5d9ce211a117b2ff52e9 100644 (file)
@@ -620,7 +620,7 @@ static int cpcap_battery_init_irq(struct platform_device *pdev,
 static int cpcap_battery_init_interrupts(struct platform_device *pdev,
                                         struct cpcap_battery_ddata *ddata)
 {
-       const char * const cpcap_battery_irqs[] = {
+       static const char * const cpcap_battery_irqs[] = {
                "eol", "lowbph", "lowbpl",
                "chrgcurr1", "battdetb"
        };