[PATCH 07/16] net/e1000: Get rid of pointer arithmetic in e1000_poll

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <andrew.smirnov@xxxxxxxxx>
---
 drivers/net/e1000/main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c
index e793785e6..f13b48e0c 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);
 
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux