watchdog: asm9260_wdt: make array mode_name static, shrinks object size

Don't populate the const array mode_name on the stack but instead
make it static. Makes the object code smaller by 41 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
   7699	   1872	      0	   9571	   2563	drivers/watchdog/asm9260_wdt.o

After:
   text	   data	    bss	    dec	    hex	filename
   7594	   1936	      0	   9530	   253a	drivers/watchdog/asm9260_wdt.o

(gcc version 8.2.0 x86_64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
This commit is contained in:
Colin Ian King 2018-11-29 23:25:00 +00:00 committed by Wim Van Sebroeck
parent 437a3f8ea4
commit b1bbb0cb2c
1 changed files with 1 additions and 1 deletions

View File

@ -278,7 +278,7 @@ static int asm9260_wdt_probe(struct platform_device *pdev)
struct watchdog_device *wdd;
struct resource *res;
int ret;
const char * const mode_name[] = { "hw", "sw", "debug", };
static const char * const mode_name[] = { "hw", "sw", "debug", };
priv = devm_kzalloc(&pdev->dev, sizeof(struct asm9260_wdt_priv),
GFP_KERNEL);