linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] power: supply: cpcap-battery: make array cpcap_battery_irqs static, shrinks object size
@ 2018-11-29 23:03 Colin King
  2018-12-05 17:28 ` Sebastian Reichel
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2018-11-29 23:03 UTC (permalink / raw)
  To: Sebastian Reichel, linux-pm; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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>
---
 drivers/power/supply/cpcap-battery.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/cpcap-battery.c b/drivers/power/supply/cpcap-battery.c
index 98ba07869c3b..204e22e3e9b4 100644
--- a/drivers/power/supply/cpcap-battery.c
+++ b/drivers/power/supply/cpcap-battery.c
@@ -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"
 	};
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] power: supply: cpcap-battery: make array cpcap_battery_irqs static, shrinks object size
  2018-11-29 23:03 [PATCH] power: supply: cpcap-battery: make array cpcap_battery_irqs static, shrinks object size Colin King
@ 2018-12-05 17:28 ` Sebastian Reichel
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2018-12-05 17:28 UTC (permalink / raw)
  To: Colin King; +Cc: linux-pm, kernel-janitors, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1390 bytes --]

Hi,

On Thu, Nov 29, 2018 at 11:03:42PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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>
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/supply/cpcap-battery.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/supply/cpcap-battery.c b/drivers/power/supply/cpcap-battery.c
> index 98ba07869c3b..204e22e3e9b4 100644
> --- a/drivers/power/supply/cpcap-battery.c
> +++ b/drivers/power/supply/cpcap-battery.c
> @@ -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"
>  	};
> -- 
> 2.19.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-05 17:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-29 23:03 [PATCH] power: supply: cpcap-battery: make array cpcap_battery_irqs static, shrinks object size Colin King
2018-12-05 17:28 ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).