diff options
author | YueHaibing <yuehaibing@huawei.com> | 2018-11-28 07:29:39 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-28 14:09:11 -0500 |
commit | 8eb08cf8a35a525dc40b9fedd33833a4a7aecfb2 (patch) | |
tree | 70eb6b5137d45b499ad4d8bfa7b99f6829e48fac | |
parent | 9cc549e4a7300a4b09da1429ed8c9c8f5759246f (diff) |
qlcnic: remove set but not used variables 'cur_rings, max_hw_rings, tx_desc_info'
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c:4011:5:
warning: variable 'max_hw_rings' set but not used [-Wunused-but-set-variable]
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c:4013:6:
warning: variable 'cur_rings' set but not used [-Wunused-but-set-variable]
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c:2996:25:
warning: variable 'tx_desc_info' set but not used [-Wunused-but-set-variable]
'cur_rings, max_hw_rings' never used since introduction in commit
34e8c406fda5 ("qlcnic: refactor Tx/SDS ring calculation and validation in driver.")
'tx_desc_info' never used since commit
95b3890ae39f ("qlcnic: Enhance Tx timeout debugging.")
Also 'queue_type' only can be QLCNIC_RX_QUEUE/QLCNIC_TX_QUEUE,
so make a trival cleanup on if statement.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Shahed Shaikh <shahed.shaikh@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index d42ba2293d8c..16d0479f6891 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |||
@@ -2993,10 +2993,8 @@ int qlcnic_check_temp(struct qlcnic_adapter *adapter) | |||
2993 | static inline void dump_tx_ring_desc(struct qlcnic_host_tx_ring *tx_ring) | 2993 | static inline void dump_tx_ring_desc(struct qlcnic_host_tx_ring *tx_ring) |
2994 | { | 2994 | { |
2995 | int i; | 2995 | int i; |
2996 | struct cmd_desc_type0 *tx_desc_info; | ||
2997 | 2996 | ||
2998 | for (i = 0; i < tx_ring->num_desc; i++) { | 2997 | for (i = 0; i < tx_ring->num_desc; i++) { |
2999 | tx_desc_info = &tx_ring->desc_head[i]; | ||
3000 | pr_info("TX Desc: %d\n", i); | 2998 | pr_info("TX Desc: %d\n", i); |
3001 | print_hex_dump(KERN_INFO, "TX: ", DUMP_PREFIX_OFFSET, 16, 1, | 2999 | print_hex_dump(KERN_INFO, "TX: ", DUMP_PREFIX_OFFSET, 16, 1, |
3002 | &tx_ring->desc_head[i], | 3000 | &tx_ring->desc_head[i], |
@@ -4008,19 +4006,12 @@ int qlcnic_validate_rings(struct qlcnic_adapter *adapter, __u32 ring_cnt, | |||
4008 | int queue_type) | 4006 | int queue_type) |
4009 | { | 4007 | { |
4010 | struct net_device *netdev = adapter->netdev; | 4008 | struct net_device *netdev = adapter->netdev; |
4011 | u8 max_hw_rings = 0; | ||
4012 | char buf[8]; | 4009 | char buf[8]; |
4013 | int cur_rings; | ||
4014 | 4010 | ||
4015 | if (queue_type == QLCNIC_RX_QUEUE) { | 4011 | if (queue_type == QLCNIC_RX_QUEUE) |
4016 | max_hw_rings = adapter->max_sds_rings; | ||
4017 | cur_rings = adapter->drv_sds_rings; | ||
4018 | strcpy(buf, "SDS"); | 4012 | strcpy(buf, "SDS"); |
4019 | } else if (queue_type == QLCNIC_TX_QUEUE) { | 4013 | else |
4020 | max_hw_rings = adapter->max_tx_rings; | ||
4021 | cur_rings = adapter->drv_tx_rings; | ||
4022 | strcpy(buf, "Tx"); | 4014 | strcpy(buf, "Tx"); |
4023 | } | ||
4024 | 4015 | ||
4025 | if (!is_power_of_2(ring_cnt)) { | 4016 | if (!is_power_of_2(ring_cnt)) { |
4026 | netdev_err(netdev, "%s rings value should be a power of 2\n", | 4017 | netdev_err(netdev, "%s rings value should be a power of 2\n", |