Skip to content

Commit 10ee4b8

Browse files
Zhengzengkaidavem330
authored andcommitted
qede: remove some unused code in function qede_selftest_receive_traffic
Remove set but not used variables 'sw_comp_cons' and 'hw_comp_cons' to fix gcc '-Wunused-but-set-variable' warning: drivers/net/ethernet/qlogic/qede/qede_ethtool.c: In function qede_selftest_receive_traffic: drivers/net/ethernet/qlogic/qede/qede_ethtool.c:1569:20: warning: variable sw_comp_cons set but not used [-Wunused-but-set-variable] drivers/net/ethernet/qlogic/qede/qede_ethtool.c: In function qede_selftest_receive_traffic: drivers/net/ethernet/qlogic/qede/qede_ethtool.c:1569:6: warning: variable hw_comp_cons set but not used [-Wunused-but-set-variable] After removing 'hw_comp_cons',the memory barrier 'rmb()' and its comments become useless, so remove them as well. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 74522e7 commit 10ee4b8

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

‎drivers/net/ethernet/qlogic/qede/qede_ethtool.c‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,7 @@ static int qede_selftest_transmit_traffic(struct qede_dev *edev,
15661566

15671567
static int qede_selftest_receive_traffic(struct qede_dev *edev)
15681568
{
1569-
u16 hw_comp_cons, sw_comp_cons, sw_rx_index, len;
1569+
u16 sw_rx_index, len;
15701570
struct eth_fast_path_rx_reg_cqe *fp_cqe;
15711571
struct qede_rx_queue *rxq = NULL;
15721572
struct sw_rx_data *sw_rx_data;
@@ -1596,17 +1596,6 @@ static int qede_selftest_receive_traffic(struct qede_dev *edev)
15961596
continue;
15971597
}
15981598

1599-
hw_comp_cons = le16_to_cpu(*rxq->hw_cons_ptr);
1600-
sw_comp_cons = qed_chain_get_cons_idx(&rxq->rx_comp_ring);
1601-
1602-
/* Memory barrier to prevent the CPU from doing speculative
1603-
* reads of CQE/BD before reading hw_comp_cons. If the CQE is
1604-
* read before it is written by FW, then FW writes CQE and SB,
1605-
* and then the CPU reads the hw_comp_cons, it will use an old
1606-
* CQE.
1607-
*/
1608-
rmb();
1609-
16101599
/* Get the CQE from the completion ring */
16111600
cqe = (union eth_rx_cqe *)qed_chain_consume(&rxq->rx_comp_ring);
16121601

0 commit comments

Comments
 (0)