LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] mwifiex: make arrays static const, makes object smaller
@ 2021-08-19 12:16 Colin King
  2021-08-21 17:50 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-08-19 12:16 UTC (permalink / raw)
  To: Amitkumar Karwar, Ganapathi Bhat, Sharvari Harisangam,
	Xinming Hu, Kalle Valo, David S . Miller, Jakub Kicinski,
	linux-wireless, netdev
  Cc: kernel-janitors, linux-kernel

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

Don't populate the arrays wpa_oui and wps_oui on the stack but
instead them static const. Makes the object code smaller by 63 bytes:

Before:
   text   data  bss     dec    hex filename
  29453   5451   64   34968   8898 .../wireless/marvell/mwifiex/sta_ioctl.o

After:
   text	  data  bss     dec    hex filename
  29356	  5611   64   35031   88d7 ../wireless/marvell/mwifiex/sta_ioctl.o

(gcc version 10.3.0)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/wireless/marvell/mwifiex/sta_ioctl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
index 653f9e094256..fb3b11cf123b 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
@@ -1325,8 +1325,8 @@ mwifiex_set_gen_ie_helper(struct mwifiex_private *priv, u8 *ie_data_ptr,
 			  u16 ie_len)
 {
 	struct ieee_types_vendor_header *pvendor_ie;
-	const u8 wpa_oui[] = { 0x00, 0x50, 0xf2, 0x01 };
-	const u8 wps_oui[] = { 0x00, 0x50, 0xf2, 0x04 };
+	static const u8 wpa_oui[] = { 0x00, 0x50, 0xf2, 0x01 };
+	static const u8 wps_oui[] = { 0x00, 0x50, 0xf2, 0x04 };
 	u16 unparsed_len = ie_len, cur_ie_len;
 
 	/* If the passed length is zero, reset the buffer */
-- 
2.32.0


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

* Re: [PATCH] mwifiex: make arrays static const, makes object smaller
  2021-08-19 12:16 [PATCH] mwifiex: make arrays static const, makes object smaller Colin King
@ 2021-08-21 17:50 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2021-08-21 17:50 UTC (permalink / raw)
  To: Colin King
  Cc: Amitkumar Karwar, Ganapathi Bhat, Sharvari Harisangam,
	Xinming Hu, David S . Miller, Jakub Kicinski, linux-wireless,
	netdev, kernel-janitors, linux-kernel

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

> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate the arrays wpa_oui and wps_oui on the stack but
> instead them static const. Makes the object code smaller by 63 bytes:
> 
> Before:
>    text   data  bss     dec    hex filename
>   29453   5451   64   34968   8898 .../wireless/marvell/mwifiex/sta_ioctl.o
> 
> After:
>    text	  data  bss     dec    hex filename
>   29356	  5611   64   35031   88d7 ../wireless/marvell/mwifiex/sta_ioctl.o
> 
> (gcc version 10.3.0)
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

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

da2c9cedc0d0 mwifiex: make arrays static const, makes object smaller

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20210819121651.7566-1-colin.king@canonical.com/

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


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

end of thread, other threads:[~2021-08-21 17:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19 12:16 [PATCH] mwifiex: make arrays static const, makes object smaller Colin King
2021-08-21 17:50 ` Kalle Valo

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