aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-12-21 05:16:10 -0500
committerJoe Perches <joe@perches.com>2010-12-21 05:16:10 -0500
commit215faf9c5f6e319e97edea9e178123e07825c14d (patch)
tree32fb283f64110ad634a37dc2e133cb91a97988c5
parent75a84eb5d144dc761e1bb0f7dcacbf2b5cee562c (diff)
drivers/net/*/: Use static const
Using static const generally increases object text and decreases data size. It also generally decreases overall object size. Signed-off-by: Joe Perches <joe@perches.com>
-rw-r--r--drivers/net/benet/be_ethtool.c4
-rw-r--r--drivers/net/benet/be_main.c10
-rw-r--r--drivers/net/bnx2x/bnx2x_main.c6
-rw-r--r--drivers/net/can/sja1000/plx_pci.c2
-rw-r--r--drivers/net/chelsio/sge.c10
-rw-r--r--drivers/net/cxgb3/ael1002.c24
-rw-r--r--drivers/net/cxgb3/t3_hw.c2
-rw-r--r--drivers/net/cxgb4vf/t4vf_hw.c2
-rw-r--r--drivers/net/irda/act200l-sir.c2
-rw-r--r--drivers/net/irda/donauboe.c4
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c16
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c2
-rw-r--r--drivers/net/qlcnic/qlcnic_hw.c15
-rw-r--r--drivers/net/qlge/qlge_main.c13
-rw-r--r--drivers/net/skfp/smt.c4
-rw-r--r--drivers/net/tokenring/ibmtr.c5
-rw-r--r--drivers/net/tulip/de2104x.c18
-rw-r--r--drivers/net/vmxnet3/vmxnet3_drv.c4
-rw-r--r--drivers/net/wan/dscc4.c6
19 files changed, 84 insertions, 65 deletions
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index 0f46366ecc48..b4be0271efe0 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)
549{ 549{
550 int ret, i; 550 int ret, i;
551 struct be_dma_mem ddrdma_cmd; 551 struct be_dma_mem ddrdma_cmd;
552 u64 pattern[2] = {0x5a5a5a5a5a5a5a5aULL, 0xa5a5a5a5a5a5a5a5ULL}; 552 static const u64 pattern[2] = {
553 0x5a5a5a5a5a5a5a5aULL, 0xa5a5a5a5a5a5a5a5ULL
554 };
553 555
554 ddrdma_cmd.size = sizeof(struct be_cmd_req_ddrdma_test); 556 ddrdma_cmd.size = sizeof(struct be_cmd_req_ddrdma_test);
555 ddrdma_cmd.va = pci_alloc_consistent(adapter->pdev, ddrdma_cmd.size, 557 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 88ce68d63bca..de40d3b7152f 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -2398,10 +2398,10 @@ static int be_flash_data(struct be_adapter *adapter,
2398 int num_bytes; 2398 int num_bytes;
2399 const u8 *p = fw->data; 2399 const u8 *p = fw->data;
2400 struct be_cmd_write_flashrom *req = flash_cmd->va; 2400 struct be_cmd_write_flashrom *req = flash_cmd->va;
2401 struct flash_comp *pflashcomp; 2401 const struct flash_comp *pflashcomp;
2402 int num_comp; 2402 int num_comp;
2403 2403
2404 struct flash_comp gen3_flash_types[9] = { 2404 static const struct flash_comp gen3_flash_types[9] = {
2405 { FLASH_iSCSI_PRIMARY_IMAGE_START_g3, IMG_TYPE_ISCSI_ACTIVE, 2405 { FLASH_iSCSI_PRIMARY_IMAGE_START_g3, IMG_TYPE_ISCSI_ACTIVE,
2406 FLASH_IMAGE_MAX_SIZE_g3}, 2406 FLASH_IMAGE_MAX_SIZE_g3},
2407 { FLASH_REDBOOT_START_g3, IMG_TYPE_REDBOOT, 2407 { FLASH_REDBOOT_START_g3, IMG_TYPE_REDBOOT,
@@ -2421,7 +2421,7 @@ static int be_flash_data(struct be_adapter *adapter,
2421 { FLASH_NCSI_START_g3, IMG_TYPE_NCSI_FW, 2421 { FLASH_NCSI_START_g3, IMG_TYPE_NCSI_FW,
2422 FLASH_NCSI_IMAGE_MAX_SIZE_g3} 2422 FLASH_NCSI_IMAGE_MAX_SIZE_g3}
2423 }; 2423 };
2424 struct flash_comp gen2_flash_types[8] = { 2424 static const struct flash_comp gen2_flash_types[8] = {
2425 { FLASH_iSCSI_PRIMARY_IMAGE_START_g2, IMG_TYPE_ISCSI_ACTIVE, 2425 { FLASH_iSCSI_PRIMARY_IMAGE_START_g2, IMG_TYPE_ISCSI_ACTIVE,
2426 FLASH_IMAGE_MAX_SIZE_g2}, 2426 FLASH_IMAGE_MAX_SIZE_g2},
2427 { FLASH_REDBOOT_START_g2, IMG_TYPE_REDBOOT, 2427 { FLASH_REDBOOT_START_g2, IMG_TYPE_REDBOOT,
@@ -2443,11 +2443,11 @@ static int be_flash_data(struct be_adapter *adapter,
2443 if (adapter->generation == BE_GEN3) { 2443 if (adapter->generation == BE_GEN3) {
2444 pflashcomp = gen3_flash_types; 2444 pflashcomp = gen3_flash_types;
2445 filehdr_size = sizeof(struct flash_file_hdr_g3); 2445 filehdr_size = sizeof(struct flash_file_hdr_g3);
2446 num_comp = 9; 2446 num_comp = ARRAY_SIZE(gen3_flash_types);
2447 } else { 2447 } else {
2448 pflashcomp = gen2_flash_types; 2448 pflashcomp = gen2_flash_types;
2449 filehdr_size = sizeof(struct flash_file_hdr_g2); 2449 filehdr_size = sizeof(struct flash_file_hdr_g2);
2450 num_comp = 8; 2450 num_comp = ARRAY_SIZE(gen2_flash_types);
2451 } 2451 }
2452 for (i = 0; i < num_comp; i++) { 2452 for (i = 0; i < num_comp; i++) {
2453 if ((pflashcomp[i].optype == IMG_TYPE_NCSI_FW) && 2453 if ((pflashcomp[i].optype == IMG_TYPE_NCSI_FW) &&
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c
index bdc3fc26b31a..cf54427a8d80 100644
--- a/drivers/net/bnx2x/bnx2x_main.c
+++ b/drivers/net/bnx2x/bnx2x_main.c
@@ -6208,7 +6208,7 @@ static int bnx2x_func_stop(struct bnx2x *bp)
6208 * @param cam_offset offset in a CAM to use 6208 * @param cam_offset offset in a CAM to use
6209 * @param is_bcast is the set MAC a broadcast address (for E1 only) 6209 * @param is_bcast is the set MAC a broadcast address (for E1 only)
6210 */ 6210 */
6211static void bnx2x_set_mac_addr_gen(struct bnx2x *bp, int set, u8 *mac, 6211static void bnx2x_set_mac_addr_gen(struct bnx2x *bp, int set, const u8 *mac,
6212 u32 cl_bit_vec, u8 cam_offset, 6212 u32 cl_bit_vec, u8 cam_offset,
6213 u8 is_bcast) 6213 u8 is_bcast)
6214{ 6214{
@@ -6400,7 +6400,9 @@ void bnx2x_set_eth_mac(struct bnx2x *bp, int set)
6400 6400
6401 if (CHIP_IS_E1(bp)) { 6401 if (CHIP_IS_E1(bp)) {
6402 /* broadcast MAC */ 6402 /* broadcast MAC */
6403 u8 bcast[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; 6403 static const u8 bcast[ETH_ALEN] = {
6404 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
6405 };
6404 bnx2x_set_mac_addr_gen(bp, set, bcast, 0, cam_offset + 1, 1); 6406 bnx2x_set_mac_addr_gen(bp, set, bcast, 0, cam_offset + 1, 1);
6405 } 6407 }
6406} 6408}
diff --git a/drivers/net/can/sja1000/plx_pci.c b/drivers/net/can/sja1000/plx_pci.c
index 437b5c716a24..231385b8e08f 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)
383{ 383{
384 void __iomem *reset_addr; 384 void __iomem *reset_addr;
385 int i; 385 int i;
386 int reset_bar[2] = {3, 5}; 386 static const int reset_bar[2] = {3, 5};
387 387
388 plx_pci_reset_common(pdev); 388 plx_pci_reset_common(pdev);
389 389
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c
index 70221ca32683..f778b15ad3fd 100644
--- a/drivers/net/chelsio/sge.c
+++ b/drivers/net/chelsio/sge.c
@@ -273,6 +273,10 @@ struct sge {
273 struct cmdQ cmdQ[SGE_CMDQ_N] ____cacheline_aligned_in_smp; 273 struct cmdQ cmdQ[SGE_CMDQ_N] ____cacheline_aligned_in_smp;
274}; 274};
275 275
276static const u8 ch_mac_addr[ETH_ALEN] = {
277 0x0, 0x7, 0x43, 0x0, 0x0, 0x0
278};
279
276/* 280/*
277 * stop tasklet and free all pending skb's 281 * stop tasklet and free all pending skb's
278 */ 282 */
@@ -2012,10 +2016,6 @@ static void espibug_workaround_t204(unsigned long data)
2012 continue; 2016 continue;
2013 2017
2014 if (!skb->cb[0]) { 2018 if (!skb->cb[0]) {
2015 u8 ch_mac_addr[ETH_ALEN] = {
2016 0x0, 0x7, 0x43, 0x0, 0x0, 0x0
2017 };
2018
2019 skb_copy_to_linear_data_offset(skb, 2019 skb_copy_to_linear_data_offset(skb,
2020 sizeof(struct cpl_tx_pkt), 2020 sizeof(struct cpl_tx_pkt),
2021 ch_mac_addr, 2021 ch_mac_addr,
@@ -2048,8 +2048,6 @@ static void espibug_workaround(unsigned long data)
2048 2048
2049 if ((seop & 0xfff0fff) == 0xfff && skb) { 2049 if ((seop & 0xfff0fff) == 0xfff && skb) {
2050 if (!skb->cb[0]) { 2050 if (!skb->cb[0]) {
2051 u8 ch_mac_addr[ETH_ALEN] =
2052 {0x0, 0x7, 0x43, 0x0, 0x0, 0x0};
2053 skb_copy_to_linear_data_offset(skb, 2051 skb_copy_to_linear_data_offset(skb,
2054 sizeof(struct cpl_tx_pkt), 2052 sizeof(struct cpl_tx_pkt),
2055 ch_mac_addr, 2053 ch_mac_addr,
diff --git a/drivers/net/cxgb3/ael1002.c b/drivers/net/cxgb3/ael1002.c
index 35cd36729155..2028da95afa1 100644
--- a/drivers/net/cxgb3/ael1002.c
+++ b/drivers/net/cxgb3/ael1002.c
@@ -292,7 +292,7 @@ unknown:
292 */ 292 */
293static int ael2005_setup_sr_edc(struct cphy *phy) 293static int ael2005_setup_sr_edc(struct cphy *phy)
294{ 294{
295 static struct reg_val regs[] = { 295 static const struct reg_val regs[] = {
296 { MDIO_MMD_PMAPMD, 0xc003, 0xffff, 0x181 }, 296 { MDIO_MMD_PMAPMD, 0xc003, 0xffff, 0x181 },
297 { MDIO_MMD_PMAPMD, 0xc010, 0xffff, 0x448a }, 297 { MDIO_MMD_PMAPMD, 0xc010, 0xffff, 0x448a },
298 { MDIO_MMD_PMAPMD, 0xc04a, 0xffff, 0x5200 }, 298 { MDIO_MMD_PMAPMD, 0xc04a, 0xffff, 0x5200 },
@@ -324,11 +324,11 @@ static int ael2005_setup_sr_edc(struct cphy *phy)
324 324
325static int ael2005_setup_twinax_edc(struct cphy *phy, int modtype) 325static int ael2005_setup_twinax_edc(struct cphy *phy, int modtype)
326{ 326{
327 static struct reg_val regs[] = { 327 static const struct reg_val regs[] = {
328 { MDIO_MMD_PMAPMD, 0xc04a, 0xffff, 0x5a00 }, 328 { MDIO_MMD_PMAPMD, 0xc04a, 0xffff, 0x5a00 },
329 { 0, 0, 0, 0 } 329 { 0, 0, 0, 0 }
330 }; 330 };
331 static struct reg_val preemphasis[] = { 331 static const struct reg_val preemphasis[] = {
332 { MDIO_MMD_PMAPMD, 0xc014, 0xffff, 0xfe16 }, 332 { MDIO_MMD_PMAPMD, 0xc014, 0xffff, 0xfe16 },
333 { MDIO_MMD_PMAPMD, 0xc015, 0xffff, 0xa000 }, 333 { MDIO_MMD_PMAPMD, 0xc015, 0xffff, 0xa000 },
334 { 0, 0, 0, 0 } 334 { 0, 0, 0, 0 }
@@ -393,7 +393,7 @@ static int ael2005_intr_clear(struct cphy *phy)
393 393
394static int ael2005_reset(struct cphy *phy, int wait) 394static int ael2005_reset(struct cphy *phy, int wait)
395{ 395{
396 static struct reg_val regs0[] = { 396 static const struct reg_val regs0[] = {
397 { MDIO_MMD_PMAPMD, 0xc001, 0, 1 << 5 }, 397 { MDIO_MMD_PMAPMD, 0xc001, 0, 1 << 5 },
398 { MDIO_MMD_PMAPMD, 0xc017, 0, 1 << 5 }, 398 { MDIO_MMD_PMAPMD, 0xc017, 0, 1 << 5 },
399 { MDIO_MMD_PMAPMD, 0xc013, 0xffff, 0xf341 }, 399 { MDIO_MMD_PMAPMD, 0xc013, 0xffff, 0xf341 },
@@ -403,7 +403,7 @@ static int ael2005_reset(struct cphy *phy, int wait)
403 { MDIO_MMD_PMAPMD, 0xc210, 0xffff, 0 }, 403 { MDIO_MMD_PMAPMD, 0xc210, 0xffff, 0 },
404 { 0, 0, 0, 0 } 404 { 0, 0, 0, 0 }
405 }; 405 };
406 static struct reg_val regs1[] = { 406 static const struct reg_val regs1[] = {
407 { MDIO_MMD_PMAPMD, 0xca00, 0xffff, 0x0080 }, 407 { MDIO_MMD_PMAPMD, 0xca00, 0xffff, 0x0080 },
408 { MDIO_MMD_PMAPMD, 0xca12, 0xffff, 0 }, 408 { MDIO_MMD_PMAPMD, 0xca12, 0xffff, 0 },
409 { 0, 0, 0, 0 } 409 { 0, 0, 0, 0 }
@@ -522,7 +522,7 @@ int t3_ael2005_phy_prep(struct cphy *phy, struct adapter *adapter,
522 */ 522 */
523static int ael2020_setup_sr_edc(struct cphy *phy) 523static int ael2020_setup_sr_edc(struct cphy *phy)
524{ 524{
525 static struct reg_val regs[] = { 525 static const struct reg_val regs[] = {
526 /* set CDR offset to 10 */ 526 /* set CDR offset to 10 */
527 { MDIO_MMD_PMAPMD, 0xcc01, 0xffff, 0x488a }, 527 { MDIO_MMD_PMAPMD, 0xcc01, 0xffff, 0x488a },
528 528
@@ -551,20 +551,20 @@ static int ael2020_setup_sr_edc(struct cphy *phy)
551static int ael2020_setup_twinax_edc(struct cphy *phy, int modtype) 551static int ael2020_setup_twinax_edc(struct cphy *phy, int modtype)
552{ 552{
553 /* set uC to 40MHz */ 553 /* set uC to 40MHz */
554 static struct reg_val uCclock40MHz[] = { 554 static const struct reg_val uCclock40MHz[] = {
555 { MDIO_MMD_PMAPMD, 0xff28, 0xffff, 0x4001 }, 555 { MDIO_MMD_PMAPMD, 0xff28, 0xffff, 0x4001 },
556 { MDIO_MMD_PMAPMD, 0xff2a, 0xffff, 0x0002 }, 556 { MDIO_MMD_PMAPMD, 0xff2a, 0xffff, 0x0002 },
557 { 0, 0, 0, 0 } 557 { 0, 0, 0, 0 }
558 }; 558 };
559 559
560 /* activate uC clock */ 560 /* activate uC clock */
561 static struct reg_val uCclockActivate[] = { 561 static const struct reg_val uCclockActivate[] = {
562 { MDIO_MMD_PMAPMD, 0xd000, 0xffff, 0x5200 }, 562 { MDIO_MMD_PMAPMD, 0xd000, 0xffff, 0x5200 },
563 { 0, 0, 0, 0 } 563 { 0, 0, 0, 0 }
564 }; 564 };
565 565
566 /* set PC to start of SRAM and activate uC */ 566 /* set PC to start of SRAM and activate uC */
567 static struct reg_val uCactivate[] = { 567 static const struct reg_val uCactivate[] = {
568 { MDIO_MMD_PMAPMD, 0xd080, 0xffff, 0x0100 }, 568 { MDIO_MMD_PMAPMD, 0xd080, 0xffff, 0x0100 },
569 { MDIO_MMD_PMAPMD, 0xd092, 0xffff, 0x0000 }, 569 { MDIO_MMD_PMAPMD, 0xd092, 0xffff, 0x0000 },
570 { 0, 0, 0, 0 } 570 { 0, 0, 0, 0 }
@@ -624,7 +624,7 @@ static int ael2020_get_module_type(struct cphy *phy, int delay_ms)
624 */ 624 */
625static int ael2020_intr_enable(struct cphy *phy) 625static int ael2020_intr_enable(struct cphy *phy)
626{ 626{
627 struct reg_val regs[] = { 627 static const struct reg_val regs[] = {
628 /* output Module's Loss Of Signal (LOS) to LED */ 628 /* output Module's Loss Of Signal (LOS) to LED */
629 { MDIO_MMD_PMAPMD, AEL2020_GPIO_CFG+AEL2020_GPIO_LSTAT, 629 { MDIO_MMD_PMAPMD, AEL2020_GPIO_CFG+AEL2020_GPIO_LSTAT,
630 0xffff, 0x4 }, 630 0xffff, 0x4 },
@@ -664,7 +664,7 @@ static int ael2020_intr_enable(struct cphy *phy)
664 */ 664 */
665static int ael2020_intr_disable(struct cphy *phy) 665static int ael2020_intr_disable(struct cphy *phy)
666{ 666{
667 struct reg_val regs[] = { 667 static const struct reg_val regs[] = {
668 /* reset "link status" LED to "off" */ 668 /* reset "link status" LED to "off" */
669 { MDIO_MMD_PMAPMD, AEL2020_GPIO_CTRL, 669 { MDIO_MMD_PMAPMD, AEL2020_GPIO_CTRL,
670 0xffff, 0xb << (AEL2020_GPIO_LSTAT*4) }, 670 0xffff, 0xb << (AEL2020_GPIO_LSTAT*4) },
@@ -701,7 +701,7 @@ static int ael2020_intr_clear(struct cphy *phy)
701 return err ? err : t3_phy_lasi_intr_clear(phy); 701 return err ? err : t3_phy_lasi_intr_clear(phy);
702} 702}
703 703
704static struct reg_val ael2020_reset_regs[] = { 704static const struct reg_val ael2020_reset_regs[] = {
705 /* Erratum #2: CDRLOL asserted, causing PMA link down status */ 705 /* Erratum #2: CDRLOL asserted, causing PMA link down status */
706 { MDIO_MMD_PMAPMD, 0xc003, 0xffff, 0x3101 }, 706 { MDIO_MMD_PMAPMD, 0xc003, 0xffff, 0x3101 },
707 707
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index 3a6adf0b3e9d..ec8579a0a808 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)
1562 {0} 1562 {0}
1563 }; 1563 };
1564 1564
1565 static struct intr_info tp_intr_info_t3c[] = { 1565 static const struct intr_info tp_intr_info_t3c[] = {
1566 {0x1fffffff, "TP parity error", -1, 1}, 1566 {0x1fffffff, "TP parity error", -1, 1},
1567 {F_FLMRXFLSTEMPTY, "TP out of Rx pages", -1, 1}, 1567 {F_FLMRXFLSTEMPTY, "TP out of Rx pages", -1, 1},
1568 {F_FLMTXFLSTEMPTY, "TP out of Tx pages", -1, 1}, 1568 {F_FLMTXFLSTEMPTY, "TP out of Tx pages", -1, 1},
diff --git a/drivers/net/cxgb4vf/t4vf_hw.c b/drivers/net/cxgb4vf/t4vf_hw.c
index 35fc803a6a04..e4bec78c8e3f 100644
--- a/drivers/net/cxgb4vf/t4vf_hw.c
+++ b/drivers/net/cxgb4vf/t4vf_hw.c
@@ -116,7 +116,7 @@ static void dump_mbox(struct adapter *adapter, const char *tag, u32 mbox_data)
116int t4vf_wr_mbox_core(struct adapter *adapter, const void *cmd, int size, 116int t4vf_wr_mbox_core(struct adapter *adapter, const void *cmd, int size,
117 void *rpl, bool sleep_ok) 117 void *rpl, bool sleep_ok)
118{ 118{
119 static int delay[] = { 119 static const int delay[] = {
120 1, 1, 3, 5, 10, 10, 20, 50, 100 120 1, 1, 3, 5, 10, 10, 20, 50, 100
121 }; 121 };
122 122
diff --git a/drivers/net/irda/act200l-sir.c b/drivers/net/irda/act200l-sir.c
index 37ab8c855719..8ff084f1d236 100644
--- a/drivers/net/irda/act200l-sir.c
+++ b/drivers/net/irda/act200l-sir.c
@@ -199,7 +199,7 @@ static int act200l_reset(struct sir_dev *dev)
199{ 199{
200 unsigned state = dev->fsm.substate; 200 unsigned state = dev->fsm.substate;
201 unsigned delay = 0; 201 unsigned delay = 0;
202 u8 control[9] = { 202 static const u8 control[9] = {
203 ACT200L_REG15, 203 ACT200L_REG15,
204 ACT200L_REG13 | ACT200L_SHDW, 204 ACT200L_REG13 | ACT200L_SHDW,
205 ACT200L_REG21 | ACT200L_EXCK | ACT200L_OSCL, 205 ACT200L_REG21 | ACT200L_EXCK | ACT200L_OSCL,
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c
index b626cccbccd1..f81d944fc360 100644
--- a/drivers/net/irda/donauboe.c
+++ b/drivers/net/irda/donauboe.c
@@ -818,9 +818,9 @@ toshoboe_probe (struct toshoboe_cb *self)
818{ 818{
819 int i, j, n; 819 int i, j, n;
820#ifdef USE_MIR 820#ifdef USE_MIR
821 int bauds[] = { 9600, 115200, 4000000, 1152000 }; 821 static const int bauds[] = { 9600, 115200, 4000000, 1152000 };
822#else 822#else
823 int bauds[] = { 9600, 115200, 4000000 }; 823 static const int bauds[] = { 9600, 115200, 4000000 };
824#endif 824#endif
825 unsigned long flags; 825 unsigned long flags;
826 826
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index 37d3ebd65be8..e42d26e03af5 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -655,7 +655,7 @@ nx_p3_sre_macaddr_change(struct netxen_adapter *adapter, u8 *addr, unsigned op)
655} 655}
656 656
657static int nx_p3_nic_add_mac(struct netxen_adapter *adapter, 657static int nx_p3_nic_add_mac(struct netxen_adapter *adapter,
658 u8 *addr, struct list_head *del_list) 658 const u8 *addr, struct list_head *del_list)
659{ 659{
660 struct list_head *head; 660 struct list_head *head;
661 nx_mac_list_t *cur; 661 nx_mac_list_t *cur;
@@ -686,7 +686,9 @@ static void netxen_p3_nic_set_multi(struct net_device *netdev)
686{ 686{
687 struct netxen_adapter *adapter = netdev_priv(netdev); 687 struct netxen_adapter *adapter = netdev_priv(netdev);
688 struct netdev_hw_addr *ha; 688 struct netdev_hw_addr *ha;
689 u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; 689 static const u8 bcast_addr[ETH_ALEN] = {
690 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
691 };
690 u32 mode = VPORT_MISS_MODE_DROP; 692 u32 mode = VPORT_MISS_MODE_DROP;
691 LIST_HEAD(del_list); 693 LIST_HEAD(del_list);
692 struct list_head *head; 694 struct list_head *head;
@@ -869,9 +871,11 @@ int netxen_config_rss(struct netxen_adapter *adapter, int enable)
869 u64 word; 871 u64 word;
870 int i, rv; 872 int i, rv;
871 873
872 u64 key[] = { 0xbeac01fa6a42b73bULL, 0x8030f20c77cb2da3ULL, 874 static const u64 key[] = {
873 0xae7b30b4d0ca2bcbULL, 0x43a38fb04167253dULL, 875 0xbeac01fa6a42b73bULL, 0x8030f20c77cb2da3ULL,
874 0x255b0ec26d5a56daULL }; 876 0xae7b30b4d0ca2bcbULL, 0x43a38fb04167253dULL,
877 0x255b0ec26d5a56daULL
878 };
875 879
876 880
877 memset(&req, 0, sizeof(nx_nic_req_t)); 881 memset(&req, 0, sizeof(nx_nic_req_t));
@@ -895,7 +899,7 @@ int netxen_config_rss(struct netxen_adapter *adapter, int enable)
895 ((u64)(enable & 0x1) << 8) | 899 ((u64)(enable & 0x1) << 8) |
896 ((0x7ULL) << 48); 900 ((0x7ULL) << 48);
897 req.words[0] = cpu_to_le64(word); 901 req.words[0] = cpu_to_le64(word);
898 for (i = 0; i < 5; i++) 902 for (i = 0; i < ARRAY_SIZE(key); i++)
899 req.words[i+1] = cpu_to_le64(key[i]); 903 req.words[i+1] = cpu_to_le64(key[i]);
900 904
901 905
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index 0a2b0f9cdf33..76683d97d83b 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -1291,7 +1291,7 @@ updateCRC
1291 1291
1292static void updateCRC(int *CRC, int bit) 1292static void updateCRC(int *CRC, int bit)
1293{ 1293{
1294 int poly[]={ 1294 static const int poly[]={
1295 1,1,1,0, 1,1,0,1, 1295 1,1,1,0, 1,1,0,1,
1296 1,0,1,1, 1,0,0,0, 1296 1,0,1,1, 1,0,0,0,
1297 1,0,0,0, 0,0,1,1, 1297 1,0,0,0, 0,0,1,1,
diff --git a/drivers/net/qlcnic/qlcnic_hw.c b/drivers/net/qlcnic/qlcnic_hw.c
index c9c4bf1458a8..616940f0a8d0 100644
--- a/drivers/net/qlcnic/qlcnic_hw.c
+++ b/drivers/net/qlcnic/qlcnic_hw.c
@@ -381,7 +381,7 @@ qlcnic_sre_macaddr_change(struct qlcnic_adapter *adapter, u8 *addr,
381 return qlcnic_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1); 381 return qlcnic_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1);
382} 382}
383 383
384static int qlcnic_nic_add_mac(struct qlcnic_adapter *adapter, u8 *addr) 384static int qlcnic_nic_add_mac(struct qlcnic_adapter *adapter, const u8 *addr)
385{ 385{
386 struct list_head *head; 386 struct list_head *head;
387 struct qlcnic_mac_list_s *cur; 387 struct qlcnic_mac_list_s *cur;
@@ -415,7 +415,9 @@ void qlcnic_set_multi(struct net_device *netdev)
415{ 415{
416 struct qlcnic_adapter *adapter = netdev_priv(netdev); 416 struct qlcnic_adapter *adapter = netdev_priv(netdev);
417 struct netdev_hw_addr *ha; 417 struct netdev_hw_addr *ha;
418 u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; 418 static const u8 bcast_addr[ETH_ALEN] = {
419 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
420 };
419 u32 mode = VPORT_MISS_MODE_DROP; 421 u32 mode = VPORT_MISS_MODE_DROP;
420 422
421 if (!test_bit(__QLCNIC_FW_ATTACHED, &adapter->state)) 423 if (!test_bit(__QLCNIC_FW_ATTACHED, &adapter->state))
@@ -621,10 +623,11 @@ int qlcnic_config_rss(struct qlcnic_adapter *adapter, int enable)
621 u64 word; 623 u64 word;
622 int i, rv; 624 int i, rv;
623 625
624 const u64 key[] = { 0xbeac01fa6a42b73bULL, 0x8030f20c77cb2da3ULL, 626 static const u64 key[] = {
625 0xae7b30b4d0ca2bcbULL, 0x43a38fb04167253dULL, 627 0xbeac01fa6a42b73bULL, 0x8030f20c77cb2da3ULL,
626 0x255b0ec26d5a56daULL }; 628 0xae7b30b4d0ca2bcbULL, 0x43a38fb04167253dULL,
627 629 0x255b0ec26d5a56daULL
630 };
628 631
629 memset(&req, 0, sizeof(struct qlcnic_nic_req)); 632 memset(&req, 0, sizeof(struct qlcnic_nic_req));
630 req.qhdr = cpu_to_le64(QLCNIC_HOST_REQUEST << 23); 633 req.qhdr = cpu_to_le64(QLCNIC_HOST_REQUEST << 23);
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index 3af30c452b88..49bfa5813068 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -3548,12 +3548,13 @@ err_irq:
3548 3548
3549static int ql_start_rss(struct ql_adapter *qdev) 3549static int ql_start_rss(struct ql_adapter *qdev)
3550{ 3550{
3551 u8 init_hash_seed[] = {0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, 3551 static const u8 init_hash_seed[] = {
3552 0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 3552 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2,
3553 0xb0, 0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 3553 0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0,
3554 0x30, 0xb4, 0x77, 0xcb, 0x2d, 0xa3, 0x80, 3554 0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4,
3555 0x30, 0xf2, 0x0c, 0x6a, 0x42, 0xb7, 0x3b, 3555 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c,
3556 0xbe, 0xac, 0x01, 0xfa}; 3556 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa
3557 };
3557 struct ricb *ricb = &qdev->ricb; 3558 struct ricb *ricb = &qdev->ricb;
3558 int status = 0; 3559 int status = 0;
3559 int i; 3560 int i;
diff --git a/drivers/net/skfp/smt.c b/drivers/net/skfp/smt.c
index 2d9941c045bc..1e1bd0c201c8 100644
--- a/drivers/net/skfp/smt.c
+++ b/drivers/net/skfp/smt.c
@@ -1263,7 +1263,7 @@ void smt_set_timestamp(struct s_smc *smc, u_char *p)
1263static void smt_fill_policy(struct s_smc *smc, struct smt_p_policy *policy) 1263static void smt_fill_policy(struct s_smc *smc, struct smt_p_policy *policy)
1264{ 1264{
1265 int i ; 1265 int i ;
1266 u_char *map ; 1266 const u_char *map ;
1267 u_short in ; 1267 u_short in ;
1268 u_short out ; 1268 u_short out ;
1269 1269
@@ -1271,7 +1271,7 @@ static void smt_fill_policy(struct s_smc *smc, struct smt_p_policy *policy)
1271 * MIB para 101b (fddiSMTConnectionPolicy) coding 1271 * MIB para 101b (fddiSMTConnectionPolicy) coding
1272 * is different from 0005 coding 1272 * is different from 0005 coding
1273 */ 1273 */
1274 static u_char ansi_weirdness[16] = { 1274 static const u_char ansi_weirdness[16] = {
1275 0,7,5,3,8,1,6,4,9,10,2,11,12,13,14,15 1275 0,7,5,3,8,1,6,4,9,10,2,11,12,13,14,15
1276 } ; 1276 } ;
1277 SMTSETPARA(policy,SMT_P_POLICY) ; 1277 SMTSETPARA(policy,SMT_P_POLICY) ;
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c
index 91e6c78271a3..4786497de03e 100644
--- a/drivers/net/tokenring/ibmtr.c
+++ b/drivers/net/tokenring/ibmtr.c
@@ -657,8 +657,9 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr)
657#ifndef PCMCIA 657#ifndef PCMCIA
658 /* finish figuring the shared RAM address */ 658 /* finish figuring the shared RAM address */
659 if (cardpresent == TR_ISA) { 659 if (cardpresent == TR_ISA) {
660 static __u32 ram_bndry_mask[] = 660 static const __u32 ram_bndry_mask[] = {
661 { 0xffffe000, 0xffffc000, 0xffff8000, 0xffff0000 }; 661 0xffffe000, 0xffffc000, 0xffff8000, 0xffff0000
662 };
662 __u32 new_base, rrr_32, chk_base, rbm; 663 __u32 new_base, rrr_32, chk_base, rbm;
663 664
664 rrr_32=readb(ti->mmio+ACA_OFFSET+ACA_RW+RRR_ODD) >> 2 & 0x03; 665 rrr_32=readb(ti->mmio+ACA_OFFSET+ACA_RW+RRR_ODD) >> 2 & 0x03;
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index c78a50586c1d..b13c6b040be3 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -964,7 +964,7 @@ static void de_set_media (struct de_private *de)
964 dw32(MacMode, macmode); 964 dw32(MacMode, macmode);
965} 965}
966 966
967static void de_next_media (struct de_private *de, u32 *media, 967static void de_next_media (struct de_private *de, const u32 *media,
968 unsigned int n_media) 968 unsigned int n_media)
969{ 969{
970 unsigned int i; 970 unsigned int i;
@@ -1008,10 +1008,10 @@ static void de21040_media_timer (unsigned long data)
1008 return; 1008 return;
1009 1009
1010 if (de->media_type == DE_MEDIA_AUI) { 1010 if (de->media_type == DE_MEDIA_AUI) {
1011 u32 next_state = DE_MEDIA_TP; 1011 static const u32 next_state = DE_MEDIA_TP;
1012 de_next_media(de, &next_state, 1); 1012 de_next_media(de, &next_state, 1);
1013 } else { 1013 } else {
1014 u32 next_state = DE_MEDIA_AUI; 1014 static const u32 next_state = DE_MEDIA_AUI;
1015 de_next_media(de, &next_state, 1); 1015 de_next_media(de, &next_state, 1);
1016 } 1016 }
1017 1017
@@ -1136,13 +1136,19 @@ static void de21041_media_timer (unsigned long data)
1136 * simply resets the PHY and reloads the current media settings. 1136 * simply resets the PHY and reloads the current media settings.
1137 */ 1137 */
1138 if (de->media_type == DE_MEDIA_AUI) { 1138 if (de->media_type == DE_MEDIA_AUI) {
1139 u32 next_states[] = { DE_MEDIA_BNC, DE_MEDIA_TP_AUTO }; 1139 static const u32 next_states[] = {
1140 DE_MEDIA_BNC, DE_MEDIA_TP_AUTO
1141 };
1140 de_next_media(de, next_states, ARRAY_SIZE(next_states)); 1142 de_next_media(de, next_states, ARRAY_SIZE(next_states));
1141 } else if (de->media_type == DE_MEDIA_BNC) { 1143 } else if (de->media_type == DE_MEDIA_BNC) {
1142 u32 next_states[] = { DE_MEDIA_TP_AUTO, DE_MEDIA_AUI }; 1144 static const u32 next_states[] = {
1145 DE_MEDIA_TP_AUTO, DE_MEDIA_AUI
1146 };
1143 de_next_media(de, next_states, ARRAY_SIZE(next_states)); 1147 de_next_media(de, next_states, ARRAY_SIZE(next_states));
1144 } else { 1148 } else {
1145 u32 next_states[] = { DE_MEDIA_AUI, DE_MEDIA_BNC, DE_MEDIA_TP_AUTO }; 1149 static const u32 next_states[] = {
1150 DE_MEDIA_AUI, DE_MEDIA_BNC, DE_MEDIA_TP_AUTO
1151 };
1146 de_next_media(de, next_states, ARRAY_SIZE(next_states)); 1152 de_next_media(de, next_states, ARRAY_SIZE(next_states));
1147 } 1153 }
1148 1154
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 939e5466c75e..d143e8b72b5b 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -1131,7 +1131,9 @@ static int
1131vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, 1131vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
1132 struct vmxnet3_adapter *adapter, int quota) 1132 struct vmxnet3_adapter *adapter, int quota)
1133{ 1133{
1134 static u32 rxprod_reg[2] = {VMXNET3_REG_RXPROD, VMXNET3_REG_RXPROD2}; 1134 static const u32 rxprod_reg[2] = {
1135 VMXNET3_REG_RXPROD, VMXNET3_REG_RXPROD2
1136 };
1135 u32 num_rxd = 0; 1137 u32 num_rxd = 0;
1136 struct Vmxnet3_RxCompDesc *rcd; 1138 struct Vmxnet3_RxCompDesc *rcd;
1137 struct vmxnet3_rx_ctx *ctx = &rq->rx_ctx; 1139 struct vmxnet3_rx_ctx *ctx = &rq->rx_ctx;
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index d45b08d1dbc9..34cff6ce6d27 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -1358,7 +1358,7 @@ static int dscc4_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1358 return ret; 1358 return ret;
1359} 1359}
1360 1360
1361static int dscc4_match(struct thingie *p, int value) 1361static int dscc4_match(const struct thingie *p, int value)
1362{ 1362{
1363 int i; 1363 int i;
1364 1364
@@ -1403,7 +1403,7 @@ done:
1403static int dscc4_encoding_setting(struct dscc4_dev_priv *dpriv, 1403static int dscc4_encoding_setting(struct dscc4_dev_priv *dpriv,
1404 struct net_device *dev) 1404 struct net_device *dev)
1405{ 1405{
1406 struct thingie encoding[] = { 1406 static const struct thingie encoding[] = {
1407 { ENCODING_NRZ, 0x00000000 }, 1407 { ENCODING_NRZ, 0x00000000 },
1408 { ENCODING_NRZI, 0x00200000 }, 1408 { ENCODING_NRZI, 0x00200000 },
1409 { ENCODING_FM_MARK, 0x00400000 }, 1409 { ENCODING_FM_MARK, 0x00400000 },
@@ -1442,7 +1442,7 @@ static int dscc4_loopback_setting(struct dscc4_dev_priv *dpriv,
1442static int dscc4_crc_setting(struct dscc4_dev_priv *dpriv, 1442static int dscc4_crc_setting(struct dscc4_dev_priv *dpriv,
1443 struct net_device *dev) 1443 struct net_device *dev)
1444{ 1444{
1445 struct thingie crc[] = { 1445 static const struct thingie crc[] = {
1446 { PARITY_CRC16_PR0_CCITT, 0x00000010 }, 1446 { PARITY_CRC16_PR0_CCITT, 0x00000010 },
1447 { PARITY_CRC16_PR1_CCITT, 0x00000000 }, 1447 { PARITY_CRC16_PR1_CCITT, 0x00000000 },
1448 { PARITY_CRC32_PR0_CCITT, 0x00000011 }, 1448 { PARITY_CRC32_PR0_CCITT, 0x00000011 },