Linux-Wireless Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] ssb: make array pwr_info_offset static const, makes object smaller
@ 2019-09-06 15:40 Colin King
  2019-09-09 17:53 ` Michael Büsch
  2019-09-13 14:23 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2019-09-06 15:40 UTC (permalink / raw)
  To: Michael Buesch, linux-wireless; +Cc: kernel-janitors, linux-kernel

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

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

Before:
   text	   data	    bss	    dec	    hex	filename
  26066	   3000	     64	  29130	   71ca	drivers/ssb/pci.o

After:
   text	   data	    bss	    dec	    hex	filename
  25763	   3096	     64	  28923	   70fb	drivers/ssb/pci.o

(gcc version 9.2.1, amd64)

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

diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c
index da2d2ab8104d..7c3ae52f2b15 100644
--- a/drivers/ssb/pci.c
+++ b/drivers/ssb/pci.c
@@ -595,7 +595,7 @@ static void sprom_extract_r8(struct ssb_sprom *out, const u16 *in)
 {
 	int i;
 	u16 o;
-	u16 pwr_info_offset[] = {
+	static const u16 pwr_info_offset[] = {
 		SSB_SROM8_PWR_INFO_CORE0, SSB_SROM8_PWR_INFO_CORE1,
 		SSB_SROM8_PWR_INFO_CORE2, SSB_SROM8_PWR_INFO_CORE3
 	};
-- 
2.20.1


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

* Re: [PATCH] ssb: make array pwr_info_offset static const, makes object smaller
  2019-09-06 15:40 [PATCH] ssb: make array pwr_info_offset static const, makes object smaller Colin King
@ 2019-09-09 17:53 ` Michael Büsch
  2019-09-13 14:23 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Büsch @ 2019-09-09 17:53 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Colin King, linux-wireless, kernel-janitors, linux-kernel

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

On Fri,  6 Sep 2019 16:40:53 +0100
Colin King <colin.king@canonical.com> wrote:

> diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c
> index da2d2ab8104d..7c3ae52f2b15 100644
> --- a/drivers/ssb/pci.c
> +++ b/drivers/ssb/pci.c
> @@ -595,7 +595,7 @@ static void sprom_extract_r8(struct ssb_sprom *out, const u16 *in)
>  {
>  	int i;
>  	u16 o;
> -	u16 pwr_info_offset[] = {
> +	static const u16 pwr_info_offset[] = {
>  		SSB_SROM8_PWR_INFO_CORE0, SSB_SROM8_PWR_INFO_CORE1,
>  		SSB_SROM8_PWR_INFO_CORE2, SSB_SROM8_PWR_INFO_CORE3
>  	};

Thanks for your contribution. This change makes sense.

Kalle, can you please take it?

Acked-by: Michael Büsch <m@bues.ch>

-- 
Michael

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

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

* Re: [PATCH] ssb: make array pwr_info_offset static const, makes object smaller
  2019-09-06 15:40 [PATCH] ssb: make array pwr_info_offset static const, makes object smaller Colin King
  2019-09-09 17:53 ` Michael Büsch
@ 2019-09-13 14:23 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2019-09-13 14:23 UTC (permalink / raw)
  To: Colin King; +Cc: Michael Buesch, linux-wireless, kernel-janitors, linux-kernel

Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate the array pwr_info_offset on the stack but instead make it
> static const. Makes the object code smaller by 207 bytes.
> 
> Before:
>    text	   data	    bss	    dec	    hex	filename
>   26066	   3000	     64	  29130	   71ca	drivers/ssb/pci.o
> 
> After:
>    text	   data	    bss	    dec	    hex	filename
>   25763	   3096	     64	  28923	   70fb	drivers/ssb/pci.o
> 
> (gcc version 9.2.1, amd64)
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> Acked-by: Michael Büsch <m@bues.ch>

Patch applied to wireless-drivers-next.git, thanks.

d3bb26868105 ssb: make array pwr_info_offset static const, makes object smaller

-- 
https://patchwork.kernel.org/patch/11135599/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 15:40 [PATCH] ssb: make array pwr_info_offset static const, makes object smaller Colin King
2019-09-09 17:53 ` Michael Büsch
2019-09-13 14:23 ` Kalle Valo

Linux-Wireless Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-wireless/0 linux-wireless/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-wireless linux-wireless/ https://lore.kernel.org/linux-wireless \
		linux-wireless@vger.kernel.org linux-wireless@archiver.kernel.org
	public-inbox-index linux-wireless


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-wireless


AGPL code for this site: git clone https://public-inbox.org/ public-inbox