* [PATCH] bonding: change list contact to netdev@vger.kernel.org
From: Simon Horman @ 2010-11-20 21:48 UTC (permalink / raw)
To: netdev; +Cc: Jay Vosburgh
bonding-devel@lists.sourceforge.net seems only receive spam
and discussion seems to already occur on netdev@vger.kernel.org.
Signed-off-by: Simon Horman <horms@verge.net.au>
---
MAINTAINERS | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 476fb3a..c88b39e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1377,7 +1377,7 @@ F: include/net/bluetooth/
BONDING DRIVER
M: Jay Vosburgh <fubar@us.ibm.com>
-L: bonding-devel@lists.sourceforge.net
+L: netdev@vger.kernel.org
W: http://sourceforge.net/projects/bonding/
S: Supported
F: drivers/net/bonding/
--
1.7.2.3
^ permalink raw reply related
* Winning Notice.........Congratulations
From: ITOCHU Corporation. @ 2010-11-19 19:56 UTC (permalink / raw)
We are please to inform you that your e-mail just won you 1,000.000.00 pounds
sterlings in the Yahoo/Msn.
lottery program fill your claim by sending your contact info such as
Names:Age:Address: occupation:country: Agent Name: Mrs. Rose Elvis
Email:claimsmicrosoft56@yahoo.com.hk
^ permalink raw reply
* Re: [PATCH] netfilter: remove an atomic bit operation
From: Changli Gao @ 2010-11-20 23:38 UTC (permalink / raw)
To: Eric Dumazet
Cc: tim.gardner, Patrick McHardy, David S. Miller, netfilter-devel,
netdev
In-Reply-To: <1290271804.2756.78.camel@edumazet-laptop>
On Sun, Nov 21, 2010 at 12:50 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> Le samedi 20 novembre 2010 à 09:03 -0700, Tim Gardner a écrit :
>
>> NAK, set_bit() takes a bit number, not a mask. That is, assuming you can
>> get away with a non-atomic operation on this field. I'll defer to
>> Patrick on that.
>>
>> I think you have to use IPS_CONFIRMED instead, e.g.,
>>
>> ct->status |= IPS_CONFIRMED;
>>
>
> Or
>
> __set_bit(IPS_CONFIRMED_BIT, &ct->status);
>
>
> set_bit() is atomic, while __set_bit() is not
>
Oh, you are right. Thanks. My a previous patch accepted by Patrick has
the same problem.
--
Regards,
Changli Gao(xiaosuo@gmail.com)
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] netfilter: don't use atomic bit operation
From: Changli Gao @ 2010-11-20 23:40 UTC (permalink / raw)
To: Patrick McHardy; +Cc: David S. Miller, netfilter-devel, netdev
In-Reply-To: <4CE1129E.5040505@trash.net>
On Mon, Nov 15, 2010 at 6:59 PM, Patrick McHardy <kaber@trash.net> wrote:
> On 14.11.2010 10:05, Changli Gao wrote:
>> As we own ct, and the others can't see it until we confirm it, we don't
>> need to use atomic bit operation on ct->status.
>>
>> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
>> ---
>> include/net/netfilter/nf_nat_core.h | 4 ++--
>> net/ipv4/netfilter/nf_nat_core.c | 4 ++--
>> 2 files changed, 4 insertions(+), 4 deletions(-)
>> diff --git a/include/net/netfilter/nf_nat_core.h b/include/net/netfilter/nf_nat_core.h
>> index 33602ab..52ac1d8 100644
>> --- a/include/net/netfilter/nf_nat_core.h
>> +++ b/include/net/netfilter/nf_nat_core.h
>> @@ -21,9 +21,9 @@ static inline int nf_nat_initialized(struct nf_conn *ct,
>> enum nf_nat_manip_type manip)
>> {
>> if (manip == IP_NAT_MANIP_SRC)
>> - return test_bit(IPS_SRC_NAT_DONE_BIT, &ct->status);
>> + return IPS_SRC_NAT_DONE_BIT & ct->status;
>> else
>> - return test_bit(IPS_DST_NAT_DONE_BIT, &ct->status);
>> + return IPS_DST_NAT_DONE_BIT & ct->status;
>> }
>
> Looks fine, but I changed the order to ct->status & ...
>
Sorry, I made a mistake. The suffix _BIT should be removed.
--
Regards,
Changli Gao(xiaosuo@gmail.com)
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH] netfilter: change IPS_*_BIT to IPS_*
From: Changli Gao @ 2010-11-21 0:13 UTC (permalink / raw)
To: Patrick McHardy
Cc: David S. Miller, netfilter-devel, netdev, Changli Gao,
Tim Gardner, Eric Dumazet
My previous patch made a mistake when converting atomic_set to a normal
bit 'or'. IPS_*_BIT should be replaced with IPS_*.
commit 76a2d3bcfcc86e2a8044258515b86492a37631a3
Author: Changli Gao <xiaosuo@gmail.com>
Date: Mon Nov 15 11:59:03 2010 +0100
netfilter: nf_nat: don't use atomic bit operation
As we own the conntrack and the others can't see it until we confirm it,
we don't need to use atomic bit operation on ct->status.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Cc: Tim Gardner <tim.gardner@canonical.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
---
include/net/netfilter/nf_nat_core.h | 4 ++--
net/ipv4/netfilter/nf_nat_core.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/net/netfilter/nf_nat_core.h b/include/net/netfilter/nf_nat_core.h
index 5aec85c..3dc7b98 100644
--- a/include/net/netfilter/nf_nat_core.h
+++ b/include/net/netfilter/nf_nat_core.h
@@ -21,9 +21,9 @@ static inline int nf_nat_initialized(struct nf_conn *ct,
enum nf_nat_manip_type manip)
{
if (manip == IP_NAT_MANIP_SRC)
- return ct->status & IPS_SRC_NAT_DONE_BIT;
+ return ct->status & IPS_SRC_NAT_DONE;
else
- return ct->status & IPS_DST_NAT_DONE_BIT;
+ return ct->status & IPS_DST_NAT_DONE;
}
struct nlattr;
diff --git a/net/ipv4/netfilter/nf_nat_core.c b/net/ipv4/netfilter/nf_nat_core.c
index eb55835..21e6e92 100644
--- a/net/ipv4/netfilter/nf_nat_core.c
+++ b/net/ipv4/netfilter/nf_nat_core.c
@@ -323,9 +323,9 @@ nf_nat_setup_info(struct nf_conn *ct,
/* It's done. */
if (maniptype == IP_NAT_MANIP_DST)
- ct->status |= IPS_DST_NAT_DONE_BIT;
+ ct->status |= IPS_DST_NAT_DONE;
else
- ct->status |= IPS_SRC_NAT_DONE_BIT;
+ ct->status |= IPS_SRC_NAT_DONE;
return NF_ACCEPT;
}
^ permalink raw reply related
* Re: [PATCH net-next-2.6] packet: use vzalloc()
From: Neil Horman @ 2010-11-21 0:43 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, netdev
In-Reply-To: <1290274314.2756.84.camel@edumazet-laptop>
On Sat, Nov 20, 2010 at 06:31:54PM +0100, Eric Dumazet wrote:
> alloc_one_pg_vec_page() is supposed to return zeroed memory, so use
> vzalloc() instead of vmalloc()
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> Cc: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Thanks Eric!
> ---
> net/packet/af_packet.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
> index b6372dd..422705d 100644
> --- a/net/packet/af_packet.c
> +++ b/net/packet/af_packet.c
> @@ -2367,7 +2367,7 @@ static inline char *alloc_one_pg_vec_page(unsigned long order,
> * __get_free_pages failed, fall back to vmalloc
> */
> *flags |= PGV_FROM_VMALLOC;
> - buffer = vmalloc((1 << order) * PAGE_SIZE);
> + buffer = vzalloc((1 << order) * PAGE_SIZE);
>
> if (buffer)
> return buffer;
>
>
>
^ permalink raw reply
* Re: Question regarding expected behavior of two udp sockets with SO_REUSEADDR set
From: Neil Horman @ 2010-11-21 0:50 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, davem
In-Reply-To: <1290267887.2756.75.camel@edumazet-laptop>
On Sat, Nov 20, 2010 at 04:44:47PM +0100, Eric Dumazet wrote:
> Le samedi 20 novembre 2010 à 10:04 -0500, Neil Horman a écrit :
>
> > Agreed. My thought was to add logic to udp_lib_lport_inuse such that, if
> > sk_reuse is set on both sockets, and the input snum is 0 (indicating autobind)
> > we should not allow binding sk to inet_sk(sk2)->num. Thoughts?
>
> I dont know, problem is this could be possible right now if sk2 is bound
> on 127.0.0.2 address. Adding this test would reduce possible space.
>
Well, yes, that is in fact the exact problem that I origionally described. Both
sockets are bound to the same port on 127.0.0.1 on the same system. Since both
sockets have SO_REUSEADDR set, this is allowed, but when either socket sends a
messaage, the delivery code does a lookup in __udp4_lib_lookup, and the sock
structure that gets returned there is ambiguous. It could be either of the two
bound sockets, and the result will depend on which order they exist in the
hslot->head list (since they will both by definition hash to the same bucket).
Another solution might be to treat daddr of 127 specially, and force a traversal
of the entire hslot->head list, delivering to every matching packet, but we
might need to do that for all locally owned daddrs, so I'm not sure thats a
great solution. Other thoughts welcome, including just leave it all well enough
alone :)
> Autobind is tricky, it chooses a port while address is part of the
> problem.
>
Agreed, I'm comming to understand that :)
Neil
^ permalink raw reply
* [PATCH 00/62] drivers/net: Use static const
From: Joe Perches @ 2010-11-21 2:38 UTC (permalink / raw)
To: netdev, e1000-devel, linux-usb, linux-wireless, ath5k-devel,
ath9k-devel, liberta
Cc: socketcan-core, linux-kernel
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
* [PATCH 02/62] 3c503: Use static const
From: Joe Perches @ 2010-11-21 2:38 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
In-Reply-To: <cover.1290305773.git.joe@perches.com>
Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.
text data bss dec hex filename
7938 140 1688 9766 2626 drivers/net/3c503.o.new
7951 140 1688 9779 2633 drivers/net/3c503.o.old
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/3c503.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/3c503.c b/drivers/net/3c503.c
index 4777a1c..d84f6e8 100644
--- a/drivers/net/3c503.c
+++ b/drivers/net/3c503.c
@@ -392,8 +392,8 @@ el2_open(struct net_device *dev)
int retval;
if (dev->irq < 2) {
- int irqlist[] = {5, 9, 3, 4, 0};
- int *irqp = irqlist;
+ static const int irqlist[] = {5, 9, 3, 4, 0};
+ const int *irqp = irqlist;
outb(EGACFR_NORM, E33G_GACFR); /* Enable RAM and interrupts. */
do {
--
1.7.3.2.245.g03276.dirty
^ permalink raw reply related
* [PATCH 05/62] at1700: Use static const
From: Joe Perches @ 2010-11-21 2:38 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
In-Reply-To: <cover.1290305773.git.joe@perches.com>
Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.
text data bss dec hex filename
9083 370 2232 11685 2da5 drivers/net/at1700.o.new
9167 370 2232 11769 2df9 drivers/net/at1700.o.old
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/at1700.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/at1700.c b/drivers/net/at1700.c
index 871b163..f4744fc 100644
--- a/drivers/net/at1700.c
+++ b/drivers/net/at1700.c
@@ -270,9 +270,9 @@ static const struct net_device_ops at1700_netdev_ops = {
static int __init at1700_probe1(struct net_device *dev, int ioaddr)
{
- char fmv_irqmap[4] = {3, 7, 10, 15};
- char fmv_irqmap_pnp[8] = {3, 4, 5, 7, 9, 10, 11, 15};
- char at1700_irqmap[8] = {3, 4, 5, 9, 10, 11, 14, 15};
+ static const char fmv_irqmap[4] = {3, 7, 10, 15};
+ static const char fmv_irqmap_pnp[8] = {3, 4, 5, 7, 9, 10, 11, 15};
+ static const char at1700_irqmap[8] = {3, 4, 5, 9, 10, 11, 14, 15};
unsigned int i, irq, is_fmv18x = 0, is_at1700 = 0;
int slot, ret = -ENODEV;
struct net_local *lp = netdev_priv(dev);
--
1.7.3.2.245.g03276.dirty
^ permalink raw reply related
* [PATCH 06/62] benet: Use static const
From: Joe Perches @ 2010-11-21 2:38 UTC (permalink / raw)
To: Sathya Perla, Subbu Seetharaman, Sarveshwar Bandi, Ajit Khaparde
Cc: netdev, linux-kernel
In-Reply-To: <cover.1290305773.git.joe@perches.com>
Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.
text data bss dec hex filename
9920 56 1248 11224 2bd8 drivers/net/benet/be_ethtool.o.old
9839 56 1232 11127 2b77 drivers/net/benet/be_ethtool.o.new
38586 386 8624 47596 b9ec drivers/net/benet/be_main.o.old
38452 386 8624 47462 b966 drivers/net/benet/be_main.o.new
Use ARRAY_SIZE not magic numbers.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/benet/be_ethtool.c | 4 +++-
drivers/net/benet/be_main.c | 10 +++++-----
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index 0f46366..b4be027 100644
--- a/drivers/net/benet/be_ethtool.c
+++ b/drivers/net/benet/be_ethtool.c
@@ -549,7 +549,9 @@ be_test_ddr_dma(struct be_adapter *adapter)
{
int ret, i;
struct be_dma_mem ddrdma_cmd;
- u64 pattern[2] = {0x5a5a5a5a5a5a5a5aULL, 0xa5a5a5a5a5a5a5a5ULL};
+ static const u64 pattern[2] = {
+ 0x5a5a5a5a5a5a5a5aULL, 0xa5a5a5a5a5a5a5a5ULL
+ };
ddrdma_cmd.size = sizeof(struct be_cmd_req_ddrdma_test);
ddrdma_cmd.va = pci_alloc_consistent(adapter->pdev, ddrdma_cmd.size,
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index c36cd2f..a112b75 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -2343,10 +2343,10 @@ static int be_flash_data(struct be_adapter *adapter,
int num_bytes;
const u8 *p = fw->data;
struct be_cmd_write_flashrom *req = flash_cmd->va;
- struct flash_comp *pflashcomp;
+ const struct flash_comp *pflashcomp;
int num_comp;
- struct flash_comp gen3_flash_types[9] = {
+ static const struct flash_comp gen3_flash_types[9] = {
{ FLASH_iSCSI_PRIMARY_IMAGE_START_g3, IMG_TYPE_ISCSI_ACTIVE,
FLASH_IMAGE_MAX_SIZE_g3},
{ FLASH_REDBOOT_START_g3, IMG_TYPE_REDBOOT,
@@ -2366,7 +2366,7 @@ static int be_flash_data(struct be_adapter *adapter,
{ FLASH_NCSI_START_g3, IMG_TYPE_NCSI_FW,
FLASH_NCSI_IMAGE_MAX_SIZE_g3}
};
- struct flash_comp gen2_flash_types[8] = {
+ static const struct flash_comp gen2_flash_types[8] = {
{ FLASH_iSCSI_PRIMARY_IMAGE_START_g2, IMG_TYPE_ISCSI_ACTIVE,
FLASH_IMAGE_MAX_SIZE_g2},
{ FLASH_REDBOOT_START_g2, IMG_TYPE_REDBOOT,
@@ -2388,11 +2388,11 @@ static int be_flash_data(struct be_adapter *adapter,
if (adapter->generation == BE_GEN3) {
pflashcomp = gen3_flash_types;
filehdr_size = sizeof(struct flash_file_hdr_g3);
- num_comp = 9;
+ num_comp = ARRAY_SIZE(gen3_flash_types);
} else {
pflashcomp = gen2_flash_types;
filehdr_size = sizeof(struct flash_file_hdr_g2);
- num_comp = 8;
+ num_comp = ARRAY_SIZE(gen2_flash_types);
}
for (i = 0; i < num_comp; i++) {
if ((pflashcomp[i].optype == IMG_TYPE_NCSI_FW) &&
--
1.7.3.2.245.g03276.dirty
^ permalink raw reply related
* [PATCH 07/62] bnx2: Use static const
From: Joe Perches @ 2010-11-21 2:38 UTC (permalink / raw)
To: Michael Chan; +Cc: netdev, linux-kernel
In-Reply-To: <cover.1290305773.git.joe@perches.com>
Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.
text data bss dec hex filename
92097 560 22488 115145 1c1c9 drivers/net/bnx2.o.new
92133 560 22488 115181 1c1ed drivers/net/bnx2.o.old
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/bnx2.c | 46 ++++++++++++++++++++++++----------------------
1 files changed, 24 insertions(+), 22 deletions(-)
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 062600b..7805a4b 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -6801,28 +6801,30 @@ bnx2_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *_p)
u32 *p = _p, i, offset;
u8 *orig_p = _p;
struct bnx2 *bp = netdev_priv(dev);
- u32 reg_boundaries[] = { 0x0000, 0x0098, 0x0400, 0x045c,
- 0x0800, 0x0880, 0x0c00, 0x0c10,
- 0x0c30, 0x0d08, 0x1000, 0x101c,
- 0x1040, 0x1048, 0x1080, 0x10a4,
- 0x1400, 0x1490, 0x1498, 0x14f0,
- 0x1500, 0x155c, 0x1580, 0x15dc,
- 0x1600, 0x1658, 0x1680, 0x16d8,
- 0x1800, 0x1820, 0x1840, 0x1854,
- 0x1880, 0x1894, 0x1900, 0x1984,
- 0x1c00, 0x1c0c, 0x1c40, 0x1c54,
- 0x1c80, 0x1c94, 0x1d00, 0x1d84,
- 0x2000, 0x2030, 0x23c0, 0x2400,
- 0x2800, 0x2820, 0x2830, 0x2850,
- 0x2b40, 0x2c10, 0x2fc0, 0x3058,
- 0x3c00, 0x3c94, 0x4000, 0x4010,
- 0x4080, 0x4090, 0x43c0, 0x4458,
- 0x4c00, 0x4c18, 0x4c40, 0x4c54,
- 0x4fc0, 0x5010, 0x53c0, 0x5444,
- 0x5c00, 0x5c18, 0x5c80, 0x5c90,
- 0x5fc0, 0x6000, 0x6400, 0x6428,
- 0x6800, 0x6848, 0x684c, 0x6860,
- 0x6888, 0x6910, 0x8000 };
+ static const u32 reg_boundaries[] = {
+ 0x0000, 0x0098, 0x0400, 0x045c,
+ 0x0800, 0x0880, 0x0c00, 0x0c10,
+ 0x0c30, 0x0d08, 0x1000, 0x101c,
+ 0x1040, 0x1048, 0x1080, 0x10a4,
+ 0x1400, 0x1490, 0x1498, 0x14f0,
+ 0x1500, 0x155c, 0x1580, 0x15dc,
+ 0x1600, 0x1658, 0x1680, 0x16d8,
+ 0x1800, 0x1820, 0x1840, 0x1854,
+ 0x1880, 0x1894, 0x1900, 0x1984,
+ 0x1c00, 0x1c0c, 0x1c40, 0x1c54,
+ 0x1c80, 0x1c94, 0x1d00, 0x1d84,
+ 0x2000, 0x2030, 0x23c0, 0x2400,
+ 0x2800, 0x2820, 0x2830, 0x2850,
+ 0x2b40, 0x2c10, 0x2fc0, 0x3058,
+ 0x3c00, 0x3c94, 0x4000, 0x4010,
+ 0x4080, 0x4090, 0x43c0, 0x4458,
+ 0x4c00, 0x4c18, 0x4c40, 0x4c54,
+ 0x4fc0, 0x5010, 0x53c0, 0x5444,
+ 0x5c00, 0x5c18, 0x5c80, 0x5c90,
+ 0x5fc0, 0x6000, 0x6400, 0x6428,
+ 0x6800, 0x6848, 0x684c, 0x6860,
+ 0x6888, 0x6910, 0x8000
+ };
regs->version = 0;
--
1.7.3.2.245.g03276.dirty
^ permalink raw reply related
* [PATCH 08/62] bnx2x: Use static const
From: Joe Perches @ 2010-11-21 2:38 UTC (permalink / raw)
To: Eilon Greenstein; +Cc: netdev, linux-kernel
In-Reply-To: <cover.1290305773.git.joe@perches.com>
Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.
text data bss dec hex filename
147632 349 34240 182221 2c7cd drivers/net/bnx2x/bnx2x_main.o.old
147588 349 34240 182177 2c7a1 drivers/net/bnx2x/bnx2x_main.o.new
Changed bnx2x_set_mac_addr_gen to use const *
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/bnx2x/bnx2x_main.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c
index 2a50231..fbcffc6 100644
--- a/drivers/net/bnx2x/bnx2x_main.c
+++ b/drivers/net/bnx2x/bnx2x_main.c
@@ -6055,7 +6055,7 @@ static int bnx2x_func_stop(struct bnx2x *bp)
* @param cam_offset offset in a CAM to use
* @param is_bcast is the set MAC a broadcast address (for E1 only)
*/
-static void bnx2x_set_mac_addr_gen(struct bnx2x *bp, int set, u8 *mac,
+static void bnx2x_set_mac_addr_gen(struct bnx2x *bp, int set, const u8 *mac,
u32 cl_bit_vec, u8 cam_offset,
u8 is_bcast)
{
@@ -6181,7 +6181,9 @@ void bnx2x_set_eth_mac(struct bnx2x *bp, int set)
if (CHIP_IS_E1(bp)) {
/* broadcast MAC */
- u8 bcast[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
+ static const u8 bcast[ETH_ALEN] = {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
+ };
bnx2x_set_mac_addr_gen(bp, set, bcast, 0, cam_offset + 1, 1);
}
}
--
1.7.3.2.245.g03276.dirty
^ permalink raw reply related
* [PATCH 09/62] can: Use static const
From: Joe Perches @ 2010-11-21 2:38 UTC (permalink / raw)
To: netdev; +Cc: Wolfgang Grandegger, socketcan-core, linux-kernel
In-Reply-To: <cover.1290305773.git.joe@perches.com>
Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.
text data bss dec hex filename
4399 604 1160 6163 1813 drivers/net/can/sja1000/plx_pci.o.old
4396 604 1160 6160 1810 drivers/net/can/sja1000/plx_pci.o.new
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/can/sja1000/plx_pci.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/can/sja1000/plx_pci.c b/drivers/net/can/sja1000/plx_pci.c
index 437b5c7..231385b 100644
--- a/drivers/net/can/sja1000/plx_pci.c
+++ b/drivers/net/can/sja1000/plx_pci.c
@@ -383,7 +383,7 @@ static void plx_pci_reset_marathon(struct pci_dev *pdev)
{
void __iomem *reset_addr;
int i;
- int reset_bar[2] = {3, 5};
+ static const int reset_bar[2] = {3, 5};
plx_pci_reset_common(pdev);
--
1.7.3.2.245.g03276.dirty
^ permalink raw reply related
* [PATCH 10/62] chelsio: Use static const
From: Joe Perches @ 2010-11-21 2:38 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
In-Reply-To: <cover.1290305773.git.joe@perches.com>
Moved duplicated ch_mac_addr declarations to single static const file scope.
Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.
text data bss dec hex filename
21712 305 5168 27185 6a31 drivers/net/chelsio/sge.o.new
21806 305 5168 27279 6a8f drivers/net/chelsio/sge.o.old
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/chelsio/sge.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c
index 70221ca..f778b15 100644
--- a/drivers/net/chelsio/sge.c
+++ b/drivers/net/chelsio/sge.c
@@ -273,6 +273,10 @@ struct sge {
struct cmdQ cmdQ[SGE_CMDQ_N] ____cacheline_aligned_in_smp;
};
+static const u8 ch_mac_addr[ETH_ALEN] = {
+ 0x0, 0x7, 0x43, 0x0, 0x0, 0x0
+};
+
/*
* stop tasklet and free all pending skb's
*/
@@ -2012,10 +2016,6 @@ static void espibug_workaround_t204(unsigned long data)
continue;
if (!skb->cb[0]) {
- u8 ch_mac_addr[ETH_ALEN] = {
- 0x0, 0x7, 0x43, 0x0, 0x0, 0x0
- };
-
skb_copy_to_linear_data_offset(skb,
sizeof(struct cpl_tx_pkt),
ch_mac_addr,
@@ -2048,8 +2048,6 @@ static void espibug_workaround(unsigned long data)
if ((seop & 0xfff0fff) == 0xfff && skb) {
if (!skb->cb[0]) {
- u8 ch_mac_addr[ETH_ALEN] =
- {0x0, 0x7, 0x43, 0x0, 0x0, 0x0};
skb_copy_to_linear_data_offset(skb,
sizeof(struct cpl_tx_pkt),
ch_mac_addr,
--
1.7.3.2.245.g03276.dirty
^ permalink raw reply related
* [PATCH 11/62] cxgb3: Use static const
From: Joe Perches @ 2010-11-21 2:38 UTC (permalink / raw)
To: Divy Le Ray; +Cc: netdev, linux-kernel
In-Reply-To: <cover.1290305773.git.joe@perches.com>
Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.
text data bss dec hex filename
8401 368 2008 10777 2a19 drivers/net/cxgb3/ael1002.o.new
8129 680 2008 10817 2a41 drivers/net/cxgb3/ael1002.o.old
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/cxgb3/ael1002.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/net/cxgb3/ael1002.c b/drivers/net/cxgb3/ael1002.c
index 35cd367..2028da9 100644
--- a/drivers/net/cxgb3/ael1002.c
+++ b/drivers/net/cxgb3/ael1002.c
@@ -292,7 +292,7 @@ unknown:
*/
static int ael2005_setup_sr_edc(struct cphy *phy)
{
- static struct reg_val regs[] = {
+ static const struct reg_val regs[] = {
{ MDIO_MMD_PMAPMD, 0xc003, 0xffff, 0x181 },
{ MDIO_MMD_PMAPMD, 0xc010, 0xffff, 0x448a },
{ MDIO_MMD_PMAPMD, 0xc04a, 0xffff, 0x5200 },
@@ -324,11 +324,11 @@ static int ael2005_setup_sr_edc(struct cphy *phy)
static int ael2005_setup_twinax_edc(struct cphy *phy, int modtype)
{
- static struct reg_val regs[] = {
+ static const struct reg_val regs[] = {
{ MDIO_MMD_PMAPMD, 0xc04a, 0xffff, 0x5a00 },
{ 0, 0, 0, 0 }
};
- static struct reg_val preemphasis[] = {
+ static const struct reg_val preemphasis[] = {
{ MDIO_MMD_PMAPMD, 0xc014, 0xffff, 0xfe16 },
{ MDIO_MMD_PMAPMD, 0xc015, 0xffff, 0xa000 },
{ 0, 0, 0, 0 }
@@ -393,7 +393,7 @@ static int ael2005_intr_clear(struct cphy *phy)
static int ael2005_reset(struct cphy *phy, int wait)
{
- static struct reg_val regs0[] = {
+ static const struct reg_val regs0[] = {
{ MDIO_MMD_PMAPMD, 0xc001, 0, 1 << 5 },
{ MDIO_MMD_PMAPMD, 0xc017, 0, 1 << 5 },
{ MDIO_MMD_PMAPMD, 0xc013, 0xffff, 0xf341 },
@@ -403,7 +403,7 @@ static int ael2005_reset(struct cphy *phy, int wait)
{ MDIO_MMD_PMAPMD, 0xc210, 0xffff, 0 },
{ 0, 0, 0, 0 }
};
- static struct reg_val regs1[] = {
+ static const struct reg_val regs1[] = {
{ MDIO_MMD_PMAPMD, 0xca00, 0xffff, 0x0080 },
{ MDIO_MMD_PMAPMD, 0xca12, 0xffff, 0 },
{ 0, 0, 0, 0 }
@@ -522,7 +522,7 @@ int t3_ael2005_phy_prep(struct cphy *phy, struct adapter *adapter,
*/
static int ael2020_setup_sr_edc(struct cphy *phy)
{
- static struct reg_val regs[] = {
+ static const struct reg_val regs[] = {
/* set CDR offset to 10 */
{ MDIO_MMD_PMAPMD, 0xcc01, 0xffff, 0x488a },
@@ -551,20 +551,20 @@ static int ael2020_setup_sr_edc(struct cphy *phy)
static int ael2020_setup_twinax_edc(struct cphy *phy, int modtype)
{
/* set uC to 40MHz */
- static struct reg_val uCclock40MHz[] = {
+ static const struct reg_val uCclock40MHz[] = {
{ MDIO_MMD_PMAPMD, 0xff28, 0xffff, 0x4001 },
{ MDIO_MMD_PMAPMD, 0xff2a, 0xffff, 0x0002 },
{ 0, 0, 0, 0 }
};
/* activate uC clock */
- static struct reg_val uCclockActivate[] = {
+ static const struct reg_val uCclockActivate[] = {
{ MDIO_MMD_PMAPMD, 0xd000, 0xffff, 0x5200 },
{ 0, 0, 0, 0 }
};
/* set PC to start of SRAM and activate uC */
- static struct reg_val uCactivate[] = {
+ static const struct reg_val uCactivate[] = {
{ MDIO_MMD_PMAPMD, 0xd080, 0xffff, 0x0100 },
{ MDIO_MMD_PMAPMD, 0xd092, 0xffff, 0x0000 },
{ 0, 0, 0, 0 }
@@ -624,7 +624,7 @@ static int ael2020_get_module_type(struct cphy *phy, int delay_ms)
*/
static int ael2020_intr_enable(struct cphy *phy)
{
- struct reg_val regs[] = {
+ static const struct reg_val regs[] = {
/* output Module's Loss Of Signal (LOS) to LED */
{ MDIO_MMD_PMAPMD, AEL2020_GPIO_CFG+AEL2020_GPIO_LSTAT,
0xffff, 0x4 },
@@ -664,7 +664,7 @@ static int ael2020_intr_enable(struct cphy *phy)
*/
static int ael2020_intr_disable(struct cphy *phy)
{
- struct reg_val regs[] = {
+ static const struct reg_val regs[] = {
/* reset "link status" LED to "off" */
{ MDIO_MMD_PMAPMD, AEL2020_GPIO_CTRL,
0xffff, 0xb << (AEL2020_GPIO_LSTAT*4) },
@@ -701,7 +701,7 @@ static int ael2020_intr_clear(struct cphy *phy)
return err ? err : t3_phy_lasi_intr_clear(phy);
}
-static struct reg_val ael2020_reset_regs[] = {
+static const struct reg_val ael2020_reset_regs[] = {
/* Erratum #2: CDRLOL asserted, causing PMA link down status */
{ MDIO_MMD_PMAPMD, 0xc003, 0xffff, 0x3101 },
--
1.7.3.2.245.g03276.dirty
^ permalink raw reply related
* [PATCH 12/62] cxgb3: Use static const
From: Joe Perches @ 2010-11-21 2:38 UTC (permalink / raw)
To: Divy Le Ray; +Cc: netdev, linux-kernel
In-Reply-To: <cover.1290305773.git.joe@perches.com>
Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.
text data bss dec hex filename
42246 56 8816 51118 c7ae drivers/net/cxgb3/t3_hw.o.new
42198 104 8816 51118 c7ae drivers/net/cxgb3/t3_hw.o.old
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/cxgb3/t3_hw.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index 0b19704..d55db6b 100644
--- a/drivers/net/cxgb3/t3_hw.c
+++ b/drivers/net/cxgb3/t3_hw.c
@@ -1562,7 +1562,7 @@ static void tp_intr_handler(struct adapter *adapter)
{0}
};
- static struct intr_info tp_intr_info_t3c[] = {
+ static const struct intr_info tp_intr_info_t3c[] = {
{0x1fffffff, "TP parity error", -1, 1},
{F_FLMRXFLSTEMPTY, "TP out of Rx pages", -1, 1},
{F_FLMTXFLSTEMPTY, "TP out of Tx pages", -1, 1},
--
1.7.3.2.245.g03276.dirty
^ permalink raw reply related
* [PATCH 13/62] cxgb4: Use static const
From: Joe Perches @ 2010-11-21 2:38 UTC (permalink / raw)
To: Dimitris Michailidis; +Cc: netdev, linux-kernel
In-Reply-To: <cover.1290305773.git.joe@perches.com>
Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.
text data bss dec hex filename
30668 2168 5960 38796 978c drivers/net/cxgb4/t4_hw.o.old
32780 56 5960 38796 978c drivers/net/cxgb4/t4_hw.o.new
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/cxgb4/t4_hw.c | 48 ++++++++++++++++++++++----------------------
1 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/drivers/net/cxgb4/t4_hw.c b/drivers/net/cxgb4/t4_hw.c
index bb813d9..1bf6614 100644
--- a/drivers/net/cxgb4/t4_hw.c
+++ b/drivers/net/cxgb4/t4_hw.c
@@ -183,7 +183,7 @@ static void dump_mbox(struct adapter *adap, int mbox, u32 data_reg)
int t4_wr_mbox_meat(struct adapter *adap, int mbox, const void *cmd, int size,
void *rpl, bool sleep_ok)
{
- static int delay[] = {
+ static const int delay[] = {
1, 1, 3, 5, 10, 10, 20, 50, 100, 200
};
@@ -919,7 +919,7 @@ static int t4_handle_intr_status(struct adapter *adapter, unsigned int reg,
*/
static void pcie_intr_handler(struct adapter *adapter)
{
- static struct intr_info sysbus_intr_info[] = {
+ static const struct intr_info sysbus_intr_info[] = {
{ RNPP, "RXNP array parity error", -1, 1 },
{ RPCP, "RXPC array parity error", -1, 1 },
{ RCIP, "RXCIF array parity error", -1, 1 },
@@ -927,7 +927,7 @@ static void pcie_intr_handler(struct adapter *adapter)
{ RFTP, "RXFT array parity error", -1, 1 },
{ 0 }
};
- static struct intr_info pcie_port_intr_info[] = {
+ static const struct intr_info pcie_port_intr_info[] = {
{ TPCP, "TXPC array parity error", -1, 1 },
{ TNPP, "TXNP array parity error", -1, 1 },
{ TFTP, "TXFT array parity error", -1, 1 },
@@ -939,7 +939,7 @@ static void pcie_intr_handler(struct adapter *adapter)
{ TDUE, "Tx uncorrectable data error", -1, 1 },
{ 0 }
};
- static struct intr_info pcie_intr_info[] = {
+ static const struct intr_info pcie_intr_info[] = {
{ MSIADDRLPERR, "MSI AddrL parity error", -1, 1 },
{ MSIADDRHPERR, "MSI AddrH parity error", -1, 1 },
{ MSIDATAPERR, "MSI data parity error", -1, 1 },
@@ -991,7 +991,7 @@ static void pcie_intr_handler(struct adapter *adapter)
*/
static void tp_intr_handler(struct adapter *adapter)
{
- static struct intr_info tp_intr_info[] = {
+ static const struct intr_info tp_intr_info[] = {
{ 0x3fffffff, "TP parity error", -1, 1 },
{ FLMTXFLSTEMPTY, "TP out of Tx pages", -1, 1 },
{ 0 }
@@ -1008,7 +1008,7 @@ static void sge_intr_handler(struct adapter *adapter)
{
u64 v;
- static struct intr_info sge_intr_info[] = {
+ static const struct intr_info sge_intr_info[] = {
{ ERR_CPL_EXCEED_IQE_SIZE,
"SGE received CPL exceeding IQE size", -1, 1 },
{ ERR_INVALID_CIDX_INC,
@@ -1053,7 +1053,7 @@ static void sge_intr_handler(struct adapter *adapter)
*/
static void cim_intr_handler(struct adapter *adapter)
{
- static struct intr_info cim_intr_info[] = {
+ static const struct intr_info cim_intr_info[] = {
{ PREFDROPINT, "CIM control register prefetch drop", -1, 1 },
{ OBQPARERR, "CIM OBQ parity error", -1, 1 },
{ IBQPARERR, "CIM IBQ parity error", -1, 1 },
@@ -1063,7 +1063,7 @@ static void cim_intr_handler(struct adapter *adapter)
{ TIEQOUTPARERRINT, "CIM TIEQ incoming parity error", -1, 1 },
{ 0 }
};
- static struct intr_info cim_upintr_info[] = {
+ static const struct intr_info cim_upintr_info[] = {
{ RSVDSPACEINT, "CIM reserved space access", -1, 1 },
{ ILLTRANSINT, "CIM illegal transaction", -1, 1 },
{ ILLWRINT, "CIM illegal write", -1, 1 },
@@ -1110,7 +1110,7 @@ static void cim_intr_handler(struct adapter *adapter)
*/
static void ulprx_intr_handler(struct adapter *adapter)
{
- static struct intr_info ulprx_intr_info[] = {
+ static const struct intr_info ulprx_intr_info[] = {
{ 0x1800000, "ULPRX context error", -1, 1 },
{ 0x7fffff, "ULPRX parity error", -1, 1 },
{ 0 }
@@ -1125,7 +1125,7 @@ static void ulprx_intr_handler(struct adapter *adapter)
*/
static void ulptx_intr_handler(struct adapter *adapter)
{
- static struct intr_info ulptx_intr_info[] = {
+ static const struct intr_info ulptx_intr_info[] = {
{ PBL_BOUND_ERR_CH3, "ULPTX channel 3 PBL out of bounds", -1,
0 },
{ PBL_BOUND_ERR_CH2, "ULPTX channel 2 PBL out of bounds", -1,
@@ -1147,7 +1147,7 @@ static void ulptx_intr_handler(struct adapter *adapter)
*/
static void pmtx_intr_handler(struct adapter *adapter)
{
- static struct intr_info pmtx_intr_info[] = {
+ static const struct intr_info pmtx_intr_info[] = {
{ PCMD_LEN_OVFL0, "PMTX channel 0 pcmd too large", -1, 1 },
{ PCMD_LEN_OVFL1, "PMTX channel 1 pcmd too large", -1, 1 },
{ PCMD_LEN_OVFL2, "PMTX channel 2 pcmd too large", -1, 1 },
@@ -1169,7 +1169,7 @@ static void pmtx_intr_handler(struct adapter *adapter)
*/
static void pmrx_intr_handler(struct adapter *adapter)
{
- static struct intr_info pmrx_intr_info[] = {
+ static const struct intr_info pmrx_intr_info[] = {
{ ZERO_E_CMD_ERROR, "PMRX 0-length pcmd", -1, 1 },
{ PMRX_FRAMING_ERROR, "PMRX framing error", -1, 1 },
{ OCSPI_PAR_ERROR, "PMRX ocspi parity error", -1, 1 },
@@ -1188,7 +1188,7 @@ static void pmrx_intr_handler(struct adapter *adapter)
*/
static void cplsw_intr_handler(struct adapter *adapter)
{
- static struct intr_info cplsw_intr_info[] = {
+ static const struct intr_info cplsw_intr_info[] = {
{ CIM_OP_MAP_PERR, "CPLSW CIM op_map parity error", -1, 1 },
{ CIM_OVFL_ERROR, "CPLSW CIM overflow", -1, 1 },
{ TP_FRAMING_ERROR, "CPLSW TP framing error", -1, 1 },
@@ -1207,7 +1207,7 @@ static void cplsw_intr_handler(struct adapter *adapter)
*/
static void le_intr_handler(struct adapter *adap)
{
- static struct intr_info le_intr_info[] = {
+ static const struct intr_info le_intr_info[] = {
{ LIPMISS, "LE LIP miss", -1, 0 },
{ LIP0, "LE 0 LIP error", -1, 0 },
{ PARITYERR, "LE parity error", -1, 1 },
@@ -1225,11 +1225,11 @@ static void le_intr_handler(struct adapter *adap)
*/
static void mps_intr_handler(struct adapter *adapter)
{
- static struct intr_info mps_rx_intr_info[] = {
+ static const struct intr_info mps_rx_intr_info[] = {
{ 0xffffff, "MPS Rx parity error", -1, 1 },
{ 0 }
};
- static struct intr_info mps_tx_intr_info[] = {
+ static const struct intr_info mps_tx_intr_info[] = {
{ TPFIFO, "MPS Tx TP FIFO parity error", -1, 1 },
{ NCSIFIFO, "MPS Tx NC-SI FIFO parity error", -1, 1 },
{ TXDATAFIFO, "MPS Tx data FIFO parity error", -1, 1 },
@@ -1239,25 +1239,25 @@ static void mps_intr_handler(struct adapter *adapter)
{ FRMERR, "MPS Tx framing error", -1, 1 },
{ 0 }
};
- static struct intr_info mps_trc_intr_info[] = {
+ static const struct intr_info mps_trc_intr_info[] = {
{ FILTMEM, "MPS TRC filter parity error", -1, 1 },
{ PKTFIFO, "MPS TRC packet FIFO parity error", -1, 1 },
{ MISCPERR, "MPS TRC misc parity error", -1, 1 },
{ 0 }
};
- static struct intr_info mps_stat_sram_intr_info[] = {
+ static const struct intr_info mps_stat_sram_intr_info[] = {
{ 0x1fffff, "MPS statistics SRAM parity error", -1, 1 },
{ 0 }
};
- static struct intr_info mps_stat_tx_intr_info[] = {
+ static const struct intr_info mps_stat_tx_intr_info[] = {
{ 0xfffff, "MPS statistics Tx FIFO parity error", -1, 1 },
{ 0 }
};
- static struct intr_info mps_stat_rx_intr_info[] = {
+ static const struct intr_info mps_stat_rx_intr_info[] = {
{ 0xffffff, "MPS statistics Rx FIFO parity error", -1, 1 },
{ 0 }
};
- static struct intr_info mps_cls_intr_info[] = {
+ static const struct intr_info mps_cls_intr_info[] = {
{ MATCHSRAM, "MPS match SRAM parity error", -1, 1 },
{ MATCHTCAM, "MPS match TCAM parity error", -1, 1 },
{ HASHSRAM, "MPS hash SRAM parity error", -1, 1 },
@@ -1356,7 +1356,7 @@ static void ma_intr_handler(struct adapter *adap)
*/
static void smb_intr_handler(struct adapter *adap)
{
- static struct intr_info smb_intr_info[] = {
+ static const struct intr_info smb_intr_info[] = {
{ MSTTXFIFOPARINT, "SMB master Tx FIFO parity error", -1, 1 },
{ MSTRXFIFOPARINT, "SMB master Rx FIFO parity error", -1, 1 },
{ SLVFIFOPARINT, "SMB slave FIFO parity error", -1, 1 },
@@ -1372,7 +1372,7 @@ static void smb_intr_handler(struct adapter *adap)
*/
static void ncsi_intr_handler(struct adapter *adap)
{
- static struct intr_info ncsi_intr_info[] = {
+ static const struct intr_info ncsi_intr_info[] = {
{ CIM_DM_PRTY_ERR, "NC-SI CIM parity error", -1, 1 },
{ MPS_DM_PRTY_ERR, "NC-SI MPS parity error", -1, 1 },
{ TXFIFO_PRTY_ERR, "NC-SI Tx FIFO parity error", -1, 1 },
@@ -1410,7 +1410,7 @@ static void xgmac_intr_handler(struct adapter *adap, int port)
*/
static void pl_intr_handler(struct adapter *adap)
{
- static struct intr_info pl_intr_info[] = {
+ static const struct intr_info pl_intr_info[] = {
{ FATALPERR, "T4 fatal parity error", -1, 1 },
{ PERRVFID, "PL VFID_MAP parity error", -1, 1 },
{ 0 }
--
1.7.3.2.245.g03276.dirty
^ permalink raw reply related
* [PATCH 15/62] e1000: Use static const
From: Joe Perches @ 2010-11-21 2:38 UTC (permalink / raw)
To: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don
Cc: e1000-devel, netdev, linux-kernel
In-Reply-To: <cover.1290305773.git.joe@perches.com>
Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.
text data bss dec hex filename
74538 4296 19168 98002 17ed2 drivers/net/e1000/e1000_hw.o.old
74501 4296 19168 97965 17ead drivers/net/e1000/e1000_hw.o.new
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/e1000/e1000_hw.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index c7e242b6..c866ef0 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -4892,8 +4892,8 @@ static s32 e1000_get_cable_length(struct e1000_hw *hw, u16 *min_length,
} else if (hw->phy_type == e1000_phy_igp) { /* For IGP PHY */
u16 cur_agc_value;
u16 min_agc_value = IGP01E1000_AGC_LENGTH_TABLE_SIZE;
- u16 agc_reg_array[IGP01E1000_PHY_CHANNEL_NUM] =
- { IGP01E1000_PHY_AGC_A,
+ static const u16 agc_reg_array[IGP01E1000_PHY_CHANNEL_NUM] = {
+ IGP01E1000_PHY_AGC_A,
IGP01E1000_PHY_AGC_B,
IGP01E1000_PHY_AGC_C,
IGP01E1000_PHY_AGC_D
@@ -5071,8 +5071,8 @@ static s32 e1000_config_dsp_after_link_change(struct e1000_hw *hw, bool link_up)
{
s32 ret_val;
u16 phy_data, phy_saved_data, speed, duplex, i;
- u16 dsp_reg_array[IGP01E1000_PHY_CHANNEL_NUM] =
- { IGP01E1000_PHY_AGC_PARAM_A,
+ static const u16 dsp_reg_array[IGP01E1000_PHY_CHANNEL_NUM] = {
+ IGP01E1000_PHY_AGC_PARAM_A,
IGP01E1000_PHY_AGC_PARAM_B,
IGP01E1000_PHY_AGC_PARAM_C,
IGP01E1000_PHY_AGC_PARAM_D
--
1.7.3.2.245.g03276.dirty
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related
* [PATCH 16/62] e1000: Use static const
From: Joe Perches @ 2010-11-21 2:38 UTC (permalink / raw)
To: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don
Cc: e1000-devel, netdev, linux-kernel
In-Reply-To: <cover.1290305773.git.joe@perches.com>
Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.
text data bss dec hex filename
9083 1772 936 11791 2e0f drivers/net/e1000/e1000_param.o.new
9147 1772 936 11855 2e4f drivers/net/e1000/e1000_param.o.old
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/e1000/e1000_param.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/net/e1000/e1000_param.c b/drivers/net/e1000/e1000_param.c
index 10d8d98..6ba2aee 100644
--- a/drivers/net/e1000/e1000_param.c
+++ b/drivers/net/e1000/e1000_param.c
@@ -352,12 +352,13 @@ void __devinit e1000_check_options(struct e1000_adapter *adapter)
}
{ /* Flow Control */
- struct e1000_opt_list fc_list[] =
- {{ E1000_FC_NONE, "Flow Control Disabled" },
- { E1000_FC_RX_PAUSE,"Flow Control Receive Only" },
- { E1000_FC_TX_PAUSE,"Flow Control Transmit Only" },
- { E1000_FC_FULL, "Flow Control Enabled" },
- { E1000_FC_DEFAULT, "Flow Control Hardware Default" }};
+ static const struct e1000_opt_list fc_list[] = {
+ { E1000_FC_NONE, "Flow Control Disabled" },
+ { E1000_FC_RX_PAUSE, "Flow Control Receive Only" },
+ { E1000_FC_TX_PAUSE, "Flow Control Transmit Only" },
+ { E1000_FC_FULL, "Flow Control Enabled" },
+ { E1000_FC_DEFAULT, "Flow Control Hardware Default" }
+ };
opt = (struct e1000_option) {
.type = list_option,
--
1.7.3.2.245.g03276.dirty
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related
* [PATCH 17/62] e1000e: Use static const
From: Joe Perches @ 2010-11-21 2:38 UTC (permalink / raw)
To: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don
Cc: e1000-devel, netdev, linux-kernel
In-Reply-To: <cover.1290305773.git.joe@perches.com>
Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.
text data bss dec hex filename
30847 1400 7088 39335 99a7 drivers/net/e1000e/phy.o.new
30861 1400 7088 39349 99b5 drivers/net/e1000e/phy.o.old
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/e1000e/phy.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
index b9bff5b..a7ea4e7 100644
--- a/drivers/net/e1000e/phy.c
+++ b/drivers/net/e1000e/phy.c
@@ -1840,11 +1840,12 @@ s32 e1000e_get_cable_length_igp_2(struct e1000_hw *hw)
u16 phy_data, i, agc_value = 0;
u16 cur_agc_index, max_agc_index = 0;
u16 min_agc_index = IGP02E1000_CABLE_LENGTH_TABLE_SIZE - 1;
- u16 agc_reg_array[IGP02E1000_PHY_CHANNEL_NUM] =
- {IGP02E1000_PHY_AGC_A,
- IGP02E1000_PHY_AGC_B,
- IGP02E1000_PHY_AGC_C,
- IGP02E1000_PHY_AGC_D};
+ static const u16 agc_reg_array[IGP02E1000_PHY_CHANNEL_NUM] = {
+ IGP02E1000_PHY_AGC_A,
+ IGP02E1000_PHY_AGC_B,
+ IGP02E1000_PHY_AGC_C,
+ IGP02E1000_PHY_AGC_D
+ };
/* Read the AGC registers for all channels */
for (i = 0; i < IGP02E1000_PHY_CHANNEL_NUM; i++) {
--
1.7.3.2.245.g03276.dirty
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related
* [PATCH 19/62] eepro: Use static const
From: Joe Perches @ 2010-11-21 2:38 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
In-Reply-To: <cover.1290305773.git.joe@perches.com>
Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.
text data bss dec hex filename
13007 97 3888 16992 4260 drivers/net/eepro.o.old
12969 97 3888 16954 423a drivers/net/eepro.o.new
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/eepro.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c
index 6fa4227..eb35951 100644
--- a/drivers/net/eepro.c
+++ b/drivers/net/eepro.c
@@ -891,12 +891,13 @@ err:
there is non-reboot way to recover if something goes wrong.
*/
-static char irqrmap[] = {-1,-1,0,1,-1,2,-1,-1,-1,0,3,4,-1,-1,-1,-1};
-static char irqrmap2[] = {-1,-1,4,0,1,2,-1,3,-1,4,5,6,7,-1,-1,-1};
+static const char irqrmap[] = {-1,-1,0,1,-1,2,-1,-1,-1,0,3,4,-1,-1,-1,-1};
+static const char irqrmap2[] = {-1,-1,4,0,1,2,-1,3,-1,4,5,6,7,-1,-1,-1};
static int eepro_grab_irq(struct net_device *dev)
{
- int irqlist[] = { 3, 4, 5, 7, 9, 10, 11, 12, 0 };
- int *irqp = irqlist, temp_reg, ioaddr = dev->base_addr;
+ static const int irqlist[] = { 3, 4, 5, 7, 9, 10, 11, 12, 0 };
+ const int *irqp = irqlist;
+ int temp_reg, ioaddr = dev->base_addr;
eepro_sw2bank1(ioaddr); /* be CAREFUL, BANK 1 now */
--
1.7.3.2.245.g03276.dirty
^ permalink raw reply related
* [PATCH 20/62] eexpress: Use static const
From: Joe Perches @ 2010-11-21 2:38 UTC (permalink / raw)
To: Philip Blundell; +Cc: netdev, linux-kernel
In-Reply-To: <cover.1290305773.git.joe@perches.com>
Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.
text data bss dec hex filename
20165 73 4400 24638 603e drivers/net/eexpress.o.new
20165 73 4400 24638 603e drivers/net/eexpress.o.old
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/eexpress.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/eexpress.c b/drivers/net/eexpress.c
index 12c37d2..48ee51b 100644
--- a/drivers/net/eexpress.c
+++ b/drivers/net/eexpress.c
@@ -1103,7 +1103,7 @@ static int __init eexp_hw_probe(struct net_device *dev, unsigned short ioaddr)
dev->dev_addr[i] = ((unsigned char *)hw_addr)[5-i];
{
- static char irqmap[]={0, 9, 3, 4, 5, 10, 11, 0};
+ static const char irqmap[] = { 0, 9, 3, 4, 5, 10, 11, 0 };
unsigned short setupval = eexp_hw_readeeprom(ioaddr,0);
/* Use the IRQ from EEPROM if none was given */
--
1.7.3.2.245.g03276.dirty
^ permalink raw reply related
* [PATCH 23/62] igb: Use static const
From: Joe Perches @ 2010-11-21 2:38 UTC (permalink / raw)
To: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Carolyn Wyborny,
Don
Cc: e1000-devel, netdev, linux-kernel
In-Reply-To: <cover.1290305773.git.joe@perches.com>
Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.
text data bss dec hex filename
25448 1280 6176 32904 8088 drivers/net/igb/e1000_phy.o.new
25462 1280 6176 32918 8096 drivers/net/igb/e1000_phy.o.old
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/igb/e1000_phy.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/igb/e1000_phy.c b/drivers/net/igb/e1000_phy.c
index ddd036a..2dc089e 100644
--- a/drivers/net/igb/e1000_phy.c
+++ b/drivers/net/igb/e1000_phy.c
@@ -1757,11 +1757,12 @@ s32 igb_get_cable_length_igp_2(struct e1000_hw *hw)
u16 phy_data, i, agc_value = 0;
u16 cur_agc_index, max_agc_index = 0;
u16 min_agc_index = IGP02E1000_CABLE_LENGTH_TABLE_SIZE - 1;
- u16 agc_reg_array[IGP02E1000_PHY_CHANNEL_NUM] =
- {IGP02E1000_PHY_AGC_A,
- IGP02E1000_PHY_AGC_B,
- IGP02E1000_PHY_AGC_C,
- IGP02E1000_PHY_AGC_D};
+ static const u16 agc_reg_array[IGP02E1000_PHY_CHANNEL_NUM] = {
+ IGP02E1000_PHY_AGC_A,
+ IGP02E1000_PHY_AGC_B,
+ IGP02E1000_PHY_AGC_C,
+ IGP02E1000_PHY_AGC_D
+ };
/* Read the AGC registers for all channels */
for (i = 0; i < IGP02E1000_PHY_CHANNEL_NUM; i++) {
--
1.7.3.2.245.g03276.dirty
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related
* [PATCH 25/62] irda: Use static const
From: Joe Perches @ 2010-11-21 2:38 UTC (permalink / raw)
To: Samuel Ortiz; +Cc: netdev, linux-kernel
In-Reply-To: <cover.1290305773.git.joe@perches.com>
Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.
text data bss dec hex filename
16352 216 4424 20992 5200 drivers/net/irda/donauboe.o.old
16352 216 4424 20992 5200 drivers/net/irda/donauboe.o.new
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/irda/donauboe.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c
index b626ccc..f81d944 100644
--- a/drivers/net/irda/donauboe.c
+++ b/drivers/net/irda/donauboe.c
@@ -818,9 +818,9 @@ toshoboe_probe (struct toshoboe_cb *self)
{
int i, j, n;
#ifdef USE_MIR
- int bauds[] = { 9600, 115200, 4000000, 1152000 };
+ static const int bauds[] = { 9600, 115200, 4000000, 1152000 };
#else
- int bauds[] = { 9600, 115200, 4000000 };
+ static const int bauds[] = { 9600, 115200, 4000000 };
#endif
unsigned long flags;
--
1.7.3.2.245.g03276.dirty
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox