Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1685140 > unrolled thread

[PATCH] watchdog: w83627hf: make const array chip_name static

Started byColin King <colin.king@canonical.com>
First post2017-07-11 17:30 +0200
Last post2017-07-14 08:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] watchdog: w83627hf: make const array chip_name static Colin King <colin.king@canonical.com> - 2017-07-11 17:30 +0200
    Re: [PATCH] watchdog: w83627hf: make const array chip_name static Guenter Roeck <linux@roeck-us.net> - 2017-07-14 08:50 +0200

#1685140 — [PATCH] watchdog: w83627hf: make const array chip_name static

FromColin King <colin.king@canonical.com>
Date2017-07-11 17:30 +0200
Subject[PATCH] watchdog: w83627hf: make const array chip_name static
Message-ID<u25gS-41E-19@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

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

Before:
   text	   data	    bss	    dec	    hex	filename
   5641	   2840	    384	   8865	   22a1	drivers/watchdog/w83627hf_wdt.o

After:
   text	   data	    bss	    dec	    hex	filename
   5545	   2896	    384	   8825	   2279	drivers/watchdog/w83627hf_wdt.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/watchdog/w83627hf_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c
index d9ba0496713c..7817836bff55 100644
--- a/drivers/watchdog/w83627hf_wdt.c
+++ b/drivers/watchdog/w83627hf_wdt.c
@@ -429,7 +429,7 @@ static int __init wdt_init(void)
 {
 	int ret;
 	int chip;
-	const char * const chip_name[] = {
+	static const char * const chip_name[] = {
 		"W83627HF",
 		"W83627S",
 		"W83697HF",
-- 
2.11.0

[toc] | [next] | [standalone]


#1687090

FromGuenter Roeck <linux@roeck-us.net>
Date2017-07-14 08:50 +0200
Message-ID<u32Ah-84Q-1@gated-at.bofh.it>
In reply to#1685140
On 07/11/2017 08:23 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate array chip_name on the stack but instead make it static.
> Makes the object code smaller by 40 bytes:
> 
> Before:
>     text	   data	    bss	    dec	    hex	filename
>     5641	   2840	    384	   8865	   22a1	drivers/watchdog/w83627hf_wdt.o
> 
> After:
>     text	   data	    bss	    dec	    hex	filename
>     5545	   2896	    384	   8825	   2279	drivers/watchdog/w83627hf_wdt.o
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/watchdog/w83627hf_wdt.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c
> index d9ba0496713c..7817836bff55 100644
> --- a/drivers/watchdog/w83627hf_wdt.c
> +++ b/drivers/watchdog/w83627hf_wdt.c
> @@ -429,7 +429,7 @@ static int __init wdt_init(void)
>   {
>   	int ret;
>   	int chip;
> -	const char * const chip_name[] = {
> +	static const char * const chip_name[] = {
>   		"W83627HF",
>   		"W83627S",
>   		"W83697HF",
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web