netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivo van Doorn <ivdoorn@gmail.com>
To: netdev@vger.kernel.org
Cc: rt2x00-devel@lfcorreia.dyndns.org
Subject: [PATCH 7/32] rt2x00: make vals static
Date: Fri, 28 Apr 2006 00:02:57 +0200	[thread overview]
Message-ID: <200604280002.58147.IvDoorn@gmail.com> (raw)

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

From: Ivo van Doorn <IvDoorn@gmail.com>

The vals[] arrays in *_init_hw_channels can be made
static to optimize memory and reduce stack size.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>

diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c	2006-04-27 21:40:06.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.c	2006-04-27 21:40:43.000000000 +0200
@@ -1868,7 +1868,7 @@ rt2400pci_init_hw_channels(struct rt2x00
 {
 	int				counter;
 	u16				eeprom;
-	u32 vals[] = {
+	static u32 vals[] = {
 		0x000c1fda, 0x000c1fee, 0x000c2002, 0x000c2016,
 		0x000c202a, 0x000c203e, 0x000c2052, 0x000c2066,
 		0x000c207a, 0x000c208e, 0x000c20a2, 0x000c20b6,
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-04-27 21:40:06.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-04-27 21:40:43.000000000 +0200
@@ -1929,9 +1929,9 @@ rt2500pci_init_hw_channels(struct rt2x00
 	struct ieee80211_channel *channels)
 {
 	int				counter;
-	u16				eeprom;
 	u32				rf2_base;
-	struct {
+	u16				eeprom;
+	static struct {
 		unsigned int chip;
 		u32 val[3];
 	} rf[] = {
@@ -1947,16 +1947,16 @@ rt2500pci_init_hw_channels(struct rt2x00
 	 * Channel initialization.
 	 * First we set the basic variables.
 	 */
-		for (counter = 0; counter < 13; counter++) {
-			channels[counter].chan = counter + 1;
+	for (counter = 0; counter < 13; counter++) {
+		channels[counter].chan = counter + 1;
 		channels[counter].freq = 2407 + ((counter + 1) * 5);
 		channels[counter].flag = IEEE80211_CHAN_W_IBSS
 			| IEEE80211_CHAN_W_ACTIVE_SCAN | IEEE80211_CHAN_W_SCAN;
 		channels[counter].antenna_max = 0xff;
-		}
+	}
 
-		channels[13].chan = 14;
-		channels[13].freq = 2484;
+	channels[13].chan = 14;
+	channels[13].freq = 2484;
 	channels[13].flag = IEEE80211_CHAN_W_IBSS
 		| IEEE80211_CHAN_W_ACTIVE_SCAN | IEEE80211_CHAN_W_SCAN;
 	channels[13].antenna_max = 0xff;
@@ -1988,7 +1988,7 @@ rt2500pci_init_hw_channels(struct rt2x00
 		rf2_base = 0x00080000;
 
 	if (rt2x00_rf(&rt2x00pci->chip, RF2522)) {
-		u32 vals[] = {
+		static u32 vals[] = {
 			0x000c1fda, 0x000c1fee, 0x000c2002, 0x000c2016,
 			0x000c202a, 0x000c203e, 0x000c2052, 0x000c2066,
 			0x000c207a, 0x000c208e, 0x000c20a2, 0x000c20b6,
@@ -2000,7 +2000,7 @@ rt2500pci_init_hw_channels(struct rt2x00
 	} else if (rt2x00_rf(&rt2x00pci->chip, RF2523)
 	|| rt2x00_rf(&rt2x00pci->chip, RF2524)
 	|| rt2x00_rf(&rt2x00pci->chip, RF2525)) {
-		u32 vals[] = {
+		static u32 vals[] = {
 			0x00000c9e, 0x00000ca2, 0x00000ca6, 0x00000caa,
 			0x00000cae, 0x00000cb2, 0x00000cb6, 0x00000cba,
 			0x00000cbe, 0x00000d02, 0x00000d06, 0x00000d0a,
@@ -2012,7 +2012,7 @@ rt2500pci_init_hw_channels(struct rt2x00
 				cpu_to_le32(vals[counter] | rf2_base);
 	} else if (rt2x00_rf(&rt2x00pci->chip, RF2525E)
 	|| rt2x00_rf(&rt2x00pci->chip, RF5222)) {
-		u32 vals[] = {
+		static u32 vals[] = {
 			0x00001136, 0x0000113a, 0x0000113e, 0x00001182,
 			0x00001186, 0x0000118a, 0x0000118e, 0x00001192,
 			0x00001196, 0x0000119a, 0x0000119e, 0x000011a2,
@@ -2024,7 +2024,7 @@ rt2500pci_init_hw_channels(struct rt2x00
 				cpu_to_le32(vals[counter] | rf2_base);
 		}
 	if (rt2x00_rf(&rt2x00pci->chip, RF5222)) {
-		u32 vals[] = {
+		static u32 vals[] = {
 			0x00018896, 0x0001889a, 0x0001889e, 0x000188a2,
 			0x000188a6, 0x000188aa, 0x000188ae, 0x000188b2,
 			0x00008802, 0x00008806, 0x0000880a, 0x0000880e,
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-04-27 21:40:06.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-04-27 21:40:43.000000000 +0200
@@ -1629,9 +1629,9 @@ rt2500usb_init_hw_channels(struct rt2x00
 	struct ieee80211_channel *channels)
 {
 	int				counter;
-	u16				eeprom;
 	u32				rf2_base;
-	struct {
+	u16				eeprom;
+	static struct {
 		unsigned int chip;
 		u32 val[3];
 	} rf[] = {
@@ -1647,16 +1647,16 @@ rt2500usb_init_hw_channels(struct rt2x00
 	 * Channel initialization.
 	 * First we set the basic variables.
 	 */
-		for (counter = 0; counter < 13; counter++) {
-			channels[counter].chan = counter + 1;
+	for (counter = 0; counter < 13; counter++) {
+		channels[counter].chan = counter + 1;
 		channels[counter].freq = 2407 + ((counter + 1) * 5);
 		channels[counter].flag = IEEE80211_CHAN_W_IBSS
 			| IEEE80211_CHAN_W_ACTIVE_SCAN | IEEE80211_CHAN_W_SCAN;
 		channels[counter].antenna_max = 0xff;
-		}
+	}
 
-		channels[13].chan = 14;
-		channels[13].freq = 2484;
+	channels[13].chan = 14;
+	channels[13].freq = 2484;
 	channels[13].flag = IEEE80211_CHAN_W_IBSS
 		| IEEE80211_CHAN_W_ACTIVE_SCAN | IEEE80211_CHAN_W_SCAN;
 	channels[13].antenna_max = 0xff;
@@ -1687,7 +1687,7 @@ rt2500usb_init_hw_channels(struct rt2x00
 		rf2_base = 0x00080000;
 
 	if (rt2x00_rf(&rt2x00usb->chip, RF2522)) {
-		u32 vals[] = {
+		static u32 vals[] = {
 			0x000c1fda, 0x000c1fee, 0x000c2002, 0x000c2016,
 			0x000c202a, 0x000c203e, 0x000c2052, 0x000c2066,
 			0x000c207a, 0x000c208e, 0x000c20a2, 0x000c20b6,
@@ -1699,7 +1699,7 @@ rt2500usb_init_hw_channels(struct rt2x00
 	} else if (rt2x00_rf(&rt2x00usb->chip, RF2523)
 	|| rt2x00_rf(&rt2x00usb->chip, RF2524)
 	|| rt2x00_rf(&rt2x00usb->chip, RF2525)) {
-		u32 vals[] = {
+		static u32 vals[] = {
 			0x00000c9e, 0x00000ca2, 0x00000ca6, 0x00000caa,
 			0x00000cae, 0x00000cb2, 0x00000cb6, 0x00000cba,
 			0x00000cbe, 0x00000d02, 0x00000d06, 0x00000d0a,
@@ -1720,7 +1720,7 @@ rt2500usb_init_hw_channels(struct rt2x00
 		for (counter = 0; counter < ARRAY_SIZE(vals); counter++)
 			channels[counter].val = cpu_to_le32(vals[counter]);
 	} else if (rt2x00_rf(&rt2x00usb->chip, RF5222)) {
-		u32 vals[] = {
+		static u32 vals[] = {
 			0x00001136, 0x0000113a, 0x0000113e, 0x00001182,
 			0x00001186, 0x0000118a, 0x0000118e, 0x00001192,
 			0x00001196, 0x0000119a, 0x0000119e, 0x000011a2,

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2006-04-27 22:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-27 22:02 Ivo van Doorn [this message]
2006-04-28 11:26 ` [PATCH 7/32] rt2x00: make vals static Ingo Oeser
2006-04-28 13:40   ` Ivo van Doorn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200604280002.58147.IvDoorn@gmail.com \
    --to=ivdoorn@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=rt2x00-devel@lfcorreia.dyndns.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).