linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hwmon: abituguru: make array probe_order static, makes object smaller
@ 2019-10-06 14:52 Colin King
  2019-10-06 15:12 ` Hans de Goede
  2019-10-06 15:34 ` Guenter Roeck
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2019-10-06 14:52 UTC (permalink / raw)
  To: Hans de Goede, Jean Delvare, Guenter Roeck, linux-hwmon
  Cc: kernel-janitors, linux-kernel

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

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

Before:
   text	   data	    bss	    dec	    hex	filename
  41473	  13448	    320	  55241	   d7c9	drivers/hwmon/abituguru.o

After:
   text	   data	    bss	    dec	    hex	filename
  41315	  13512	    320	  55147	   d76b	drivers/hwmon/abituguru.o

(gcc version 9.2.1, amd64)

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

diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c
index a5cf6b2a6e49..681f0623868f 100644
--- a/drivers/hwmon/abituguru.c
+++ b/drivers/hwmon/abituguru.c
@@ -1264,7 +1264,7 @@ static int abituguru_probe(struct platform_device *pdev)
 	 * El weirdo probe order, to keep the sysfs order identical to the
 	 * BIOS and window-appliction listing order.
 	 */
-	const u8 probe_order[ABIT_UGURU_MAX_BANK1_SENSORS] = {
+	static const u8 probe_order[ABIT_UGURU_MAX_BANK1_SENSORS] = {
 		0x00, 0x01, 0x03, 0x04, 0x0A, 0x08, 0x0E, 0x02,
 		0x09, 0x06, 0x05, 0x0B, 0x0F, 0x0D, 0x07, 0x0C };
 
-- 
2.20.1


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

* Re: [PATCH] hwmon: abituguru: make array probe_order static, makes object smaller
  2019-10-06 14:52 [PATCH] hwmon: abituguru: make array probe_order static, makes object smaller Colin King
@ 2019-10-06 15:12 ` Hans de Goede
  2019-10-06 15:34 ` Guenter Roeck
  1 sibling, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2019-10-06 15:12 UTC (permalink / raw)
  To: Colin King, Jean Delvare, Guenter Roeck, linux-hwmon
  Cc: kernel-janitors, linux-kernel

Hi,

On 10/6/19 4:52 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate the array probe_order on the stack but instead make it
> static. Makes the object code smaller by 94 bytes.
> 
> Before:
>     text	   data	    bss	    dec	    hex	filename
>    41473	  13448	    320	  55241	   d7c9	drivers/hwmon/abituguru.o
> 
> After:
>     text	   data	    bss	    dec	    hex	filename
>    41315	  13512	    320	  55147	   d76b	drivers/hwmon/abituguru.o
> 
> (gcc version 9.2.1, amd64)
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans



> ---
>   drivers/hwmon/abituguru.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c
> index a5cf6b2a6e49..681f0623868f 100644
> --- a/drivers/hwmon/abituguru.c
> +++ b/drivers/hwmon/abituguru.c
> @@ -1264,7 +1264,7 @@ static int abituguru_probe(struct platform_device *pdev)
>   	 * El weirdo probe order, to keep the sysfs order identical to the
>   	 * BIOS and window-appliction listing order.
>   	 */
> -	const u8 probe_order[ABIT_UGURU_MAX_BANK1_SENSORS] = {
> +	static const u8 probe_order[ABIT_UGURU_MAX_BANK1_SENSORS] = {
>   		0x00, 0x01, 0x03, 0x04, 0x0A, 0x08, 0x0E, 0x02,
>   		0x09, 0x06, 0x05, 0x0B, 0x0F, 0x0D, 0x07, 0x0C };
>   
> 


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

* Re: [PATCH] hwmon: abituguru: make array probe_order static, makes object smaller
  2019-10-06 14:52 [PATCH] hwmon: abituguru: make array probe_order static, makes object smaller Colin King
  2019-10-06 15:12 ` Hans de Goede
@ 2019-10-06 15:34 ` Guenter Roeck
  1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2019-10-06 15:34 UTC (permalink / raw)
  To: Colin King
  Cc: Hans de Goede, Jean Delvare, linux-hwmon, kernel-janitors, linux-kernel

On Sun, Oct 06, 2019 at 03:52:31PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate the array probe_order on the stack but instead make it
> static. Makes the object code smaller by 94 bytes.
> 
> Before:
>    text	   data	    bss	    dec	    hex	filename
>   41473	  13448	    320	  55241	   d7c9	drivers/hwmon/abituguru.o
> 
> After:
>    text	   data	    bss	    dec	    hex	filename
>   41315	  13512	    320	  55147	   d76b	drivers/hwmon/abituguru.o
> 
> (gcc version 9.2.1, amd64)
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/abituguru.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c
> index a5cf6b2a6e49..681f0623868f 100644
> --- a/drivers/hwmon/abituguru.c
> +++ b/drivers/hwmon/abituguru.c
> @@ -1264,7 +1264,7 @@ static int abituguru_probe(struct platform_device *pdev)
>  	 * El weirdo probe order, to keep the sysfs order identical to the
>  	 * BIOS and window-appliction listing order.
>  	 */
> -	const u8 probe_order[ABIT_UGURU_MAX_BANK1_SENSORS] = {
> +	static const u8 probe_order[ABIT_UGURU_MAX_BANK1_SENSORS] = {
>  		0x00, 0x01, 0x03, 0x04, 0x0A, 0x08, 0x0E, 0x02,
>  		0x09, 0x06, 0x05, 0x0B, 0x0F, 0x0D, 0x07, 0x0C };
>  

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

end of thread, other threads:[~2019-10-06 15:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-06 14:52 [PATCH] hwmon: abituguru: make array probe_order static, makes object smaller Colin King
2019-10-06 15:12 ` Hans de Goede
2019-10-06 15:34 ` Guenter Roeck

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).