Skip to contentSkip to conversation

ath5k: constify stuff

PATCH In review Jiri Slaby 3 participants 5 messages Mar 7, 2009 Networking drivers (wireless)

lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

PATCH 1/2 ath5k: constify stuff

Make some structures const to place them in .rodata, since we won't change them.

Most important parts of objdump -h:

-  0 .text         00011170
+  0 .text         00011140
-  5 .rodata       0000828e
+  5 .rodata       0000895e
- 13 .data         00000560
+ 13 .data         00000110

- 14 .devinit.data 00000260

Cc Nick Kossifidis <[email protected]>
Cc Luis R. Rodriguez <[email protected]>
Cc Bob Copeland <[email protected]>
---
 drivers/net/wireless/ath5k/attach.c |   13 ++++++-------
 drivers/net/wireless/ath5k/base.c   |    8 ++++----
 drivers/net/wireless/ath5k/debug.c  |   10 +++++-----
 drivers/net/wireless/ath5k/reset.c  |    2 +-
 4 files changed, 16 insertions(+), 17 deletions(-)
drivers/net/wireless/ath5k/attach.c +6 -7
index 05bc5cb..656cb9d 100644
@@ -34,14 +34,14 @@
 static int ath5k_hw_post(struct ath5k_hw *ah)
 {
 
-	int i, c;
-	u16 cur_reg;
-	u16 regs[2] = {AR5K_STA_ID0, AR5K_PHY(8)};
-	u32 var_pattern;
-	u32 static_pattern[4] = {
+	static const u32 static_pattern[4] = {
 		0x55555555,	0xaaaaaaaa,
 		0x66666666,	0x99999999
 	};
+	static const u16 regs[2] = { AR5K_STA_ID0, AR5K_PHY(8) };
+	int i, c;
+	u16 cur_reg;
+	u32 var_pattern;
 	u32 init_val;
 	u32 cur_val;
 
@@ -106,7 +106,6 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
 {
 	struct ath5k_hw *ah;
 	struct pci_dev *pdev = sc->pdev;
-	u8 mac[ETH_ALEN] = {};
 	int ret;
 	u32 srev;
 
@@ -312,7 +311,7 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
 	}
 
 	/* MAC address is cleared until add_interface */
-	ath5k_hw_set_lladdr(ah, mac);
+	ath5k_hw_set_lladdr(ah, (u8[ETH_ALEN]){});
 
 	/* Set BSSID to bcast address: ff:ff:ff:ff:ff:ff for now */
 	memset(ah->ah_bssid, 0xff, ETH_ALEN);
drivers/net/wireless/ath5k/base.c +4 -4
index 08d691d..780fe6c 100644
@@ -79,7 +79,7 @@ MODULE_VERSION("0.6.0 (EXPERIMENTAL)");
 
 
 /* Known PCI ids */
-static struct pci_device_id ath5k_pci_id_table[] __devinitdata = {
+static const struct pci_device_id ath5k_pci_id_table[] = {
 	{ PCI_VDEVICE(ATHEROS, 0x0207), .driver_data = AR5K_AR5210 }, /* 5210 early */
 	{ PCI_VDEVICE(ATHEROS, 0x0007), .driver_data = AR5K_AR5210 }, /* 5210 */
 	{ PCI_VDEVICE(ATHEROS, 0x0011), .driver_data = AR5K_AR5211 }, /* 5311 - this is on AHB bus !*/
@@ -103,7 +103,7 @@ static struct pci_device_id ath5k_pci_id_table[] __devinitdata = {
 MODULE_DEVICE_TABLE(pci, ath5k_pci_id_table);
 
 /* Known SREVs */
-static struct ath5k_srev_name srev_names[] = {
+static const struct ath5k_srev_name srev_names[] = {
 	{ "5210",	AR5K_VERSION_MAC,	AR5K_SREV_AR5210 },
 	{ "5311",	AR5K_VERSION_MAC,	AR5K_SREV_AR5311 },
 	{ "5311A",	AR5K_VERSION_MAC,	AR5K_SREV_AR5311A },
@@ -142,7 +142,7 @@ static struct ath5k_srev_name srev_names[] = {
 	{ "xxxxx",	AR5K_VERSION_RAD,	AR5K_SREV_UNKNOWN },
 };
 
-static struct ieee80211_rate ath5k_rates[] = {
+static const struct ieee80211_rate ath5k_rates[] = {
 	{ .bitrate = 10,
 	  .hw_value = ATH5K_RATE_CODE_1M, },
 	{ .bitrate = 20,
@@ -248,7 +248,7 @@ static void ath5k_bss_info_changed(struct ieee80211_hw *hw,
 		struct ieee80211_bss_conf *bss_conf,
 		u32 changes);
 
-static struct ieee80211_ops ath5k_hw_ops = {
+static const struct ieee80211_ops ath5k_hw_ops = {
 	.tx 		= ath5k_tx,
 	.start 		= ath5k_start,
 	.stop 		= ath5k_stop,
drivers/net/wireless/ath5k/debug.c +5 -5
index 413ed68..9770bb3 100644
@@ -82,14 +82,14 @@ static int ath5k_debugfs_open(struct inode *inode, struct file *file)
 /* debugfs: registers */
 
 struct reg {
-	char *name;
+	const char *name;
 	int addr;
 };
 
 #define REG_STRUCT_INIT(r) { #r, r }
 
 /* just a few random registers, might want to add more */
-static struct reg regs[] = {
+static const struct reg regs[] = {
 	REG_STRUCT_INIT(AR5K_CR),
 	REG_STRUCT_INIT(AR5K_RXDP),
 	REG_STRUCT_INIT(AR5K_CFG),
@@ -142,7 +142,7 @@ static struct reg regs[] = {
 
 static void *reg_start(struct seq_file *seq, loff_t *pos)
 {
-	return *pos < ARRAY_SIZE(regs) ? &regs[*pos] : NULL;
+	return *pos < ARRAY_SIZE(regs) ? (void *)&regs[*pos] : NULL;
 }
 
 static void reg_stop(struct seq_file *seq, void *p)
@@ -153,7 +153,7 @@ static void reg_stop(struct seq_file *seq, void *p)
 static void *reg_next(struct seq_file *seq, void *p, loff_t *pos)
 {
 	++*pos;
-	return *pos < ARRAY_SIZE(regs) ? &regs[*pos] : NULL;
+	return *pos < ARRAY_SIZE(regs) ? (void *)&regs[*pos] : NULL;
 }
 
 static int reg_show(struct seq_file *seq, void *p)
@@ -290,7 +290,7 @@ static const struct file_operations fops_reset = {
 
 /* debugfs: debug level */
 
-static struct {
+static const struct {
 	enum ath5k_debug_level level;
 	const char *name;
 	const char *desc;
drivers/net/wireless/ath5k/reset.c +1 -1
index 1531ccd..685dc21 100644
@@ -102,7 +102,7 @@ static inline int ath5k_hw_write_ofdm_timings(struct ath5k_hw *ah,
  * index into rates for control rates, we can set it up like this because
  * this is only used for AR5212 and we know it supports G mode
  */
-static int control_rates[] =
+static const unsigned int control_rates[] =
 	{ 0, 1, 1, 1, 4, 4, 6, 6, 8, 8, 8, 8 };
 
 /**
Signature · 1 line
1.6.1.3
author
#1 lore raw

PATCH 2/2 ath5k: don't change mac in eeprom_read_mac on error

Do not touch mac parameter passed to ath5k_eeprom_read_mac unless we are sure we have correct address. I.e. when returning error, do not change it.

While at it, use '= {}' compiler trick for memsetting mac_d.

Cc Nick Kossifidis <[email protected]>
Cc Luis R. Rodriguez <[email protected]>
Cc Bob Copeland <[email protected]>
---
 drivers/net/wireless/ath5k/eeprom.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
drivers/net/wireless/ath5k/eeprom.c +3 -6
index a54ee7e..ac45ca4 100644
@@ -1418,14 +1418,11 @@ ath5k_eeprom_init(struct ath5k_hw *ah)
  */
 int ath5k_eeprom_read_mac(struct ath5k_hw *ah, u8 *mac)
 {
-	u8 mac_d[ETH_ALEN];
+	u8 mac_d[ETH_ALEN] = {};
 	u32 total, offset;
 	u16 data;
 	int octet, ret;
 
-	memset(mac, 0, ETH_ALEN);
-	memset(mac_d, 0, ETH_ALEN);
-
 	ret = ath5k_hw_eeprom_read(ah, 0x20, &data);
 	if (ret)
 		return ret;
@@ -1441,11 +1438,11 @@ int ath5k_eeprom_read_mac(struct ath5k_hw *ah, u8 *mac)
 		octet += 2;
 	}
 
-	memcpy(mac, mac_d, ETH_ALEN);
-
 	if (!total || total == 3 * 0xffff)
 		return -EINVAL;
 
+	memcpy(mac, mac_d, ETH_ALEN);
+
 	return 0;
 }
 
Signature · 1 line
1.6.1.3
Acked-by on v1 2/2
#2 lore raw

Re: [ath5k-devel] [PATCH 2/2] ath5k: don't change mac in eeprom_read_mac on error

2009/3/7 Jiri Slaby <[email protected]>:

drivers/net/wirele=

Quoted 15 lines

Do not touch mac parameter passed to ath5k_eeprom_read_mac unless we are sure we have correct address. I.e. when returning error, do not change it.

While at it, use '=3D {}' compiler trick for memsetting mac_d.

Cc Nick Kossifidis <[email protected]>
Cc Luis R. Rodriguez <[email protected]>
Cc Bob Copeland <[email protected]>

---
=C2=A0drivers/net/wireless/ath5k/eeprom.c | =C2=A0 =C2=A09 +++------ =C2=A01 files changed, 3 insertions(+), 6 deletions(-)

drivers/net/wirele= renamed from drivers/net/wireless/ath5k/eeprom.c +0 -0

ss/ath5k/eeprom.c

Quoted 13 lines

index a54ee7e..ac45ca4 100644

drivers/net/wireless/ath5k/eeprom.c +0 -0
@@ -1418,14 +1418,11 @@ ath5k_eeprom_init(struct ath5k_hw *ah)

=C2=A0*/
=C2=A0int ath5k_eeprom_read_mac(struct ath5k_hw *ah, u8 *mac) =C2=A0{
- =C2=A0 =C2=A0 =C2=A0 u8 mac_d[ETH_ALEN];
+ =C2=A0 =C2=A0 =C2=A0 u8 mac_d[ETH_ALEN] =3D {}; =C2=A0 =C2=A0 =C2=A0 =C2=A0u32 total, offset; =C2=A0 =C2=A0 =C2=A0 =C2=A0u16 data;
=C2=A0 =C2=A0 =C2=A0 =C2=A0int octet, ret;

Quoted 4 lines

- =C2=A0 =C2=A0 =C2=A0 memset(mac, 0, ETH_ALEN);
- =C2=A0 =C2=A0 =C2=A0 memset(mac_d, 0, ETH_ALEN);
-
=C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D ath5k_hw_eeprom_read(ah, 0x20, &da=

ta);

drivers/net/wireless/ath5k/eeprom.c int ath5k_eeprom_read_mac(struct ath5k_hw *ah=

Quoted 3 lines

=C2=A0 =C2=A0 =C2=A0 =C2=A0if (ret)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return ret;

drivers/net/wireless/ath5k/eeprom.c +0 -0
@@ -1441,11 +1438,11 @@ int ath5k_eeprom_read_mac(struct ath5k_hw *ah=

, u8 *mac)

Quoted 7 lines
drivers/net/wireless/ath5k/eeprom.c +0 -2
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0octet +=3D 2;
 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
 
- =C2=A0 =C2=A0 =C2=A0 memcpy(mac, mac_d, ETH_ALEN);
-
 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!total || total =3D=3D 3 * 0xffff)

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return -EINVAL=

;

Quoted 6 lines

+ =C2=A0 =C2=A0 =C2=A0 memcpy(mac, mac_d, ETH_ALEN); +
=C2=A0 =C2=A0 =C2=A0 =C2=A0return 0;
=C2=A0}

--=20
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-) Nick
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Acked-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] ath5k: don't change mac in eeprom_read_mac on error

In reply to Jiri Slaby
Quoted 8 lines · Jiri Slaby

Do not touch mac parameter passed to ath5k_eeprom_read_mac unless we are sure we have correct address. I.e. when returning error, do not change it.

While at it, use '= {}' compiler trick for memsetting mac_d.

Cc Nick Kossifidis <[email protected]>

Wrong email address for Nick :) Otherwise,

Signature · 1 line
Bob Copeland %% www.bobcopeland.com
Acked-by on v1 1/2
#4 lore raw
In reply to Jiri Slaby

2009/3/7 Jiri Slaby <[email protected]>:

Quoted 12 lines

Make some structures const to place them in .rodata, since we won't change them.

Most important parts of objdump -h:
- =C2=A00 .text =C2=A0 =C2=A0 =C2=A0 =C2=A0 00011170
+ =C2=A00 .text =C2=A0 =C2=A0 =C2=A0 =C2=A0 00011140
- =C2=A05 .rodata =C2=A0 =C2=A0 =C2=A0 0000828e
+ =C2=A05 .rodata =C2=A0 =C2=A0 =C2=A0 0000895e
- 13 .data =C2=A0 =C2=A0 =C2=A0 =C2=A0 00000560
+ 13 .data =C2=A0 =C2=A0 =C2=A0 =C2=A0 00000110
- 14 .devinit.data 00000260

Quoted 7 lines
Cc Nick Kossifidis <[email protected]>
Cc Luis R. Rodriguez <[email protected]>
Cc Bob Copeland <[email protected]>

---
=C2=A0drivers/net/wireless/ath5k/attach.c | =C2=A0 13 ++++++------- =C2=A0drivers/net/wireless/ath5k/base.c =C2=A0 | =C2=A0 =C2=A08 ++++-=

---

drivers/net/wirele=

Quoted 5 lines

=C2=A0drivers/net/wireless/ath5k/debug.c =C2=A0| =C2=A0 10 +++++----- =C2=A0drivers/net/wireless/ath5k/reset.c =C2=A0| =C2=A0 =C2=A02 +- =C2=A04 files changed, 16 insertions(+), 17 deletions(-)

drivers/net/wirele= renamed from drivers/net/wireless/ath5k/attach.c +0 -0

ss/ath5k/attach.c

Quoted 13 lines

index 05bc5cb..656cb9d 100644

drivers/net/wireless/ath5k/attach.c +1 -5
@@ -34,14 +34,14 @@
 =C2=A0static int ath5k_hw_post(struct ath5k_hw *ah)
 =C2=A0{
 
- =C2=A0 =C2=A0 =C2=A0 int i, c;
- =C2=A0 =C2=A0 =C2=A0 u16 cur_reg;
- =C2=A0 =C2=A0 =C2=A0 u16 regs[2] =3D {AR5K_STA_ID0, AR5K_PHY(8)};
- =C2=A0 =C2=A0 =C2=A0 u32 var_pattern;
- =C2=A0 =C2=A0 =C2=A0 u32 static_pattern[4] =3D {
+ =C2=A0 =C2=A0 =C2=A0 static const u32 static_pattern[4] =3D {
Quoted 1 line

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00x55555555, =C2=

=A0 =C2=A0 0xaaaaaaaa,

Quoted 1 line

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00x66666666, =C2=

=A0 =C2=A0 0x99999999

Quoted 2 lines

=C2=A0 =C2=A0 =C2=A0 =C2=A0};
+ =C2=A0 =C2=A0 =C2=A0 static const u16 regs[2] =3D { AR5K_STA_ID0, A=

R5K_PHY(8) };

drivers/net/wireless/ath5k/attach.c struct ath5k_hw *ath5k_hw_attach(struct ath5k_sof=

Quoted 7 lines

+ =C2=A0 =C2=A0 =C2=A0 int i, c;
+ =C2=A0 =C2=A0 =C2=A0 u16 cur_reg;
+ =C2=A0 =C2=A0 =C2=A0 u32 var_pattern; =C2=A0 =C2=A0 =C2=A0 =C2=A0u32 init_val; =C2=A0 =C2=A0 =C2=A0 =C2=A0u32 cur_val;

drivers/net/wireless/ath5k/attach.c +0 -0
@@ -106,7 +106,6 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_sof=

tc *sc, u8 mac_version)

drivers/net/wireless/ath5k/attach.c struct ath5k_hw *ath5k_hw_attach(struct ath5k_sof=

Quoted 8 lines
drivers/net/wireless/ath5k/attach.c +0 -1
 =C2=A0{
 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct ath5k_hw *ah;
 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct pci_dev *pdev =3D sc->pdev;
- =C2=A0 =C2=A0 =C2=A0 u8 mac[ETH_ALEN] =3D {};
 =C2=A0 =C2=A0 =C2=A0 =C2=A0int ret;
 =C2=A0 =C2=A0 =C2=A0 =C2=A0u32 srev;
 
@@ -312,7 +311,7 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_sof=

tc *sc, u8 mac_version)

Quoted 3 lines
drivers/net/wireless/ath5k/attach.c +0 -0
 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
 

=C2=A0 =C2=A0 =C2=A0 =C2=A0/* MAC address is cleared until add_interf=

ace */

Quoted 4 lines

- =C2=A0 =C2=A0 =C2=A0 ath5k_hw_set_lladdr(ah, mac);
+ =C2=A0 =C2=A0 =C2=A0 ath5k_hw_set_lladdr(ah, (u8[ETH_ALEN]){});

=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Set BSSID to bcast address: ff:ff:ff:ff=

:ff:ff for now */

drivers/net/wireless=

Quoted 2 lines

=C2=A0 =C2=A0 =C2=A0 =C2=A0memset(ah->ah_bssid, 0xff, ETH_ALEN);

drivers/net/wireless= renamed from drivers/net/wireless/ath5k/base.c +0 -0

/ath5k/base.c

Quoted 10 lines

index 08d691d..780fe6c 100644

drivers/net/wireless/ath5k/base.c +0 -0
@@ -79,7 +79,7 @@ MODULE_VERSION("0.6.0 (EXPERIMENTAL)");
 
 

=C2=A0/* Known PCI ids */

drivers/net/wireless/ath5k/base.c +1 -1
-static struct pci_device_id ath5k_pci_id_table[] __devinitdata =3D {
+static const struct pci_device_id ath5k_pci_id_table[] =3D {

=C2=A0 =C2=A0 =C2=A0 =C2=A0{ PCI_VDEVICE(ATHEROS, 0x0207), .driver_da=

ta =3D AR5K_AR5210 }, /* 5210 early */

Quoted 1 line

=C2=A0 =C2=A0 =C2=A0 =C2=A0{ PCI_VDEVICE(ATHEROS, 0x0007), .driver_da=

ta =3D AR5K_AR5210 }, /* 5210 */

Quoted 1 line

=C2=A0 =C2=A0 =C2=A0 =C2=A0{ PCI_VDEVICE(ATHEROS, 0x0011), .driver_da=

ta =3D AR5K_AR5211 }, /* 5311 - this is on AHB bus !*/

drivers/net/wireless/ath5k/base.c static struct pci_device_id ath5k_pci_id_table[] =

Quoted 1 line
drivers/net/wireless/ath5k/base.c +0 -0
@@ -103,7 +103,7 @@ static struct pci_device_id ath5k_pci_id_table[] =

__devinitdata =3D {

Quoted 6 lines
drivers/net/wireless/ath5k/base.c +0 -0
 =C2=A0MODULE_DEVICE_TABLE(pci, ath5k_pci_id_table);
 

=C2=A0/* Known SREVs */

drivers/net/wireless/ath5k/base.c +1 -1
-static struct ath5k_srev_name srev_names[] =3D {
+static const struct ath5k_srev_name srev_names[] =3D {

=C2=A0 =C2=A0 =C2=A0 =C2=A0{ "5210", =C2=A0 =C2=A0 =C2=A0 AR5K_VERSIO=

N_MAC, =C2=A0 =C2=A0 =C2=A0 AR5K_SREV_AR5210 },

Quoted 1 line

=C2=A0 =C2=A0 =C2=A0 =C2=A0{ "5311", =C2=A0 =C2=A0 =C2=A0 AR5K_VERSIO=

N_MAC, =C2=A0 =C2=A0 =C2=A0 AR5K_SREV_AR5311 },

Quoted 1 line

=C2=A0 =C2=A0 =C2=A0 =C2=A0{ "5311A", =C2=A0 =C2=A0 =C2=A0AR5K_VERSIO=

N_MAC, =C2=A0 =C2=A0 =C2=A0 AR5K_SREV_AR5311A },

Quoted 2 lines
drivers/net/wireless/ath5k/base.c +0 -0
@@ -142,7 +142,7 @@ static struct ath5k_srev_name srev_names[] =3D {

=C2=A0 =C2=A0 =C2=A0 =C2=A0{ "xxxxx", =C2=A0 =C2=A0 =C2=A0AR5K_VERSIO=

N_RAD, =C2=A0 =C2=A0 =C2=A0 AR5K_SREV_UNKNOWN },

Quoted 6 lines

=C2=A0};

drivers/net/wireless/ath5k/base.c +1 -1
-static struct ieee80211_rate ath5k_rates[] =3D {
+static const struct ieee80211_rate ath5k_rates[] =3D {

=C2=A0 =C2=A0 =C2=A0 =C2=A0{ .bitrate =3D 10,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.hw_value =3D ATH5K_RATE_CODE_1M, }=

,

drivers/net/wireless/ath5k/base.c static void ath5k_bss_info_changed(struct ieee802=

Quoted 2 lines

=C2=A0 =C2=A0 =C2=A0 =C2=A0{ .bitrate =3D 20,

drivers/net/wireless/ath5k/base.c +0 -0
@@ -248,7 +248,7 @@ static void ath5k_bss_info_changed(struct ieee802=

11_hw *hw,

Quoted 1 line

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct ieee802=

11_bss_conf *bss_conf,

Quoted 5 lines

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0u32 changes);

drivers/net/wireless/ath5k/base.c +1 -1
-static struct ieee80211_ops ath5k_hw_ops =3D {
+static const struct ieee80211_ops ath5k_hw_ops =3D {

=C2=A0 =C2=A0 =C2=A0 =C2=A0.tx =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=

=A0 =3D ath5k_tx,

Quoted 1 line

=C2=A0 =C2=A0 =C2=A0 =C2=A0.start =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D=

ath5k_start,

Quoted 1 line

=C2=A0 =C2=A0 =C2=A0 =C2=A0.stop =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D=

ath5k_stop,

drivers/net/wireles=

Quoted 1 line
drivers/net/wireles= renamed from drivers/net/wireless/ath5k/debug.c +0 -0

s/ath5k/debug.c

drivers/net/wireless/ath5k/debug.c static int ath5k_debugfs_open(struct inode *inode=

Quoted 4 lines

index 413ed68..9770bb3 100644

drivers/net/wireless/ath5k/debug.c +0 -0
@@ -82,14 +82,14 @@ static int ath5k_debugfs_open(struct inode *inode=

, struct file *file)

Quoted 17 lines

=C2=A0/* debugfs: registers */

=C2=A0struct reg {
- =C2=A0 =C2=A0 =C2=A0 char *name;
+ =C2=A0 =C2=A0 =C2=A0 const char *name; =C2=A0 =C2=A0 =C2=A0 =C2=A0int addr; =C2=A0};

=C2=A0#define REG_STRUCT_INIT(r) { #r, r }

=C2=A0/* just a few random registers, might want to add more */

drivers/net/wireless/ath5k/debug.c +1 -1
-static struct reg regs[] =3D {
+static const struct reg regs[] =3D {

=C2=A0 =C2=A0 =C2=A0 =C2=A0REG_STRUCT_INIT(AR5K_CR), =C2=A0 =C2=A0 =C2=A0 =C2=A0REG_STRUCT_INIT(AR5K_RXDP), =C2=A0 =C2=A0 =C2=A0 =C2=A0REG_STRUCT_INIT(AR5K_CFG),

drivers/net/wireless/ath5k/debug.c static struct reg regs[] =3D { · line 145

Quoted 4 lines
drivers/net/wireless/ath5k/debug.c +0 -1
@@ -142,7 +142,7 @@ static struct reg regs[] =3D {
 
 =C2=A0static void *reg_start(struct seq_file *seq, loff_t *pos)
 =C2=A0{
- =C2=A0 =C2=A0 =C2=A0 return *pos < ARRAY_SIZE(regs) ? &regs[*pos] :=

NULL;

drivers/net/wireless/ath5k/debug.c static struct reg regs[] =3D { · line 145

Quoted 1 line
drivers/net/wireless/ath5k/debug.c +1 -0
+ =C2=A0 =C2=A0 =C2=A0 return *pos < ARRAY_SIZE(regs) ? (void *)&regs=

[*pos] : NULL;

drivers/net/wireless/ath5k/debug.c static void reg_stop(struct seq_file *seq, void *=

Quoted 4 lines
drivers/net/wireless/ath5k/debug.c +0 -0
 =C2=A0}
 
 =C2=A0static void reg_stop(struct seq_file *seq, void *p)
@@ -153,7 +153,7 @@ static void reg_stop(struct seq_file *seq, void *=

p)

Quoted 1 line

=C2=A0static void *reg_next(struct seq_file *seq, void *p, loff_t *po=

s)

Quoted 3 lines

=C2=A0{
=C2=A0 =C2=A0 =C2=A0 =C2=A0++*pos;
- =C2=A0 =C2=A0 =C2=A0 return *pos < ARRAY_SIZE(regs) ? &regs[*pos] :=

NULL;

Quoted 1 line

+ =C2=A0 =C2=A0 =C2=A0 return *pos < ARRAY_SIZE(regs) ? (void *)&regs=

[*pos] : NULL;

drivers/net/wireless/ath5k/debug.c static const struct file_operations fops_reset =3D=

Quoted 4 lines

=C2=A0}

=C2=A0static int reg_show(struct seq_file *seq, void *p)

drivers/net/wireless/ath5k/debug.c +0 -0
@@ -290,7 +290,7 @@ static const struct file_operations fops_reset =3D=

{

drivers/net/wireles=

Quoted 9 lines

=C2=A0/* debugfs: debug level */

drivers/net/wireless/ath5k/debug.c +1 -1
-static struct {
+static const struct {

=C2=A0 =C2=A0 =C2=A0 =C2=A0enum ath5k_debug_level level; =C2=A0 =C2=A0 =C2=A0 =C2=A0const char *name; =C2=A0 =C2=A0 =C2=A0 =C2=A0const char *desc;

drivers/net/wireles= renamed from drivers/net/wireless/ath5k/reset.c +0 -0

s/ath5k/reset.c

drivers/net/wireless/ath5k/reset.c static inline int ath5k_hw_write_ofdm_timings(str=

Quoted 4 lines

index 1531ccd..685dc21 100644

drivers/net/wireless/ath5k/reset.c +0 -0
@@ -102,7 +102,7 @@ static inline int ath5k_hw_write_ofdm_timings(str=

uct ath5k_hw *ah,

Quoted 1 line

=C2=A0* index into rates for control rates, we can set it up like thi=

s because

Quoted 7 lines

=C2=A0* this is only used for AR5212 and we know it supports G mode =C2=A0*/

drivers/net/wireless/ath5k/reset.c +1 -1
-static int control_rates[] =3D
+static const unsigned int control_rates[] =3D

=C2=A0 =C2=A0 =C2=A0 =C2=A0{ 0, 1, 1, 1, 4, 4, 6, 6, 8, 8, 8, 8 };

=C2=A0/**

--=20
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-) Nick
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html