linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/62] drivers/net: Use static const
@ 2010-11-21  2:38 Joe Perches
  2010-11-21  2:38 ` [PATCH 50/62] ar9170: Use const Joe Perches
                   ` (13 more replies)
  0 siblings, 14 replies; 21+ messages in thread
From: Joe Perches @ 2010-11-21  2:38 UTC (permalink / raw)
  To: netdev, e1000-devel, linux-usb, linux-wireless, ath5k-devel,
	ath9k-devel, libertas-dev, users
  Cc: linux-kernel, socketcan-core

Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

Summary of sizes old and new.  Compiled allyesconfig x86 only.

   text	   data	    bss	    dec	    hex	filename
2075402   67170  466644 2609216  27d040 (TOTALS) -new
2074597   70614  466668 2611879  27daa7 (TOTALS) -old

Joe Perches (62):
  3c501: Use static const
  3c503: Use static const
  3c507: Use static const
  3c527: Use static const
  at1700: Use static const
  benet: Use static const
  bnx2: Use static const
  bnx2x: Use static const
  can: Use static const
  chelsio: Use static const
  cxgb3: Use static const
  cxgb3: Use static const
  cxgb4: Use static const
  cxgb4vf: Use static const
  e1000: Use static const
  e1000: Use static const
  e1000e: Use static const
  e2100: Use static const
  eepro: Use static const
  eexpress: Use static const
  gianfar: Use static const
  hp: Use static const
  igb: Use static const
  irda: Use static const
  irda: Use static const
  ixgbe: Use static const
  ixgbevf: Use static const
  ixgb: Use static const
  jme: Use static const
  ksz884x: Use static const
  netxen: Use static const
  ni52: Use static const
  ni65: Use static const
  pcmcia: Use static const
  qlcnic: Use static const
  qlge: Use static const
  r8169: Use static const
  s2io: Use static const
  skfp: Use static const
  skge: Use static const
  smc-ultra: Use static const
  tg3: Use static const
  tokenring: Use static const
  tulip: Use static const
  tulip: Use static const
  usb: Use static const
  vmxnet3: Use static const
  wan: Use static const
  wd: Use static const
  ar9170: Use const
  ath5k: Use static const
  ath9k: Use static const
  carl9170: Use static const
  atmel: Use static const
  b43: Use static const
  iwlwifi: Use static const
  libertas: Use static const
  ray_cs: Use static const
  rndis_wlan: Use static const
  rt2x00: Use static const
  wl12xx: Use static const
  zd1211rw: Use const

 drivers/net/3c501.c                            |    4 +-
 drivers/net/3c503.c                            |    4 +-
 drivers/net/3c507.c                            |    4 +-
 drivers/net/3c527.c                            |    6 +-
 drivers/net/at1700.c                           |    6 +-
 drivers/net/benet/be_ethtool.c                 |    4 +-
 drivers/net/benet/be_main.c                    |   10 ++--
 drivers/net/bnx2.c                             |   46 ++++++++++++-----------
 drivers/net/bnx2x/bnx2x_main.c                 |    6 ++-
 drivers/net/can/sja1000/plx_pci.c              |    2 +-
 drivers/net/chelsio/sge.c                      |   10 ++---
 drivers/net/cxgb3/ael1002.c                    |   24 ++++++------
 drivers/net/cxgb3/t3_hw.c                      |    2 +-
 drivers/net/cxgb4/t4_hw.c                      |   48 ++++++++++++------------
 drivers/net/cxgb4vf/t4vf_hw.c                  |    2 +-
 drivers/net/e1000/e1000_hw.c                   |    8 ++--
 drivers/net/e1000/e1000_param.c                |   13 +++---
 drivers/net/e1000e/phy.c                       |   11 +++--
 drivers/net/e2100.c                            |    2 +-
 drivers/net/eepro.c                            |    9 ++--
 drivers/net/eexpress.c                         |    2 +-
 drivers/net/gianfar.c                          |   10 +++--
 drivers/net/hp.c                               |    6 +-
 drivers/net/igb/e1000_phy.c                    |   11 +++--
 drivers/net/irda/act200l-sir.c                 |    2 +-
 drivers/net/irda/donauboe.c                    |    4 +-
 drivers/net/ixgb/ixgb_param.c                  |   21 +++++-----
 drivers/net/ixgbe/ixgbe_ethtool.c              |   22 ++++++----
 drivers/net/ixgbevf/ethtool.c                  |   18 +++++---
 drivers/net/jme.c                              |    4 +-
 drivers/net/ksz884x.c                          |   20 +++++-----
 drivers/net/netxen/netxen_nic_hw.c             |   16 +++++---
 drivers/net/ni52.c                             |    4 +-
 drivers/net/ni65.c                             |    4 +-
 drivers/net/pcmcia/nmclan_cs.c                 |    2 +-
 drivers/net/qlcnic/qlcnic_hw.c                 |   15 ++++---
 drivers/net/qlge/qlge_main.c                   |   13 +++---
 drivers/net/r8169.c                            |    2 +-
 drivers/net/s2io.c                             |   20 ++++++----
 drivers/net/skfp/smt.c                         |    4 +-
 drivers/net/skge.c                             |    4 +-
 drivers/net/smc-ultra.c                        |    8 +++-
 drivers/net/tg3.c                              |   26 ++++++-------
 drivers/net/tokenring/ibmtr.c                  |    5 +-
 drivers/net/tulip/de2104x.c                    |   18 ++++++---
 drivers/net/tulip/tulip_core.c                 |   15 ++++---
 drivers/net/usb/hso.c                          |   39 ++++++++-----------
 drivers/net/vmxnet3/vmxnet3_drv.c              |    4 +-
 drivers/net/wan/dscc4.c                        |    6 +-
 drivers/net/wd.c                               |    2 +-
 drivers/net/wireless/ath/ar9170/cmd.c          |    2 +-
 drivers/net/wireless/ath/ath5k/ani.c           |   34 ++++++++--------
 drivers/net/wireless/ath/ath9k/ani.c           |    8 ++--
 drivers/net/wireless/ath/ath9k/ar5008_phy.c    |   32 ++++++++-------
 drivers/net/wireless/ath/ath9k/ar9002_phy.c    |   12 +++--
 drivers/net/wireless/ath/ath9k/ar9003_calib.c  |   10 ++--
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c |    8 ++-
 drivers/net/wireless/ath/ath9k/ar9003_paprd.c  |    4 +-
 drivers/net/wireless/ath/ath9k/ar9003_phy.c    |    4 +-
 drivers/net/wireless/ath/ath9k/eeprom_4k.c     |   12 +++--
 drivers/net/wireless/ath/ath9k/eeprom_9287.c   |   14 +++---
 drivers/net/wireless/ath/ath9k/eeprom_def.c    |   17 +++++---
 drivers/net/wireless/ath/ath9k/htc_drv_init.c  |    2 +-
 drivers/net/wireless/ath/ath9k/hw.c            |    9 ++--
 drivers/net/wireless/ath/ath9k/rc.c            |    6 +-
 drivers/net/wireless/ath/carl9170/cmd.c        |    2 +-
 drivers/net/wireless/atmel.c                   |    6 ++-
 drivers/net/wireless/b43/phy_common.c          |    8 ++-
 drivers/net/wireless/b43/phy_n.c               |    9 ++--
 drivers/net/wireless/iwlwifi/iwl-3945.c        |    2 +-
 drivers/net/wireless/iwlwifi/iwl-agn-lib.c     |    6 +-
 drivers/net/wireless/libertas/cfg.c            |    2 +-
 drivers/net/wireless/libertas/rx.c             |    4 +-
 drivers/net/wireless/ray_cs.c                  |    4 +-
 drivers/net/wireless/rndis_wlan.c              |    9 +++-
 drivers/net/wireless/rt2x00/rt2800lib.c        |    2 +-
 drivers/net/wireless/wl12xx/wl1271_acx.c       |    4 +-
 drivers/net/wireless/zd1211rw/zd_chip.c        |    4 +-
 78 files changed, 422 insertions(+), 362 deletions(-)

-- 
1.7.3.2.245.g03276.dirty


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

* [PATCH 50/62] ar9170: Use const
  2010-11-21  2:38 [PATCH 00/62] drivers/net: Use static const Joe Perches
@ 2010-11-21  2:38 ` Joe Perches
  2010-11-21  2:38 ` [PATCH 51/62] ath5k: Use static const Joe Perches
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2010-11-21  2:38 UTC (permalink / raw)
  To: Christian Lamparter
  Cc: John W. Linville, linux-wireless, netdev, linux-kernel

Mark an array const.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/ath/ar9170/cmd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ar9170/cmd.c b/drivers/net/wireless/ath/ar9170/cmd.c
index 4604de0..6452c50 100644
--- a/drivers/net/wireless/ath/ar9170/cmd.c
+++ b/drivers/net/wireless/ath/ar9170/cmd.c
@@ -54,7 +54,7 @@ int ar9170_write_mem(struct ar9170 *ar, const __le32 *data, size_t len)
 
 int ar9170_write_reg(struct ar9170 *ar, const u32 reg, const u32 val)
 {
-	__le32 buf[2] = {
+	const __le32 buf[2] = {
 		cpu_to_le32(reg),
 		cpu_to_le32(val),
 	};
-- 
1.7.3.2.245.g03276.dirty


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

* [PATCH 51/62] ath5k: Use static const
  2010-11-21  2:38 [PATCH 00/62] drivers/net: Use static const Joe Perches
  2010-11-21  2:38 ` [PATCH 50/62] ar9170: Use const Joe Perches
@ 2010-11-21  2:38 ` Joe Perches
  2010-11-21  2:38 ` [PATCH 52/62] ath9k: " Joe Perches
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2010-11-21  2:38 UTC (permalink / raw)
  To: Jiri Slaby, Nick Kossifidis, Luis R. Rodriguez, Bob Copeland
  Cc: John W. Linville, linux-wireless, ath5k-devel, netdev,
	linux-kernel

Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text	   data	    bss	    dec	    hex	filename
  11266	     56	   2464	  13786	   35da	drivers/net/wireless/ath/ath5k/ani.o.old
  11181	     56	   2464	  13701	   3585	drivers/net/wireless/ath/ath5k/ani.o.new

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/ath/ath5k/ani.c |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/ani.c b/drivers/net/wireless/ath/ath5k/ani.c
index db98a85..6b75b22 100644
--- a/drivers/net/wireless/ath/ath5k/ani.c
+++ b/drivers/net/wireless/ath/ath5k/ani.c
@@ -63,15 +63,15 @@ ath5k_ani_set_noise_immunity_level(struct ath5k_hw *ah, int level)
 	 * so i stick with the HAL version for now...
 	 */
 #if 0
-	const s8 hi[] = { -18, -18, -16, -14, -12 };
-	const s8 lo[] = { -52, -56, -60, -64, -70 };
-	const s8 sz[] = { -34, -41, -48, -55, -62 };
-	const s8 fr[] = { -70, -72, -75, -78, -80 };
+	static const s8 hi[] = { -18, -18, -16, -14, -12 };
+	static const s8 lo[] = { -52, -56, -60, -64, -70 };
+	static const s8 sz[] = { -34, -41, -48, -55, -62 };
+	static const s8 fr[] = { -70, -72, -75, -78, -80 };
 #else
-	const s8 sz[] = { -55, -62 };
-	const s8 lo[] = { -64, -70 };
-	const s8 hi[] = { -14, -12 };
-	const s8 fr[] = { -78, -80 };
+	static const s8 sz[] = { -55, -62 };
+	static const s8 lo[] = { -64, -70 };
+	static const s8 hi[] = { -14, -12 };
+	static const s8 fr[] = { -78, -80 };
 #endif
 	if (level < 0 || level >= ARRAY_SIZE(sz)) {
 		ATH5K_ERR(ah->ah_sc, "noise immuniy level %d out of range",
@@ -102,7 +102,7 @@ ath5k_ani_set_noise_immunity_level(struct ath5k_hw *ah, int level)
 void
 ath5k_ani_set_spur_immunity_level(struct ath5k_hw *ah, int level)
 {
-	const int val[] = { 2, 4, 6, 8, 10, 12, 14, 16 };
+	static const int val[] = { 2, 4, 6, 8, 10, 12, 14, 16 };
 
 	if (level < 0 || level >= ARRAY_SIZE(val) ||
 	    level > ah->ah_sc->ani_state.max_spur_level) {
@@ -127,7 +127,7 @@ ath5k_ani_set_spur_immunity_level(struct ath5k_hw *ah, int level)
 void
 ath5k_ani_set_firstep_level(struct ath5k_hw *ah, int level)
 {
-	const int val[] = { 0, 4, 8 };
+	static const int val[] = { 0, 4, 8 };
 
 	if (level < 0 || level >= ARRAY_SIZE(val)) {
 		ATH5K_ERR(ah->ah_sc, "firstep level %d out of range", level);
@@ -151,12 +151,12 @@ ath5k_ani_set_firstep_level(struct ath5k_hw *ah, int level)
 void
 ath5k_ani_set_ofdm_weak_signal_detection(struct ath5k_hw *ah, bool on)
 {
-	const int m1l[] = { 127, 50 };
-	const int m2l[] = { 127, 40 };
-	const int m1[] = { 127, 0x4d };
-	const int m2[] = { 127, 0x40 };
-	const int m2cnt[] = { 31, 16 };
-	const int m2lcnt[] = { 63, 48 };
+	static const int m1l[] = { 127, 50 };
+	static const int m2l[] = { 127, 40 };
+	static const int m1[] = { 127, 0x4d };
+	static const int m2[] = { 127, 0x40 };
+	static const int m2cnt[] = { 31, 16 };
+	static const int m2lcnt[] = { 63, 48 };
 
 	AR5K_REG_WRITE_BITS(ah, AR5K_PHY_WEAK_OFDM_LOW_THR,
 				AR5K_PHY_WEAK_OFDM_LOW_THR_M1, m1l[on]);
@@ -192,7 +192,7 @@ ath5k_ani_set_ofdm_weak_signal_detection(struct ath5k_hw *ah, bool on)
 void
 ath5k_ani_set_cck_weak_signal_detection(struct ath5k_hw *ah, bool on)
 {
-	const int val[] = { 8, 6 };
+	static const int val[] = { 8, 6 };
 	AR5K_REG_WRITE_BITS(ah, AR5K_PHY_CCK_CROSSCORR,
 				AR5K_PHY_CCK_CROSSCORR_WEAK_SIG_THR, val[on]);
 	ah->ah_sc->ani_state.cck_weak_sig = on;
-- 
1.7.3.2.245.g03276.dirty


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

* [PATCH 52/62] ath9k: Use static const
  2010-11-21  2:38 [PATCH 00/62] drivers/net: Use static const Joe Perches
  2010-11-21  2:38 ` [PATCH 50/62] ar9170: Use const Joe Perches
  2010-11-21  2:38 ` [PATCH 51/62] ath5k: Use static const Joe Perches
@ 2010-11-21  2:38 ` Joe Perches
  2010-11-21  2:38 ` [PATCH 53/62] carl9170: " Joe Perches
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2010-11-21  2:38 UTC (permalink / raw)
  To: Luis R. Rodriguez, Jouni Malinen, Vasanthakumar Thiagarajan,
	Senthil Balasubramanian
  Cc: John W. Linville, linux-wireless, ath9k-devel, netdev,
	linux-kernel

Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text	   data	    bss	    dec	    hex	filename
  11161	     56	   2136	  13353	   3429	drivers/net/wireless/ath/ath9k/ar9003_paprd.o.new
  11167	     56	   2136	  13359	   342f	drivers/net/wireless/ath/ath9k/ar9003_paprd.o.old
  15428	     56	   3056	  18540	   486c	drivers/net/wireless/ath/ath9k/eeprom_4k.o.old
  15451	     56	   3056	  18563	   4883	drivers/net/wireless/ath/ath9k/eeprom_4k.o.new
  14087	     56	   2560	  16703	   413f	drivers/net/wireless/ath/ath9k/eeprom_9287.o.old
  14036	     56	   2560	  16652	   410c	drivers/net/wireless/ath/ath9k/eeprom_9287.o.new
  10041	     56	   2384	  12481	   30c1	drivers/net/wireless/ath/ath9k/ani.o.new
  10088	     56	   2384	  12528	   30f0	drivers/net/wireless/ath/ath9k/ani.o.old
   9316	   1580	   2304	  13200	   3390	drivers/net/wireless/ath/ath9k/htc_drv_init.o.new
   9316	   1580	   2304	  13200	   3390	drivers/net/wireless/ath/ath9k/htc_drv_init.o.old
  16483	     56	   3432	  19971	   4e03	drivers/net/wireless/ath/ath9k/ar9003_phy.o.new
  16517	     56	   3432	  20005	   4e25	drivers/net/wireless/ath/ath9k/ar9003_phy.o.old
  18221	    104	   2960	  21285	   5325	drivers/net/wireless/ath/ath9k/rc.o.old
  18203	    104	   2960	  21267	   5313	drivers/net/wireless/ath/ath9k/rc.o.new
  19985	     56	   4288	  24329	   5f09	drivers/net/wireless/ath/ath9k/eeprom_def.o.new
  20040	     56	   4288	  24384	   5f40	drivers/net/wireless/ath/ath9k/eeprom_def.o.old
  23997	     56	   4984	  29037	   716d	drivers/net/wireless/ath/ath9k/ar5008_phy.o.old
  23846	     56	   4984	  28886	   70d6	drivers/net/wireless/ath/ath9k/ar5008_phy.o.new
  24285	     56	   3184	  27525	   6b85	drivers/net/wireless/ath/ath9k/ar9003_eeprom.o.old
  24101	     56	   3184	  27341	   6acd	drivers/net/wireless/ath/ath9k/ar9003_eeprom.o.new
   6834	     56	   1032	   7922	   1ef2	drivers/net/wireless/ath/ath9k/ar9002_phy.o.old
   6780	     56	   1032	   7868	   1ebc	drivers/net/wireless/ath/ath9k/ar9002_phy.o.new
  36211	     64	   8624	  44899	   af63	drivers/net/wireless/ath/ath9k/hw.o.new
  36401	     64	   8624	  45089	   b021	drivers/net/wireless/ath/ath9k/hw.o.old
   9281	     56	   1496	  10833	   2a51	drivers/net/wireless/ath/ath9k/ar9003_calib.o.old
   9150	     56	   1496	  10702	   29ce	drivers/net/wireless/ath/ath9k/ar9003_calib.o.new

Use ARRAY_SIZE instead of a magic number.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/ath/ath9k/ani.c           |    8 +++---
 drivers/net/wireless/ath/ath9k/ar5008_phy.c    |   32 ++++++++++++-----------
 drivers/net/wireless/ath/ath9k/ar9002_phy.c    |   12 +++++---
 drivers/net/wireless/ath/ath9k/ar9003_calib.c  |   10 +++---
 drivers/net/wireless/ath/ath9k/ar9003_eeprom.c |    8 +++--
 drivers/net/wireless/ath/ath9k/ar9003_paprd.c  |    4 +-
 drivers/net/wireless/ath/ath9k/ar9003_phy.c    |    4 +-
 drivers/net/wireless/ath/ath9k/eeprom_4k.c     |   12 +++++---
 drivers/net/wireless/ath/ath9k/eeprom_9287.c   |   14 +++++-----
 drivers/net/wireless/ath/ath9k/eeprom_def.c    |   17 +++++++-----
 drivers/net/wireless/ath/ath9k/htc_drv_init.c  |    2 +-
 drivers/net/wireless/ath/ath9k/hw.c            |    9 +++---
 drivers/net/wireless/ath/ath9k/rc.c            |    6 ++--
 13 files changed, 74 insertions(+), 64 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index 63ccb39..29a045d 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -834,10 +834,10 @@ void ath9k_hw_ani_setup(struct ath_hw *ah)
 {
 	int i;
 
-	const int totalSizeDesired[] = { -55, -55, -55, -55, -62 };
-	const int coarseHigh[] = { -14, -14, -14, -14, -12 };
-	const int coarseLow[] = { -64, -64, -64, -64, -70 };
-	const int firpwr[] = { -78, -78, -78, -78, -80 };
+	static const int totalSizeDesired[] = { -55, -55, -55, -55, -62 };
+	static const int coarseHigh[] = { -14, -14, -14, -14, -12 };
+	static const int coarseLow[] = { -64, -64, -64, -64, -70 };
+	static const int firpwr[] = { -78, -78, -78, -78, -80 };
 
 	for (i = 0; i < 5; i++) {
 		ah->totalSizeDesired[i] = totalSizeDesired[i];
diff --git a/drivers/net/wireless/ath/ath9k/ar5008_phy.c b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
index 7303d98..06e34d2 100644
--- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
@@ -244,13 +244,15 @@ static void ar5008_hw_spur_mitigate(struct ath_hw *ah,
 	int upper, lower, cur_vit_mask;
 	int tmp, new;
 	int i;
-	int pilot_mask_reg[4] = { AR_PHY_TIMING7, AR_PHY_TIMING8,
-			  AR_PHY_PILOT_MASK_01_30, AR_PHY_PILOT_MASK_31_60
+	static int pilot_mask_reg[4] = {
+		AR_PHY_TIMING7, AR_PHY_TIMING8,
+		AR_PHY_PILOT_MASK_01_30, AR_PHY_PILOT_MASK_31_60
 	};
-	int chan_mask_reg[4] = { AR_PHY_TIMING9, AR_PHY_TIMING10,
-			 AR_PHY_CHANNEL_MASK_01_30, AR_PHY_CHANNEL_MASK_31_60
+	static int chan_mask_reg[4] = {
+		AR_PHY_TIMING9, AR_PHY_TIMING10,
+		AR_PHY_CHANNEL_MASK_01_30, AR_PHY_CHANNEL_MASK_31_60
 	};
-	int inc[4] = { 0, 100, 0, 0 };
+	static int inc[4] = { 0, 100, 0, 0 };
 
 	int8_t mask_m[123];
 	int8_t mask_p[123];
@@ -1084,12 +1086,12 @@ static bool ar5008_hw_ani_control_old(struct ath_hw *ah,
 		break;
 	}
 	case ATH9K_ANI_OFDM_WEAK_SIGNAL_DETECTION:{
-		const int m1ThreshLow[] = { 127, 50 };
-		const int m2ThreshLow[] = { 127, 40 };
-		const int m1Thresh[] = { 127, 0x4d };
-		const int m2Thresh[] = { 127, 0x40 };
-		const int m2CountThr[] = { 31, 16 };
-		const int m2CountThrLow[] = { 63, 48 };
+		static const int m1ThreshLow[] = { 127, 50 };
+		static const int m2ThreshLow[] = { 127, 40 };
+		static const int m1Thresh[] = { 127, 0x4d };
+		static const int m2Thresh[] = { 127, 0x40 };
+		static const int m2CountThr[] = { 31, 16 };
+		static const int m2CountThrLow[] = { 63, 48 };
 		u32 on = param ? 1 : 0;
 
 		REG_RMW_FIELD(ah, AR_PHY_SFCORR_LOW,
@@ -1141,7 +1143,7 @@ static bool ar5008_hw_ani_control_old(struct ath_hw *ah,
 		break;
 	}
 	case ATH9K_ANI_CCK_WEAK_SIGNAL_THR:{
-		const int weakSigThrCck[] = { 8, 6 };
+		static const int weakSigThrCck[] = { 8, 6 };
 		u32 high = param ? 1 : 0;
 
 		REG_RMW_FIELD(ah, AR_PHY_CCK_DETECT,
@@ -1157,7 +1159,7 @@ static bool ar5008_hw_ani_control_old(struct ath_hw *ah,
 		break;
 	}
 	case ATH9K_ANI_FIRSTEP_LEVEL:{
-		const int firstep[] = { 0, 4, 8 };
+		static const int firstep[] = { 0, 4, 8 };
 		u32 level = param;
 
 		if (level >= ARRAY_SIZE(firstep)) {
@@ -1178,7 +1180,7 @@ static bool ar5008_hw_ani_control_old(struct ath_hw *ah,
 		break;
 	}
 	case ATH9K_ANI_SPUR_IMMUNITY_LEVEL:{
-		const int cycpwrThr1[] = { 2, 4, 6, 8, 10, 12, 14, 16 };
+		static const int cycpwrThr1[] = { 2, 4, 6, 8, 10, 12, 14, 16 };
 		u32 level = param;
 
 		if (level >= ARRAY_SIZE(cycpwrThr1)) {
@@ -1627,7 +1629,7 @@ static void ar5008_hw_set_radar_conf(struct ath_hw *ah)
 void ar5008_hw_attach_phy_ops(struct ath_hw *ah)
 {
 	struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
-	const u32 ar5416_cca_regs[6] = {
+	static const u32 ar5416_cca_regs[6] = {
 		AR_PHY_CCA,
 		AR_PHY_CH1_CCA,
 		AR_PHY_CH2_CCA,
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_phy.c b/drivers/net/wireless/ath/ath9k/ar9002_phy.c
index 3fb97fd..7ae66a8 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_phy.c
@@ -175,13 +175,15 @@ static void ar9002_hw_spur_mitigate(struct ath_hw *ah,
 	int upper, lower, cur_vit_mask;
 	int tmp, newVal;
 	int i;
-	int pilot_mask_reg[4] = { AR_PHY_TIMING7, AR_PHY_TIMING8,
-			  AR_PHY_PILOT_MASK_01_30, AR_PHY_PILOT_MASK_31_60
+	static const int pilot_mask_reg[4] = {
+		AR_PHY_TIMING7, AR_PHY_TIMING8,
+		AR_PHY_PILOT_MASK_01_30, AR_PHY_PILOT_MASK_31_60
 	};
-	int chan_mask_reg[4] = { AR_PHY_TIMING9, AR_PHY_TIMING10,
-			 AR_PHY_CHANNEL_MASK_01_30, AR_PHY_CHANNEL_MASK_31_60
+	static const int chan_mask_reg[4] = {
+		AR_PHY_TIMING9, AR_PHY_TIMING10,
+		AR_PHY_CHANNEL_MASK_01_30, AR_PHY_CHANNEL_MASK_31_60
 	};
-	int inc[4] = { 0, 100, 0, 0 };
+	static const int inc[4] = { 0, 100, 0, 0 };
 	struct chan_centers centers;
 
 	int8_t mask_m[123];
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
index 32eed19..4c94c9e 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
@@ -196,7 +196,7 @@ static void ar9003_hw_iqcalibrate(struct ath_hw *ah, u8 numChains)
 	u32 qCoffDenom, iCoffDenom;
 	int32_t qCoff, iCoff;
 	int iqCorrNeg, i;
-	const u_int32_t offset_array[3] = {
+	static const u_int32_t offset_array[3] = {
 		AR_PHY_RX_IQCAL_CORR_B0,
 		AR_PHY_RX_IQCAL_CORR_B1,
 		AR_PHY_RX_IQCAL_CORR_B2,
@@ -603,22 +603,22 @@ static bool ar9003_hw_calc_iq_corr(struct ath_hw *ah,
 static void ar9003_hw_tx_iq_cal(struct ath_hw *ah)
 {
 	struct ath_common *common = ath9k_hw_common(ah);
-	const u32 txiqcal_status[AR9300_MAX_CHAINS] = {
+	static const u32 txiqcal_status[AR9300_MAX_CHAINS] = {
 		AR_PHY_TX_IQCAL_STATUS_B0,
 		AR_PHY_TX_IQCAL_STATUS_B1,
 		AR_PHY_TX_IQCAL_STATUS_B2,
 	};
-	const u32 tx_corr_coeff[AR9300_MAX_CHAINS] = {
+	static const u32 tx_corr_coeff[AR9300_MAX_CHAINS] = {
 		AR_PHY_TX_IQCAL_CORR_COEFF_01_B0,
 		AR_PHY_TX_IQCAL_CORR_COEFF_01_B1,
 		AR_PHY_TX_IQCAL_CORR_COEFF_01_B2,
 	};
-	const u32 rx_corr[AR9300_MAX_CHAINS] = {
+	static const u32 rx_corr[AR9300_MAX_CHAINS] = {
 		AR_PHY_RX_IQCAL_CORR_B0,
 		AR_PHY_RX_IQCAL_CORR_B1,
 		AR_PHY_RX_IQCAL_CORR_B2,
 	};
-	const u_int32_t chan_info_tab[] = {
+	static const u_int32_t chan_info_tab[] = {
 		AR_PHY_CHAN_INFO_TAB_0,
 		AR_PHY_CHAN_INFO_TAB_1,
 		AR_PHY_CHAN_INFO_TAB_2,
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index 9a7e151..3161a59 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -4455,14 +4455,16 @@ static void ar9003_hw_set_power_per_rate_table(struct ath_hw *ah,
 	int i;
 	int16_t  twiceLargestAntenna;
 	u16 scaledPower = 0, minCtlPower, maxRegAllowedPower;
-	u16 ctlModesFor11a[] = {
+	static const u16 ctlModesFor11a[] = {
 		CTL_11A, CTL_5GHT20, CTL_11A_EXT, CTL_5GHT40
 	};
-	u16 ctlModesFor11g[] = {
+	static const u16 ctlModesFor11g[] = {
 		CTL_11B, CTL_11G, CTL_2GHT20, CTL_11B_EXT,
 		CTL_11G_EXT, CTL_2GHT40
 	};
-	u16 numCtlModes, *pCtlMode, ctlMode, freq;
+	u16 numCtlModes;
+	const u16 *pCtlMode;
+	u16 ctlMode, freq;
 	struct chan_centers centers;
 	u8 *ctlIndex;
 	u8 ctlNum;
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
index 716db41..850bc98 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
@@ -32,12 +32,12 @@ static void ar9003_paprd_setup_single_table(struct ath_hw *ah)
 {
 	struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep;
 	struct ar9300_modal_eep_header *hdr;
-	const u32 ctrl0[3] = {
+	static const u32 ctrl0[3] = {
 		AR_PHY_PAPRD_CTRL0_B0,
 		AR_PHY_PAPRD_CTRL0_B1,
 		AR_PHY_PAPRD_CTRL0_B2
 	};
-	const u32 ctrl1[3] = {
+	static const u32 ctrl1[3] = {
 		AR_PHY_PAPRD_CTRL1_B0,
 		AR_PHY_PAPRD_CTRL1_B1,
 		AR_PHY_PAPRD_CTRL1_B2
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index e8d6455..656d8ce 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -128,7 +128,7 @@ static int ar9003_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan)
 static void ar9003_hw_spur_mitigate_mrc_cck(struct ath_hw *ah,
 					    struct ath9k_channel *chan)
 {
-	u32 spur_freq[4] = { 2420, 2440, 2464, 2480 };
+	static const u32 spur_freq[4] = { 2420, 2440, 2464, 2480 };
 	int cur_bb_spur, negative = 0, cck_spur_freq;
 	int i;
 
@@ -1161,7 +1161,7 @@ static void ar9003_hw_set_radar_conf(struct ath_hw *ah)
 void ar9003_hw_attach_phy_ops(struct ath_hw *ah)
 {
 	struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
-	const u32 ar9300_cca_regs[6] = {
+	static const u32 ar9300_cca_regs[6] = {
 		AR_PHY_CCA_0,
 		AR_PHY_CCA_1,
 		AR_PHY_CCA_2,
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_4k.c b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
index c40c534..c2481b3 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
@@ -534,7 +534,9 @@ static void ath9k_hw_set_4k_power_per_rate_table(struct ath_hw *ah,
 	u16 twiceMinEdgePower;
 	u16 twiceMaxEdgePower = AR5416_MAX_RATE_POWER;
 	u16 scaledPower = 0, minCtlPower, maxRegAllowedPower;
-	u16 numCtlModes, *pCtlMode, ctlMode, freq;
+	u16 numCtlModes;
+	const u16 *pCtlMode;
+	u16 ctlMode, freq;
 	struct chan_centers centers;
 	struct cal_ctl_data_4k *rep;
 	struct ar5416_eeprom_4k *pEepData = &ah->eeprom.map4k;
@@ -550,10 +552,10 @@ static void ath9k_hw_set_4k_power_per_rate_table(struct ath_hw *ah,
 	struct cal_target_power_ht targetPowerHt20, targetPowerHt40 = {
 		0, {0, 0, 0, 0}
 	};
-	u16 ctlModesFor11g[] =
-		{ CTL_11B, CTL_11G, CTL_2GHT20, CTL_11B_EXT, CTL_11G_EXT,
-		  CTL_2GHT40
-		};
+	static const u16 ctlModesFor11g[] = {
+		CTL_11B, CTL_11G, CTL_2GHT20,
+		CTL_11B_EXT, CTL_11G_EXT, CTL_2GHT40
+	};
 
 	ath9k_hw_get_channel_centers(ah, chan, &centers);
 
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
index 3ad1de2..e756978 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
@@ -626,13 +626,13 @@ static void ath9k_hw_set_ar9287_power_per_rate_table(struct ath_hw *ah,
 	struct cal_target_power_ht targetPowerHt20,
 				    targetPowerHt40 = {0, {0, 0, 0, 0} };
 	u16 scaledPower = 0, minCtlPower, maxRegAllowedPower;
-	u16 ctlModesFor11g[] = {CTL_11B,
-				CTL_11G,
-				CTL_2GHT20,
-				CTL_11B_EXT,
-				CTL_11G_EXT,
-				CTL_2GHT40};
-	u16 numCtlModes = 0, *pCtlMode = NULL, ctlMode, freq;
+	static const u16 ctlModesFor11g[] = {
+		CTL_11B, CTL_11G, CTL_2GHT20,
+		CTL_11B_EXT, CTL_11G_EXT, CTL_2GHT40
+	};
+	u16 numCtlModes = 0;
+	const u16 *pCtlMode = NULL;
+	u16 ctlMode, freq;
 	struct chan_centers centers;
 	int tx_chainmask;
 	u16 twiceMinEdgePower;
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_def.c b/drivers/net/wireless/ath/ath9k/eeprom_def.c
index a819ddc..e94216e 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
@@ -1021,13 +1021,16 @@ static void ath9k_hw_set_def_power_per_rate_table(struct ath_hw *ah,
 		0, {0, 0, 0, 0}
 	};
 	u16 scaledPower = 0, minCtlPower, maxRegAllowedPower;
-	u16 ctlModesFor11a[] =
-		{ CTL_11A, CTL_5GHT20, CTL_11A_EXT, CTL_5GHT40 };
-	u16 ctlModesFor11g[] =
-		{ CTL_11B, CTL_11G, CTL_2GHT20, CTL_11B_EXT, CTL_11G_EXT,
-		  CTL_2GHT40
-		};
-	u16 numCtlModes, *pCtlMode, ctlMode, freq;
+	static const u16 ctlModesFor11a[] = {
+		CTL_11A, CTL_5GHT20, CTL_11A_EXT, CTL_5GHT40
+	};
+	static const u16 ctlModesFor11g[] = {
+		CTL_11B, CTL_11G, CTL_2GHT20,
+		CTL_11B_EXT, CTL_11G_EXT, CTL_2GHT40
+	};
+	u16 numCtlModes;
+	const u16 *pCtlMode;
+	u16 ctlMode, freq;
 	struct chan_centers centers;
 	int tx_chainmask;
 	u16 twiceMinEdgePower;
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index 7c8a38d..7f2704d 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -308,7 +308,7 @@ static void ath9k_regwrite_single(void *hw_priv, u32 val, u32 reg_offset)
 	struct ath_hw *ah = (struct ath_hw *) hw_priv;
 	struct ath_common *common = ath9k_hw_common(ah);
 	struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv;
-	__be32 buf[2] = {
+	const __be32 buf[2] = {
 		cpu_to_be32(reg_offset),
 		cpu_to_be32(val),
 	};
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 1dbe53b..c6e971a 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -310,10 +310,9 @@ static bool ath9k_hw_chip_test(struct ath_hw *ah)
 	struct ath_common *common = ath9k_hw_common(ah);
 	u32 regAddr[2] = { AR_STA_ID0 };
 	u32 regHold[2];
-	u32 patternData[4] = { 0x55555555,
-			       0xaaaaaaaa,
-			       0x66666666,
-			       0x99999999 };
+	static const u32 patternData[4] = {
+		0x55555555, 0xaaaaaaaa, 0x66666666, 0x99999999
+	};
 	int i, j, loop_max;
 
 	if (!AR_SREV_9300_20_OR_LATER(ah)) {
@@ -436,7 +435,7 @@ static int ath9k_hw_init_macaddr(struct ath_hw *ah)
 	u32 sum;
 	int i;
 	u16 eeval;
-	u32 EEP_MAC[] = { EEP_MAC_LSW, EEP_MAC_MID, EEP_MAC_MSW };
+	static const u32 EEP_MAC[] = { EEP_MAC_LSW, EEP_MAC_MID, EEP_MAC_MSW };
 
 	sum = 0;
 	for (i = 0; i < 3; i++) {
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 33bb33b..ee4566d 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -864,7 +864,7 @@ static bool ath_rc_update_per(struct ath_softc *sc,
 	bool state_change = false;
 	int count, n_bad_frames;
 	u8 last_per;
-	static u32 nretry_to_per_lookup[10] = {
+	static const u32 nretry_to_per_lookup[10] = {
 		100 * 0 / 1,
 		100 * 1 / 4,
 		100 * 1 / 2,
@@ -1087,13 +1087,13 @@ static int ath_rc_get_rateindex(const struct ath_rate_table *rate_table,
 				struct ieee80211_tx_rate *rate)
 {
 	int rix = 0, i = 0;
-	int mcs_rix_off[] = { 7, 15, 20, 21, 22, 23 };
+	static const int mcs_rix_off[] = { 7, 15, 20, 21, 22, 23 };
 
 	if (!(rate->flags & IEEE80211_TX_RC_MCS))
 		return rate->idx;
 
 	while (rate->idx > mcs_rix_off[i] &&
-	      i < sizeof(mcs_rix_off)/sizeof(int)) {
+	       i < ARRAY_SIZE(mcs_rix_off)) {
 		rix++; i++;
 	}
 
-- 
1.7.3.2.245.g03276.dirty


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

* [PATCH 53/62] carl9170: Use static const
  2010-11-21  2:38 [PATCH 00/62] drivers/net: Use static const Joe Perches
                   ` (2 preceding siblings ...)
  2010-11-21  2:38 ` [PATCH 52/62] ath9k: " Joe Perches
@ 2010-11-21  2:38 ` Joe Perches
  2010-11-21  2:38 ` [PATCH 54/62] atmel: " Joe Perches
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2010-11-21  2:38 UTC (permalink / raw)
  To: Christian Lamparter
  Cc: John W. Linville, linux-wireless, netdev, linux-kernel

Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text	   data	    bss	    dec	    hex	filename
   1897	     56	    672	   2625	    a41	drivers/net/wireless/ath/carl9170/cmd.o.new
   1897	     56	    672	   2625	    a41	drivers/net/wireless/ath/carl9170/cmd.o.old

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/ath/carl9170/cmd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/carl9170/cmd.c b/drivers/net/wireless/ath/carl9170/cmd.c
index c21f336..cdfc94c 100644
--- a/drivers/net/wireless/ath/carl9170/cmd.c
+++ b/drivers/net/wireless/ath/carl9170/cmd.c
@@ -41,7 +41,7 @@
 
 int carl9170_write_reg(struct ar9170 *ar, const u32 reg, const u32 val)
 {
-	__le32 buf[2] = {
+	const __le32 buf[2] = {
 		cpu_to_le32(reg),
 		cpu_to_le32(val),
 	};
-- 
1.7.3.2.245.g03276.dirty


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

* [PATCH 54/62] atmel: Use static const
  2010-11-21  2:38 [PATCH 00/62] drivers/net: Use static const Joe Perches
                   ` (3 preceding siblings ...)
  2010-11-21  2:38 ` [PATCH 53/62] carl9170: " Joe Perches
@ 2010-11-21  2:38 ` Joe Perches
  2010-11-21  2:38 ` [PATCH 55/62] b43: " Joe Perches
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2010-11-21  2:38 UTC (permalink / raw)
  To: Simon Kelley, John W. Linville; +Cc: linux-wireless, netdev, linux-kernel

Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text	   data	    bss	    dec	    hex	filename
  42578	    720	   8528	  51826	   ca72	drivers/net/wireless/atmel.o.old
  42578	    720	   8528	  51826	   ca72	drivers/net/wireless/atmel.o.new

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/atmel.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c
index c8f7090..46e382e 100644
--- a/drivers/net/wireless/atmel.c
+++ b/drivers/net/wireless/atmel.c
@@ -1161,7 +1161,7 @@ static irqreturn_t service_interrupt(int irq, void *dev_id)
 	struct atmel_private *priv = netdev_priv(dev);
 	u8 isr;
 	int i = -1;
-	static u8 irq_order[] = {
+	static const u8 irq_order[] = {
 		ISR_OUT_OF_RANGE,
 		ISR_RxCOMPLETE,
 		ISR_TxCOMPLETE,
@@ -3771,7 +3771,9 @@ static int probe_atmel_card(struct net_device *dev)
 
 	if (rc) {
 		if (dev->dev_addr[0] == 0xFF) {
-			u8 default_mac[] = {0x00, 0x04, 0x25, 0x00, 0x00, 0x00};
+			static const u8 default_mac[] = {
+				0x00, 0x04, 0x25, 0x00, 0x00, 0x00
+			};
 			printk(KERN_ALERT "%s: *** Invalid MAC address. UPGRADE Firmware ****\n", dev->name);
 			memcpy(dev->dev_addr, default_mac, 6);
 		}
-- 
1.7.3.2.245.g03276.dirty


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

* [PATCH 55/62] b43: Use static const
  2010-11-21  2:38 [PATCH 00/62] drivers/net: Use static const Joe Perches
                   ` (4 preceding siblings ...)
  2010-11-21  2:38 ` [PATCH 54/62] atmel: " Joe Perches
@ 2010-11-21  2:38 ` Joe Perches
  2010-11-21  2:38 ` [PATCH 56/62] iwlwifi: " Joe Perches
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2010-11-21  2:38 UTC (permalink / raw)
  To: Stefano Brivio; +Cc: John W. Linville, linux-wireless, netdev, linux-kernel

Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text	   data	    bss	    dec	    hex	filename
   5502	     56	   1336	   6894	   1aee	drivers/net/wireless/b43/phy_common.o.new
   5511	     56	   1336	   6903	   1af7	drivers/net/wireless/b43/phy_common.o.old

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/b43/phy_common.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_common.c b/drivers/net/wireless/b43/phy_common.c
index 7b2ea67..fa7f83f 100644
--- a/drivers/net/wireless/b43/phy_common.c
+++ b/drivers/net/wireless/b43/phy_common.c
@@ -427,9 +427,11 @@ void b43_phyop_switch_analog_generic(struct b43_wldev *dev, bool on)
 /* http://bcm-v4.sipsolutions.net/802.11/PHY/Cordic */
 struct b43_c32 b43_cordic(int theta)
 {
-	u32 arctg[] = { 2949120, 1740967, 919879, 466945, 234379, 117304,
-		      58666, 29335, 14668, 7334, 3667, 1833, 917, 458,
-		      229, 115, 57, 29, };
+	static const u32 arctg[] = {
+		2949120, 1740967, 919879, 466945, 234379, 117304,
+		  58666,   29335,  14668,   7334,   3667,   1833,
+		    917,     458,    229,    115,     57,     29,
+	};
 	u8 i;
 	s32 tmp;
 	s8 signx = 1;
-- 
1.7.3.2.245.g03276.dirty


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

* [PATCH 56/62] iwlwifi: Use static const
  2010-11-21  2:38 [PATCH 00/62] drivers/net: Use static const Joe Perches
                   ` (5 preceding siblings ...)
  2010-11-21  2:38 ` [PATCH 55/62] b43: " Joe Perches
@ 2010-11-21  2:38 ` Joe Perches
  2010-11-22 15:37   ` Guy, Wey-Yi
  2010-11-21  2:38 ` [PATCH 57/62] libertas: " Joe Perches
                   ` (6 subsequent siblings)
  13 siblings, 1 reply; 21+ messages in thread
From: Joe Perches @ 2010-11-21  2:38 UTC (permalink / raw)
  To: Stefano Brivio, Reinette Chatre, Wey-Yi Guy, Intel Linux Wireless
  Cc: John W. Linville, linux-wireless, netdev, linux-kernel

Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text	   data	    bss	    dec	    hex	filename
  48644	     57	  12120	  60821	   ed95	drivers/net/wireless/b43/phy_n.o.new
  48661	     57	  12120	  60838	   eda6	drivers/net/wireless/b43/phy_n.o.old
  37906	     86	   7904	  45896	   b348	drivers/net/wireless/iwlwifi/iwl-agn-lib.o.new
  37937	     86	   7904	  45927	   b367	drivers/net/wireless/iwlwifi/iwl-agn-lib.o.old
  37781	    523	   6752	  45056	   b000	drivers/net/wireless/iwlwifi/iwl-3945.o.new
  37781	    523	   6752	  45056	   b000	drivers/net/wireless/iwlwifi/iwl-3945.o.old

Changed b43_nphy_write_clip_detection to take a const u16 *

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/b43/phy_n.c           |    9 +++++----
 drivers/net/wireless/iwlwifi/iwl-3945.c    |    2 +-
 drivers/net/wireless/iwlwifi/iwl-agn-lib.c |    6 +++---
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 6facb8a..afbfdf0 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -655,7 +655,8 @@ static void b43_nphy_tx_iq_workaround(struct b43_wldev *dev)
 }
 
 /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/clip-detection */
-static void b43_nphy_write_clip_detection(struct b43_wldev *dev, u16 *clip_st)
+static void b43_nphy_write_clip_detection(struct b43_wldev *dev,
+					  const u16 *clip_st)
 {
 	b43_phy_write(dev, B43_NPHY_C1_CLIP1THRES, clip_st[0]);
 	b43_phy_write(dev, B43_NPHY_C2_CLIP1THRES, clip_st[1]);
@@ -731,7 +732,7 @@ static void b43_nphy_stay_in_carrier_search(struct b43_wldev *dev, bool enable)
 	struct b43_phy_n *nphy = phy->n;
 
 	if (enable) {
-		u16 clip[] = { 0xFFFF, 0xFFFF };
+		static const u16 clip[] = { 0xFFFF, 0xFFFF };
 		if (nphy->deaf_count++ == 0) {
 			nphy->classifier_state = b43_nphy_classifier(dev, 0, 0);
 			b43_nphy_classifier(dev, 0x7, 0);
@@ -843,7 +844,7 @@ static void b43_nphy_adjust_lna_gain_table(struct b43_wldev *dev)
 	u16 data[4];
 	s16 gain[2];
 	u16 minmax[2];
-	u16 lna_gain[4] = { -2, 10, 19, 25 };
+	static const u16 lna_gain[4] = { -2, 10, 19, 25 };
 
 	if (nphy->hang_avoid)
 		b43_nphy_stay_in_carrier_search(dev, 1);
@@ -2299,7 +2300,7 @@ static void b43_nphy_int_pa_set_tx_dig_filters(struct b43_wldev *dev)
 {
 	int i, j;
 	/* B43_NPHY_TXF_20CO_S0A1, B43_NPHY_TXF_40CO_S0A1, unknown */
-	u16 offset[] = { 0x186, 0x195, 0x2C5 };
+	static const u16 offset[] = { 0x186, 0x195, 0x2C5 };
 
 	for (i = 0; i < 3; i++)
 		for (j = 0; j < 15; j++)
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index ebac04b..013c5a9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -116,7 +116,7 @@ void iwl3945_disable_events(struct iwl_priv *priv)
 	u32 base;		/* SRAM address of event log header */
 	u32 disable_ptr;	/* SRAM address of event-disable bitmap array */
 	u32 array_size;		/* # of u32 entries in array */
-	u32 evt_disable[IWL_EVT_DISABLE_SIZE] = {
+	static const u32 evt_disable[IWL_EVT_DISABLE_SIZE] = {
 		0x00000000,	/*   31 -    0  Event id numbers */
 		0x00000000,	/*   63 -   32 */
 		0x00000000,	/*   95 -   64 */
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index ca3530c..75e808f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -2001,7 +2001,7 @@ static void iwlagn_set_kill_ack_msk(struct iwl_priv *priv,
 				     struct iwl_bt_uart_msg *uart_msg)
 {
 	u8 kill_ack_msk;
-	__le32 bt_kill_ack_msg[2] = {
+	static const __le32 bt_kill_ack_msg[2] = {
 			cpu_to_le32(0xFFFFFFF), cpu_to_le32(0xFFFFFC00) };
 
 	kill_ack_msk = (((BT_UART_MSG_FRAME3A2DP_MSK |
@@ -2287,7 +2287,7 @@ static const char *get_csr_string(int cmd)
 void iwl_dump_csr(struct iwl_priv *priv)
 {
 	int i;
-	u32 csr_tbl[] = {
+	static const u32 csr_tbl[] = {
 		CSR_HW_IF_CONFIG_REG,
 		CSR_INT_COALESCING,
 		CSR_INT,
@@ -2346,7 +2346,7 @@ int iwl_dump_fh(struct iwl_priv *priv, char **buf, bool display)
 	int pos = 0;
 	size_t bufsz = 0;
 #endif
-	u32 fh_tbl[] = {
+	static const u32 fh_tbl[] = {
 		FH_RSCSR_CHNL0_STTS_WPTR_REG,
 		FH_RSCSR_CHNL0_RBDCB_BASE_REG,
 		FH_RSCSR_CHNL0_WPTR,
-- 
1.7.3.2.245.g03276.dirty


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

* [PATCH 57/62] libertas: Use static const
  2010-11-21  2:38 [PATCH 00/62] drivers/net: Use static const Joe Perches
                   ` (6 preceding siblings ...)
  2010-11-21  2:38 ` [PATCH 56/62] iwlwifi: " Joe Perches
@ 2010-11-21  2:38 ` Joe Perches
  2010-11-21  2:38 ` [PATCH 58/62] ray_cs: " Joe Perches
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2010-11-21  2:38 UTC (permalink / raw)
  To: Dan Williams
  Cc: John W. Linville, libertas-dev, linux-wireless, netdev,
	linux-kernel

Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text	   data	    bss	    dec	    hex	filename
   3650	     56	    704	   4410	   113a	drivers/net/wireless/libertas/rx.o.new
   3695	     56	    704	   4455	   1167	drivers/net/wireless/libertas/rx.o.old
  27328	    964	   5240	  33532	   82fc	drivers/net/wireless/libertas/cfg.o.new
  27328	    964	   5240	  33532	   82fc	drivers/net/wireless/libertas/cfg.o.old

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/libertas/cfg.c |    2 +-
 drivers/net/wireless/libertas/rx.c  |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
index 373930a..3f21fcb 100644
--- a/drivers/net/wireless/libertas/cfg.c
+++ b/drivers/net/wireless/libertas/cfg.c
@@ -2062,7 +2062,7 @@ static void lbs_cfg_set_regulatory_hint(struct lbs_private *priv)
 	};
 
 	/* Section 5.17.2 */
-	static struct region_code_mapping regmap[] = {
+	static const struct region_code_mapping regmap[] = {
 		{"US ", 0x10}, /* US FCC */
 		{"CA ", 0x20}, /* Canada */
 		{"EU ", 0x30}, /* ETSI   */
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c
index a4d0bca..a2b1df2 100644
--- a/drivers/net/wireless/libertas/rx.c
+++ b/drivers/net/wireless/libertas/rx.c
@@ -55,7 +55,9 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb)
 	struct rxpd *p_rx_pd;
 	int hdrchop;
 	struct ethhdr *p_ethhdr;
-	const u8 rfc1042_eth_hdr[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
+	static const u8 rfc1042_eth_hdr[] = {
+		0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00
+	};
 
 	lbs_deb_enter(LBS_DEB_RX);
 
-- 
1.7.3.2.245.g03276.dirty


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

* [PATCH 58/62] ray_cs: Use static const
  2010-11-21  2:38 [PATCH 00/62] drivers/net: Use static const Joe Perches
                   ` (7 preceding siblings ...)
  2010-11-21  2:38 ` [PATCH 57/62] libertas: " Joe Perches
@ 2010-11-21  2:38 ` Joe Perches
  2010-11-21  2:39 ` [PATCH 59/62] rndis_wlan: " Joe Perches
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2010-11-21  2:38 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, netdev, linux-kernel

Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text	   data	    bss	    dec	    hex	filename
  42607	   3581	   8536	  54724	   d5c4	drivers/net/wireless/ray_cs.o.new
  42603	   3585	   8536	  54724	   d5c4	drivers/net/wireless/ray_cs.o.old

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/ray_cs.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 97007d9..2b1cbba 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -2286,8 +2286,8 @@ static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len)
 	struct ethhdr *peth;
 	UCHAR srcaddr[ADDRLEN];
 	UCHAR destaddr[ADDRLEN];
-	static UCHAR org_bridge[3] = { 0, 0, 0xf8 };
-	static UCHAR org_1042[3] = { 0, 0, 0 };
+	static const UCHAR org_bridge[3] = { 0, 0, 0xf8 };
+	static const UCHAR org_1042[3] = { 0, 0, 0 };
 
 	memcpy(destaddr, ieee80211_get_DA(pmac), ADDRLEN);
 	memcpy(srcaddr, ieee80211_get_SA(pmac), ADDRLEN);
-- 
1.7.3.2.245.g03276.dirty


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

* [PATCH 59/62] rndis_wlan: Use static const
  2010-11-21  2:38 [PATCH 00/62] drivers/net: Use static const Joe Perches
                   ` (8 preceding siblings ...)
  2010-11-21  2:38 ` [PATCH 58/62] ray_cs: " Joe Perches
@ 2010-11-21  2:39 ` Joe Perches
  2010-11-21  2:39 ` [PATCH 60/62] rt2x00: " Joe Perches
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2010-11-21  2:39 UTC (permalink / raw)
  To: Jussi Kivilinna, John W. Linville; +Cc: linux-wireless, netdev, linux-kernel

Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text	   data	    bss	    dec	    hex	filename
  41757	   2205	   9896	  53858	   d262	drivers/net/wireless/rndis_wlan.o.old
  41653	   2205	   9880	  53738	   d1ea	drivers/net/wireless/rndis_wlan.o.new

Changed functions rndis_set_oid and set_bssid to take const *'s.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/rndis_wlan.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index ee08bca..19f3d56 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -817,7 +817,8 @@ exit_unlock:
 	return ret;
 }
 
-static int rndis_set_oid(struct usbnet *dev, __le32 oid, void *data, int len)
+static int rndis_set_oid(struct usbnet *dev, __le32 oid, const void *data,
+			 int len)
 {
 	struct rndis_wlan_private *priv = get_rndis_wlan_priv(dev);
 	union {
@@ -1033,7 +1034,7 @@ static int set_essid(struct usbnet *usbdev, struct ndis_80211_ssid *ssid)
 	return ret;
 }
 
-static int set_bssid(struct usbnet *usbdev, u8 bssid[ETH_ALEN])
+static int set_bssid(struct usbnet *usbdev, const u8 *bssid)
 {
 	int ret;
 
@@ -1049,7 +1050,9 @@ static int set_bssid(struct usbnet *usbdev, u8 bssid[ETH_ALEN])
 
 static int clear_bssid(struct usbnet *usbdev)
 {
-	u8 broadcast_mac[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+	static const u8 broadcast_mac[ETH_ALEN] = {
+		0xff, 0xff, 0xff, 0xff, 0xff, 0xff
+	};
 
 	return set_bssid(usbdev, broadcast_mac);
 }
-- 
1.7.3.2.245.g03276.dirty


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

* [PATCH 60/62] rt2x00: Use static const
  2010-11-21  2:38 [PATCH 00/62] drivers/net: Use static const Joe Perches
                   ` (9 preceding siblings ...)
  2010-11-21  2:39 ` [PATCH 59/62] rndis_wlan: " Joe Perches
@ 2010-11-21  2:39 ` Joe Perches
  2010-11-21  8:58   ` Gertjan van Wingerde
  2010-11-21  2:39 ` [PATCH 61/62] wl12xx: " Joe Perches
                   ` (2 subsequent siblings)
  13 siblings, 1 reply; 21+ messages in thread
From: Joe Perches @ 2010-11-21  2:39 UTC (permalink / raw)
  To: Ivo van Doorn, Gertjan van Wingerde
  Cc: John W. Linville, linux-wireless, users, netdev, linux-kernel

Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text	   data	    bss	    dec	    hex	filename
  40197	     56	   8336	  48589	   bdcd	drivers/net/wireless/rt2x00/rt2800lib.o.new
  40205	     56	   8336	  48597	   bdd5	drivers/net/wireless/rt2x00/rt2800lib.o.old

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/rt2x00/rt2800lib.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index ce8df66..7563161 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -2166,7 +2166,7 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)
 					 SHARED_KEY_MODE_ENTRY(i), 0);
 
 	for (i = 0; i < 256; i++) {
-		u32 wcid[2] = { 0xffffffff, 0x00ffffff };
+		static const u32 wcid[2] = { 0xffffffff, 0x00ffffff };
 		rt2800_register_multiwrite(rt2x00dev, MAC_WCID_ENTRY(i),
 					      wcid, sizeof(wcid));
 
-- 
1.7.3.2.245.g03276.dirty


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

* [PATCH 61/62] wl12xx: Use static const
  2010-11-21  2:38 [PATCH 00/62] drivers/net: Use static const Joe Perches
                   ` (10 preceding siblings ...)
  2010-11-21  2:39 ` [PATCH 60/62] rt2x00: " Joe Perches
@ 2010-11-21  2:39 ` Joe Perches
  2010-11-21  2:39 ` [PATCH 62/62] zd1211rw: Use const Joe Perches
  2010-11-21  4:50 ` [PATCH 00/62] drivers/net: Use static const David Miller
  13 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2010-11-21  2:39 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: John W. Linville, linux-wireless, netdev, linux-kernel

Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text	   data	    bss	    dec	    hex	filename
  13071	     56	   2880	  16007	   3e87	drivers/net/wireless/wl12xx/wl1271_acx.o.old
  13071	     56	   2880	  16007	   3e87	drivers/net/wireless/wl12xx/wl1271_acx.o.new

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/wl12xx/wl1271_acx.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.c b/drivers/net/wireless/wl12xx/wl1271_acx.c
index bd7f95f..c688471 100644
--- a/drivers/net/wireless/wl12xx/wl1271_acx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_acx.c
@@ -1231,7 +1231,9 @@ int wl1271_acx_set_ht_capabilities(struct wl1271 *wl,
 				    bool allow_ht_operation)
 {
 	struct wl1271_acx_ht_capabilities *acx;
-	u8 mac_address[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+	static const u8 mac_address[ETH_ALEN] = {
+		0xff, 0xff, 0xff, 0xff, 0xff, 0xff
+	};
 	int ret = 0;
 
 	wl1271_debug(DEBUG_ACX, "acx ht capabilities setting");
-- 
1.7.3.2.245.g03276.dirty


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

* [PATCH 62/62] zd1211rw: Use const
  2010-11-21  2:38 [PATCH 00/62] drivers/net: Use static const Joe Perches
                   ` (11 preceding siblings ...)
  2010-11-21  2:39 ` [PATCH 61/62] wl12xx: " Joe Perches
@ 2010-11-21  2:39 ` Joe Perches
  2010-11-21  4:50 ` [PATCH 00/62] drivers/net: Use static const David Miller
  13 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2010-11-21  2:39 UTC (permalink / raw)
  To: Daniel Drake, Ulrich Kunitz
  Cc: John W. Linville, linux-wireless, netdev, linux-kernel

Mark arrays const that are unmodified after initializations.

   text	   data	    bss	    dec	    hex	filename
  19291	     56	   4136	  23483	   5bbb	drivers/net/wireless/zd1211rw/zd_chip.o.old
  19291	     56	   4136	  23483	   5bbb	drivers/net/wireless/zd1211rw/zd_chip.o.new

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/zd1211rw/zd_chip.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c
index 87a95bc..30f8d40 100644
--- a/drivers/net/wireless/zd1211rw/zd_chip.c
+++ b/drivers/net/wireless/zd1211rw/zd_chip.c
@@ -1448,7 +1448,7 @@ int zd_rfwritev_locked(struct zd_chip *chip,
  */
 int zd_rfwrite_cr_locked(struct zd_chip *chip, u32 value)
 {
-	struct zd_ioreq16 ioreqs[] = {
+	const struct zd_ioreq16 ioreqs[] = {
 		{ CR244, (value >> 16) & 0xff },
 		{ CR243, (value >>  8) & 0xff },
 		{ CR242,  value        & 0xff },
@@ -1475,7 +1475,7 @@ int zd_rfwritev_cr_locked(struct zd_chip *chip,
 int zd_chip_set_multicast_hash(struct zd_chip *chip,
 	                       struct zd_mc_hash *hash)
 {
-	struct zd_ioreq32 ioreqs[] = {
+	const struct zd_ioreq32 ioreqs[] = {
 		{ CR_GROUP_HASH_P1, hash->low },
 		{ CR_GROUP_HASH_P2, hash->high },
 	};
-- 
1.7.3.2.245.g03276.dirty


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

* Re: [PATCH 00/62] drivers/net: Use static const
  2010-11-21  2:38 [PATCH 00/62] drivers/net: Use static const Joe Perches
                   ` (12 preceding siblings ...)
  2010-11-21  2:39 ` [PATCH 62/62] zd1211rw: Use const Joe Perches
@ 2010-11-21  4:50 ` David Miller
  2010-11-22 22:10   ` Joe Perches
  13 siblings, 1 reply; 21+ messages in thread
From: David Miller @ 2010-11-21  4:50 UTC (permalink / raw)
  To: joe
  Cc: netdev, e1000-devel, linux-usb, linux-wireless, ath5k-devel,
	ath9k-devel, libertas-dev, users, linux-kernel, socketcan-core

From: Joe Perches <joe@perches.com>
Date: Sat, 20 Nov 2010 18:38:01 -0800

> Using static const generally increases object text and decreases data size.
> It also generally decreases overall object size.

Joe, I'm going to be frank and say that I'm not going to review and
apply such a large chunk of networking patches.

Seperation is cool, splitting up patches is cool to make review
perhaps easier and more distributed.

But in the end _I_ have to purge through these things and submitting
so many patches at a time, multiple times per release cycle, abuses me
as a resource.

Yes, Linus has to deal with perhaps a hundred patches, or more, at a
time from Andrew Morton during the merge window.  But he has to do
that _ONE_ time each release.  You crap large sets of patches on me
multiple times per release cycle.

This cannot continue, my sanity depends upon it.

You therefore cannot funnel 40, 50, 60, or more patches at me at a
time, multiple times per release.  It severely negatively effects my
mood, because it makes me feel like me head is below water again
_RIGHT_ after I've worked all damn week to finally made the networking
patch backlog sane again.

You also make this more difficult for me by not using GIT.  Even
with patchwork helping me significantly, it's still a lot of work
to apply large sets of patches.  If I had to take in John Linville's
wireless stuff without GIT I'd be banging my head on a wall.

And these incessant huge patch bombs also take time away from me for
the things I'd like to at least occiasionally work on that involve
more intellect than monkeying around with such mindless patches.

Thanks for your understanding.  Feel free to submit this stuff in
smaller chunks, say ~10 patches at a time.

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

* Re: [PATCH 60/62] rt2x00: Use static const
  2010-11-21  2:39 ` [PATCH 60/62] rt2x00: " Joe Perches
@ 2010-11-21  8:58   ` Gertjan van Wingerde
  0 siblings, 0 replies; 21+ messages in thread
From: Gertjan van Wingerde @ 2010-11-21  8:58 UTC (permalink / raw)
  To: Joe Perches
  Cc: Ivo van Doorn, John W. Linville, linux-wireless, users, netdev,
	linux-kernel

On 11/21/10 03:39, Joe Perches wrote:
> Using static const generally increases object text and decreases data size.
> It also generally decreases overall object size.
> 
>    text	   data	    bss	    dec	    hex	filename
>   40197	     56	   8336	  48589	   bdcd	drivers/net/wireless/rt2x00/rt2800lib.o.new
>   40205	     56	   8336	  48597	   bdd5	drivers/net/wireless/rt2x00/rt2800lib.o.old
> 
> Signed-off-by: Joe Perches <joe@perches.com>

For rt2x00 this is just a tiny optimization, but for what it's worth:

Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>

> ---
>  drivers/net/wireless/rt2x00/rt2800lib.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
> index ce8df66..7563161 100644
> --- a/drivers/net/wireless/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
> @@ -2166,7 +2166,7 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)
>  					 SHARED_KEY_MODE_ENTRY(i), 0);
>  
>  	for (i = 0; i < 256; i++) {
> -		u32 wcid[2] = { 0xffffffff, 0x00ffffff };
> +		static const u32 wcid[2] = { 0xffffffff, 0x00ffffff };
>  		rt2800_register_multiwrite(rt2x00dev, MAC_WCID_ENTRY(i),
>  					      wcid, sizeof(wcid));
>  


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

* Re: [PATCH 56/62] iwlwifi: Use static const
  2010-11-21  2:38 ` [PATCH 56/62] iwlwifi: " Joe Perches
@ 2010-11-22 15:37   ` Guy, Wey-Yi
  0 siblings, 0 replies; 21+ messages in thread
From: Guy, Wey-Yi @ 2010-11-22 15:37 UTC (permalink / raw)
  To: Joe Perches
  Cc: Stefano Brivio, Chatre, Reinette, Intel Linux Wireless,
	John W. Linville, linux-wireless@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org

Hi Joe,

On Sat, 2010-11-20 at 18:38 -0800, Joe Perches wrote:
> Using static const generally increases object text and decreases data size.
> It also generally decreases overall object size.
> 
>    text	   data	    bss	    dec	    hex	filename
>   48644	     57	  12120	  60821	   ed95	drivers/net/wireless/b43/phy_n.o.new
>   48661	     57	  12120	  60838	   eda6	drivers/net/wireless/b43/phy_n.o.old
>   37906	     86	   7904	  45896	   b348	drivers/net/wireless/iwlwifi/iwl-agn-lib.o.new
>   37937	     86	   7904	  45927	   b367	drivers/net/wireless/iwlwifi/iwl-agn-lib.o.old
>   37781	    523	   6752	  45056	   b000	drivers/net/wireless/iwlwifi/iwl-3945.o.new
>   37781	    523	   6752	  45056	   b000	drivers/net/wireless/iwlwifi/iwl-3945.o.old
> 
> Changed b43_nphy_write_clip_detection to take a const u16 *
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---

I don't see size difference on 3945, otherwise the patch looks ok to me

Wey




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

* Re: [PATCH 00/62] drivers/net: Use static const
  2010-11-21  4:50 ` [PATCH 00/62] drivers/net: Use static const David Miller
@ 2010-11-22 22:10   ` Joe Perches
  2010-11-22 22:19     ` David Miller
  0 siblings, 1 reply; 21+ messages in thread
From: Joe Perches @ 2010-11-22 22:10 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, e1000-devel, linux-usb, linux-wireless, ath5k-devel,
	ath9k-devel, libertas-dev, users, linux-kernel, socketcan-core

On Sat, 2010-11-20 at 20:50 -0800, David Miller wrote: 
> From: Joe Perches <joe@perches.com>
> Date: Sat, 20 Nov 2010 18:38:01 -0800
> 
> > Using static const generally increases object text and decreases data size.
> > It also generally decreases overall object size.
> 
> Joe, I'm going to be frank and say that I'm not going to review and
> apply such a large chunk of networking patches.

Hi David.  No worries.

> Separation is cool, splitting up patches is cool to make review
> perhaps easier and more distributed.

I know you have ownership of netdev.  Thanks for doing all that
work.  You may not get enough feedback on the very good job that
you do at it.

I posted these patches not so much to get you to immediately pick
them up, but to get review from and/or notify the maintainers of
each of these subsystems.  I would have submitted them to Jiri
Kosina/trivial, but he asked me to post and track these style
patches separately and wait for a few weeks before submitting any
remaining patches not picked up by maintainers to him.

> It severely negatively effects my mood,

Can't have that...

> You also make this more difficult for me by not using GIT.

I do of course use git locally.  I have a public tree as well,
but I hardly update it.  I updated it recently for this.

These patches are available in:

  git://repo.or.cz/linux-2.6/trivial-mods.git 20101121_net_next_static_const

Perhaps I should ask Stephen Rothwell to include some trivial tree
branch like this in next.

> Even with patchwork helping me significantly, it's still a lot of work
> to apply large sets of patches.

I think that cc'ing netdev is always appropriate for netdev patches, but
maybe trivial@kernel.org could become linux-trivial@vger.kernel.org or
something like that.

Perhaps there could be some way to automatically mark these exceptionally
trivial patches as something like "not applicable" so they don't appear
on your personal queue.

> If I had to take in John Linville's
> wireless stuff without GIT I'd be banging my head on a wall.
> 
> And these incessant huge patch bombs also take time away from me for
> the things I'd like to at least occiasionally work on that involve
> more intellect than monkeying around with such mindless patches.

Establishing trust is always a long term thing.
Breaking trust is easy too.

Anyway, I think these patches are obvious and correct and can be
directly applied without significant risk.

I think the the issues are:

o should the nominal maintainers of the subsystems pick them up
o should these subsystem maintainers should be bypassed
o should the subsystem mailing lists be cc'd
o should these be pulled as a single changeset or multiples

I think that getting the nominal subsystem maintainers involved
is good, but perhaps not too necessary for these sorts of patches.

btw: it doesn't seem that, other than John Linville for wireless,
you currently pull from many (any?) other people.  Do let me know
if you'd consider pulling these sorts of changes from me.

$ git log --merges --since=2-years-ago drivers/net | grep "^Author: " | sort | uniq -c | sort -rn
    259 Author: David S. Miller <davem@davemloft.net>
    201 Author: Linus Torvalds <torvalds@linux-foundation.org>
     45 Author: John W. Linville <linville@tuxdriver.com>
     15 Author: Russell King <rmk@dyn-67.arm.linux.org.uk>
     15 Author: Ingo Molnar <mingo@elte.hu>
     14 Author: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      7 Author: Russell King <rmk+kernel@arm.linux.org.uk>
      6 Author: Jiri Kosina <jkosina@suse.cz>
      4 Author: Reinette Chatre <reinette.chatre@intel.com>
      3 Author: Roland Dreier <rolandd@cisco.com>
      3 Author: James Morris <jmorris@namei.org>
      2 Author: Tony Lindgren <tony@atomide.com>
      2 Author: Grant Likely <grant.likely@secretlab.ca>
      1 Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
      1 Author: root <root@dyn-67.arm.linux.org.uk>
      1 Author: Paul Mackerras <paulus@samba.org>
      1 Author: Kevin Hilman <khilman@deeprootsystems.com>
      1 Author: James Bottomley <James.Bottomley@HansenPartnership.com>

> Thanks for your understanding.  Feel free to submit this stuff in
> smaller chunks, say ~10 patches at a time.

Let me know if you want to pull or want them in smaller chunks in
say a month from now.

cheers, Joe


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

* Re: [PATCH 00/62] drivers/net: Use static const
  2010-11-22 22:10   ` Joe Perches
@ 2010-11-22 22:19     ` David Miller
  2010-11-22 22:40       ` Joe Perches
  0 siblings, 1 reply; 21+ messages in thread
From: David Miller @ 2010-11-22 22:19 UTC (permalink / raw)
  To: joe
  Cc: netdev, e1000-devel, linux-usb, linux-wireless, ath5k-devel,
	ath9k-devel, libertas-dev, users, linux-kernel, socketcan-core

From: Joe Perches <joe@perches.com>
Date: Mon, 22 Nov 2010 14:10:46 -0800

> btw: it doesn't seem that, other than John Linville for wireless,
> you currently pull from many (any?) other people.  Do let me know
> if you'd consider pulling these sorts of changes from me.

Expand your horizon beyond drivers/net/ and into places like net/
and you'll see I also pull from people like Patrick McHardy, for
example.

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

* Re: [PATCH 00/62] drivers/net: Use static const
  2010-11-22 22:19     ` David Miller
@ 2010-11-22 22:40       ` Joe Perches
  2010-11-23 16:28         ` David Miller
  0 siblings, 1 reply; 21+ messages in thread
From: Joe Perches @ 2010-11-22 22:40 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, e1000-devel, linux-usb, linux-wireless, ath5k-devel,
	ath9k-devel, libertas-dev, users, linux-kernel, socketcan-core

On Mon, 2010-11-22 at 14:19 -0800, David Miller wrote:
> From: Joe Perches <joe@perches.com>
> Date: Mon, 22 Nov 2010 14:10:46 -0800
> > Do let me know if you'd consider pulling these sorts of
> > changes from me.
> Expand your horizon beyond drivers/net/ and into places like net/
> and you'll see I also pull from people like Patrick McHardy, for
> example.

I'll see who picks up or acks what and send a pull request to
you for the remainder of these patches mid December or so.

Do you want micro patches or a single patch?


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

* Re: [PATCH 00/62] drivers/net: Use static const
  2010-11-22 22:40       ` Joe Perches
@ 2010-11-23 16:28         ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2010-11-23 16:28 UTC (permalink / raw)
  To: joe
  Cc: netdev, e1000-devel, linux-usb, linux-wireless, ath5k-devel,
	ath9k-devel, libertas-dev, users, linux-kernel, socketcan-core

From: Joe Perches <joe@perches.com>
Date: Mon, 22 Nov 2010 14:40:05 -0800

> I'll see who picks up or acks what and send a pull request to
> you for the remainder of these patches mid December or so.

Thanks.

> Do you want micro patches or a single patch?

You can group them by directory or similar if you like.

F.e.:

Patch 1: drivers/net/*.c
Patch 2: drivers/net/*/*.c (wired drivers)
Patch 3: drivers/net/wireless/*

Thanks again.

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

end of thread, other threads:[~2010-11-23 16:27 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-21  2:38 [PATCH 00/62] drivers/net: Use static const Joe Perches
2010-11-21  2:38 ` [PATCH 50/62] ar9170: Use const Joe Perches
2010-11-21  2:38 ` [PATCH 51/62] ath5k: Use static const Joe Perches
2010-11-21  2:38 ` [PATCH 52/62] ath9k: " Joe Perches
2010-11-21  2:38 ` [PATCH 53/62] carl9170: " Joe Perches
2010-11-21  2:38 ` [PATCH 54/62] atmel: " Joe Perches
2010-11-21  2:38 ` [PATCH 55/62] b43: " Joe Perches
2010-11-21  2:38 ` [PATCH 56/62] iwlwifi: " Joe Perches
2010-11-22 15:37   ` Guy, Wey-Yi
2010-11-21  2:38 ` [PATCH 57/62] libertas: " Joe Perches
2010-11-21  2:38 ` [PATCH 58/62] ray_cs: " Joe Perches
2010-11-21  2:39 ` [PATCH 59/62] rndis_wlan: " Joe Perches
2010-11-21  2:39 ` [PATCH 60/62] rt2x00: " Joe Perches
2010-11-21  8:58   ` Gertjan van Wingerde
2010-11-21  2:39 ` [PATCH 61/62] wl12xx: " Joe Perches
2010-11-21  2:39 ` [PATCH 62/62] zd1211rw: Use const Joe Perches
2010-11-21  4:50 ` [PATCH 00/62] drivers/net: Use static const David Miller
2010-11-22 22:10   ` Joe Perches
2010-11-22 22:19     ` David Miller
2010-11-22 22:40       ` Joe Perches
2010-11-23 16:28         ` David Miller

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