diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2019-02-06 17:22:11 -0800 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-02-11 08:47:46 +0100 |
commit | 622743555ba9a87bfca493d607db32771408e240 (patch) | |
tree | eb978b6acfdd9cad32ef61ffe065573a815bf403 /drivers/net/e1000 | |
parent | 351c2bd7a8bdeda30a2ef8e6d85b9f8550006686 (diff) | |
download | barebox-622743555ba9a87bfca493d607db32771408e240.tar.gz barebox-622743555ba9a87bfca493d607db32771408e240.tar.xz |
net/e1000: Remove pointer arithmetic from e1000_fill_rx()
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@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/net/e1000')
-rw-r--r-- | drivers/net/e1000/main.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c index b728add7f3..90b6d6e436 100644 --- a/drivers/net/e1000/main.c +++ b/drivers/net/e1000/main.c @@ -3200,12 +3200,11 @@ static int e1000_sw_init(struct eth_device *edev) static void e1000_fill_rx(struct e1000_hw *hw) { - volatile struct e1000_rx_desc *rd; + volatile struct e1000_rx_desc *rd = &hw->rx_base[hw->rx_tail]; volatile u32 *bla; int i; hw->rx_last = hw->rx_tail; - rd = hw->rx_base + hw->rx_tail; hw->rx_tail = (hw->rx_tail + 1) % 8; bla = (void *)rd; |