From e487e808b682706cba6dcf1340769528d371fb6e Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Wed, 6 Feb 2019 17:22:05 -0800 Subject: net/e1000: Get rid of pointer arithmetic in e1000_poll Instead of relying on reles of pointer arithmetic (implicit multiplication by the size of pointer type), change the code to retreive address of an array elemet to clarify the intent. Signed-off-by: Andrey Smirnov Signed-off-by: Sascha Hauer --- drivers/net/e1000/main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/net/e1000') diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c index e793785e60..f13b48e0c8 100644 --- a/drivers/net/e1000/main.c +++ b/drivers/net/e1000/main.c @@ -3391,11 +3391,9 @@ static void e1000_configure_rx(struct e1000_hw *hw) static int e1000_poll(struct eth_device *edev) { struct e1000_hw *hw = edev->priv; - volatile struct e1000_rx_desc *rd; + volatile struct e1000_rx_desc *rd = &hw->rx_base[hw->rx_last]; uint32_t len; - rd = hw->rx_base + hw->rx_last; - if (le32_to_cpu(rd->status) & E1000_RXD_STAT_DD) { len = le32_to_cpu(rd->length); -- cgit v1.2.3