diff options
author | Yuval Mintz <yuvalmin@broadcom.com> | 2012-03-18 06:33:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-03-19 16:53:06 -0400 |
commit | 3b60306690569927951be09160e80a8af9c94db4 (patch) | |
tree | e6d1c2207f954c1375573964c245ed0ff5de82a5 | |
parent | 51c1a580b1e07d58eb063f9f4a70aea8ad32fe23 (diff) |
bnx2x: reduced sparse warnings
This patch reduces sparse warnings in the bnx2x code,
mostly by changing functions into static and changing
initialization of structures.
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h | 12 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 16 |
6 files changed, 18 insertions, 29 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index d2fb7ba38143..673bd83b5a26 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -1574,7 +1574,7 @@ static inline int bnx2x_init_rss_pf(struct bnx2x *bp) | |||
1574 | 1574 | ||
1575 | int bnx2x_config_rss_pf(struct bnx2x *bp, u8 *ind_table, bool config_hash) | 1575 | int bnx2x_config_rss_pf(struct bnx2x *bp, u8 *ind_table, bool config_hash) |
1576 | { | 1576 | { |
1577 | struct bnx2x_config_rss_params params = {0}; | 1577 | struct bnx2x_config_rss_params params = {NULL}; |
1578 | int i; | 1578 | int i; |
1579 | 1579 | ||
1580 | /* Although RSS is meaningless when there is a single HW queue we | 1580 | /* Although RSS is meaningless when there is a single HW queue we |
@@ -1637,7 +1637,7 @@ int bnx2x_config_rss_pf(struct bnx2x *bp, u8 *ind_table, bool config_hash) | |||
1637 | 1637 | ||
1638 | static inline int bnx2x_init_hw(struct bnx2x *bp, u32 load_code) | 1638 | static inline int bnx2x_init_hw(struct bnx2x *bp, u32 load_code) |
1639 | { | 1639 | { |
1640 | struct bnx2x_func_state_params func_params = {0}; | 1640 | struct bnx2x_func_state_params func_params = {NULL}; |
1641 | 1641 | ||
1642 | /* Prepare parameters for function state transitions */ | 1642 | /* Prepare parameters for function state transitions */ |
1643 | __set_bit(RAMROD_COMP_WAIT, &func_params.ramrod_flags); | 1643 | __set_bit(RAMROD_COMP_WAIT, &func_params.ramrod_flags); |
@@ -1658,7 +1658,7 @@ static void bnx2x_squeeze_objects(struct bnx2x *bp) | |||
1658 | { | 1658 | { |
1659 | int rc; | 1659 | int rc; |
1660 | unsigned long ramrod_flags = 0, vlan_mac_flags = 0; | 1660 | unsigned long ramrod_flags = 0, vlan_mac_flags = 0; |
1661 | struct bnx2x_mcast_ramrod_params rparam = {0}; | 1661 | struct bnx2x_mcast_ramrod_params rparam = {NULL}; |
1662 | struct bnx2x_vlan_mac_obj *mac_obj = &bp->fp->mac_obj; | 1662 | struct bnx2x_vlan_mac_obj *mac_obj = &bp->fp->mac_obj; |
1663 | 1663 | ||
1664 | /***************** Cleanup MACs' object first *************************/ | 1664 | /***************** Cleanup MACs' object first *************************/ |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h index bba47fb8755c..04d78c02c8cc 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | |||
@@ -970,7 +970,7 @@ static inline void bnx2x_reuse_rx_data(struct bnx2x_fastpath *fp, | |||
970 | */ | 970 | */ |
971 | static inline int bnx2x_func_start(struct bnx2x *bp) | 971 | static inline int bnx2x_func_start(struct bnx2x *bp) |
972 | { | 972 | { |
973 | struct bnx2x_func_state_params func_params = {0}; | 973 | struct bnx2x_func_state_params func_params = {NULL}; |
974 | struct bnx2x_func_start_params *start_params = | 974 | struct bnx2x_func_start_params *start_params = |
975 | &func_params.params.start; | 975 | &func_params.params.start; |
976 | 976 | ||
@@ -1596,6 +1596,7 @@ static inline void bnx2x_bz_fp(struct bnx2x *bp, int index) | |||
1596 | #endif | 1596 | #endif |
1597 | } | 1597 | } |
1598 | 1598 | ||
1599 | #ifdef BCM_CNIC | ||
1599 | /** | 1600 | /** |
1600 | * bnx2x_get_iscsi_info - update iSCSI params according to licensing info. | 1601 | * bnx2x_get_iscsi_info - update iSCSI params according to licensing info. |
1601 | * | 1602 | * |
@@ -1603,7 +1604,7 @@ static inline void bnx2x_bz_fp(struct bnx2x *bp, int index) | |||
1603 | * | 1604 | * |
1604 | */ | 1605 | */ |
1605 | void bnx2x_get_iscsi_info(struct bnx2x *bp); | 1606 | void bnx2x_get_iscsi_info(struct bnx2x *bp); |
1606 | 1607 | #endif | |
1607 | /* returns func by VN for current port */ | 1608 | /* returns func by VN for current port */ |
1608 | static inline int func_by_vn(struct bnx2x *bp, int vn) | 1609 | static inline int func_by_vn(struct bnx2x *bp, int vn) |
1609 | { | 1610 | { |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c index b19669ab993b..2b806090fa4a 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c | |||
@@ -443,7 +443,7 @@ static void bnx2x_pfc_set_pfc(struct bnx2x *bp) | |||
443 | 443 | ||
444 | static int bnx2x_dcbx_stop_hw_tx(struct bnx2x *bp) | 444 | static int bnx2x_dcbx_stop_hw_tx(struct bnx2x *bp) |
445 | { | 445 | { |
446 | struct bnx2x_func_state_params func_params = {0}; | 446 | struct bnx2x_func_state_params func_params = {NULL}; |
447 | 447 | ||
448 | func_params.f_obj = &bp->func_obj; | 448 | func_params.f_obj = &bp->func_obj; |
449 | func_params.cmd = BNX2X_F_CMD_TX_STOP; | 449 | func_params.cmd = BNX2X_F_CMD_TX_STOP; |
@@ -454,7 +454,7 @@ static int bnx2x_dcbx_stop_hw_tx(struct bnx2x *bp) | |||
454 | 454 | ||
455 | static int bnx2x_dcbx_resume_hw_tx(struct bnx2x *bp) | 455 | static int bnx2x_dcbx_resume_hw_tx(struct bnx2x *bp) |
456 | { | 456 | { |
457 | struct bnx2x_func_state_params func_params = {0}; | 457 | struct bnx2x_func_state_params func_params = {NULL}; |
458 | struct bnx2x_func_tx_start_params *tx_params = | 458 | struct bnx2x_func_tx_start_params *tx_params = |
459 | &func_params.params.tx_start; | 459 | &func_params.params.tx_start; |
460 | 460 | ||
@@ -529,7 +529,7 @@ static void bnx2x_dcbx_2cos_limit_update_ets_config(struct bnx2x *bp) | |||
529 | /* | 529 | /* |
530 | * In E3B0 the configuration may have more than 2 COS. | 530 | * In E3B0 the configuration may have more than 2 COS. |
531 | */ | 531 | */ |
532 | void bnx2x_dcbx_update_ets_config(struct bnx2x *bp) | 532 | static void bnx2x_dcbx_update_ets_config(struct bnx2x *bp) |
533 | { | 533 | { |
534 | struct bnx2x_dcbx_pg_params *ets = &(bp->dcbx_port_params.ets); | 534 | struct bnx2x_dcbx_pg_params *ets = &(bp->dcbx_port_params.ets); |
535 | struct bnx2x_ets_params ets_params = { 0 }; | 535 | struct bnx2x_ets_params ets_params = { 0 }; |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c index 3618a00a8144..2cc0a1703970 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | |||
@@ -2107,7 +2107,7 @@ test_nvram_exit: | |||
2107 | /* Send an EMPTY ramrod on the first queue */ | 2107 | /* Send an EMPTY ramrod on the first queue */ |
2108 | static int bnx2x_test_intr(struct bnx2x *bp) | 2108 | static int bnx2x_test_intr(struct bnx2x *bp) |
2109 | { | 2109 | { |
2110 | struct bnx2x_queue_state_params params = {0}; | 2110 | struct bnx2x_queue_state_params params = {NULL}; |
2111 | 2111 | ||
2112 | if (!netif_running(bp->dev)) { | 2112 | if (!netif_running(bp->dev)) { |
2113 | DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM, | 2113 | DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM, |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h index e5c5982ae06d..cd6dfa9eaa3a 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h | |||
@@ -243,18 +243,6 @@ | |||
243 | (IRO[48].base + ((funcId) * IRO[48].m1)) | 243 | (IRO[48].base + ((funcId) * IRO[48].m1)) |
244 | #define COMMON_ASM_INVALID_ASSERT_OPCODE 0x0 | 244 | #define COMMON_ASM_INVALID_ASSERT_OPCODE 0x0 |
245 | 245 | ||
246 | /** | ||
247 | * This file defines HSI constants for the ETH flow | ||
248 | */ | ||
249 | #ifdef _EVEREST_MICROCODE | ||
250 | #include "Microcode\Generated\DataTypes\eth_rx_bd.h" | ||
251 | #include "Microcode\Generated\DataTypes\eth_tx_bd.h" | ||
252 | #include "Microcode\Generated\DataTypes\eth_rx_cqe.h" | ||
253 | #include "Microcode\Generated\DataTypes\eth_rx_sge.h" | ||
254 | #include "Microcode\Generated\DataTypes\eth_rx_cqe_next_page.h" | ||
255 | #endif | ||
256 | |||
257 | |||
258 | /* Ethernet Ring parameters */ | 246 | /* Ethernet Ring parameters */ |
259 | #define X_ETH_LOCAL_RING_SIZE 13 | 247 | #define X_ETH_LOCAL_RING_SIZE 13 |
260 | #define FIRST_BD_IN_PKT 0 | 248 | #define FIRST_BD_IN_PKT 0 |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 5e5367aa5b4d..a626fe87b2a4 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -7446,7 +7446,7 @@ int bnx2x_setup_tx_only(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
7446 | int bnx2x_setup_queue(struct bnx2x *bp, struct bnx2x_fastpath *fp, | 7446 | int bnx2x_setup_queue(struct bnx2x *bp, struct bnx2x_fastpath *fp, |
7447 | bool leading) | 7447 | bool leading) |
7448 | { | 7448 | { |
7449 | struct bnx2x_queue_state_params q_params = {0}; | 7449 | struct bnx2x_queue_state_params q_params = {NULL}; |
7450 | struct bnx2x_queue_setup_params *setup_params = | 7450 | struct bnx2x_queue_setup_params *setup_params = |
7451 | &q_params.params.setup; | 7451 | &q_params.params.setup; |
7452 | struct bnx2x_queue_setup_tx_only_params *tx_only_params = | 7452 | struct bnx2x_queue_setup_tx_only_params *tx_only_params = |
@@ -7529,7 +7529,7 @@ static int bnx2x_stop_queue(struct bnx2x *bp, int index) | |||
7529 | { | 7529 | { |
7530 | struct bnx2x_fastpath *fp = &bp->fp[index]; | 7530 | struct bnx2x_fastpath *fp = &bp->fp[index]; |
7531 | struct bnx2x_fp_txdata *txdata; | 7531 | struct bnx2x_fp_txdata *txdata; |
7532 | struct bnx2x_queue_state_params q_params = {0}; | 7532 | struct bnx2x_queue_state_params q_params = {NULL}; |
7533 | int rc, tx_index; | 7533 | int rc, tx_index; |
7534 | 7534 | ||
7535 | DP(NETIF_MSG_IFDOWN, "stopping queue %d cid %d\n", index, fp->cid); | 7535 | DP(NETIF_MSG_IFDOWN, "stopping queue %d cid %d\n", index, fp->cid); |
@@ -7705,7 +7705,7 @@ static void bnx2x_reset_port(struct bnx2x *bp) | |||
7705 | 7705 | ||
7706 | static inline int bnx2x_reset_hw(struct bnx2x *bp, u32 load_code) | 7706 | static inline int bnx2x_reset_hw(struct bnx2x *bp, u32 load_code) |
7707 | { | 7707 | { |
7708 | struct bnx2x_func_state_params func_params = {0}; | 7708 | struct bnx2x_func_state_params func_params = {NULL}; |
7709 | 7709 | ||
7710 | /* Prepare parameters for function state transitions */ | 7710 | /* Prepare parameters for function state transitions */ |
7711 | __set_bit(RAMROD_COMP_WAIT, &func_params.ramrod_flags); | 7711 | __set_bit(RAMROD_COMP_WAIT, &func_params.ramrod_flags); |
@@ -7720,7 +7720,7 @@ static inline int bnx2x_reset_hw(struct bnx2x *bp, u32 load_code) | |||
7720 | 7720 | ||
7721 | static inline int bnx2x_func_stop(struct bnx2x *bp) | 7721 | static inline int bnx2x_func_stop(struct bnx2x *bp) |
7722 | { | 7722 | { |
7723 | struct bnx2x_func_state_params func_params = {0}; | 7723 | struct bnx2x_func_state_params func_params = {NULL}; |
7724 | int rc; | 7724 | int rc; |
7725 | 7725 | ||
7726 | /* Prepare parameters for function state transitions */ | 7726 | /* Prepare parameters for function state transitions */ |
@@ -7877,7 +7877,7 @@ static inline int bnx2x_func_wait_started(struct bnx2x *bp) | |||
7877 | * Failed to complete the transaction in a "good way" | 7877 | * Failed to complete the transaction in a "good way" |
7878 | * Force both transactions with CLR bit | 7878 | * Force both transactions with CLR bit |
7879 | */ | 7879 | */ |
7880 | struct bnx2x_func_state_params func_params = {0}; | 7880 | struct bnx2x_func_state_params func_params = {NULL}; |
7881 | 7881 | ||
7882 | DP(NETIF_MSG_IFDOWN, | 7882 | DP(NETIF_MSG_IFDOWN, |
7883 | "Hmmm... unexpected function state! Forcing STARTED-->TX_ST0PPED-->STARTED\n"); | 7883 | "Hmmm... unexpected function state! Forcing STARTED-->TX_ST0PPED-->STARTED\n"); |
@@ -7904,7 +7904,7 @@ void bnx2x_chip_cleanup(struct bnx2x *bp, int unload_mode) | |||
7904 | int port = BP_PORT(bp); | 7904 | int port = BP_PORT(bp); |
7905 | int i, rc = 0; | 7905 | int i, rc = 0; |
7906 | u8 cos; | 7906 | u8 cos; |
7907 | struct bnx2x_mcast_ramrod_params rparam = {0}; | 7907 | struct bnx2x_mcast_ramrod_params rparam = {NULL}; |
7908 | u32 reset_code; | 7908 | u32 reset_code; |
7909 | 7909 | ||
7910 | /* Wait until tx fastpath tasks complete */ | 7910 | /* Wait until tx fastpath tasks complete */ |
@@ -10309,7 +10309,7 @@ static inline int bnx2x_set_uc_list(struct bnx2x *bp) | |||
10309 | static inline int bnx2x_set_mc_list(struct bnx2x *bp) | 10309 | static inline int bnx2x_set_mc_list(struct bnx2x *bp) |
10310 | { | 10310 | { |
10311 | struct net_device *dev = bp->dev; | 10311 | struct net_device *dev = bp->dev; |
10312 | struct bnx2x_mcast_ramrod_params rparam = {0}; | 10312 | struct bnx2x_mcast_ramrod_params rparam = {NULL}; |
10313 | int rc = 0; | 10313 | int rc = 0; |
10314 | 10314 | ||
10315 | rparam.mcast_obj = &bp->mcast_obj; | 10315 | rparam.mcast_obj = &bp->mcast_obj; |
@@ -10830,7 +10830,7 @@ do { \ | |||
10830 | (u8 *)bp->arr, len); \ | 10830 | (u8 *)bp->arr, len); \ |
10831 | } while (0) | 10831 | } while (0) |
10832 | 10832 | ||
10833 | int bnx2x_init_firmware(struct bnx2x *bp) | 10833 | static int bnx2x_init_firmware(struct bnx2x *bp) |
10834 | { | 10834 | { |
10835 | const char *fw_file_name; | 10835 | const char *fw_file_name; |
10836 | struct bnx2x_fw_file_hdr *fw_hdr; | 10836 | struct bnx2x_fw_file_hdr *fw_hdr; |