net: enetc: simplify callers of enetc_rxbd_next
authorVladimir Oltean <olteanv@gmail.com>
Wed, 10 Mar 2021 12:03:47 +0000 (14:03 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Mar 2021 21:14:15 +0000 (13:14 -0800)
commitc027aa9201eb9af8067282d4b8a7ce7523cd3c8d
treede60753594b13c22bea0b9c74ace90c544b206ad
parent4b47c0b81ffd9b395b5afc3ef41c69cceb6a8576
net: enetc: simplify callers of enetc_rxbd_next

When we iterate through the BDs in the RX ring, the software producer
index (which is already passed by value to enetc_rxbd_next) lags behind,
and we end up with this funny looking "++i == rx_ring->bd_count" check
so that we drag it after us.

Let's pass the software producer index "i" by reference, so that
enetc_rxbd_next can increment it by itself (mod rx_ring->bd_count),
especially since enetc_rxbd_next has to increment the index anyway.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/enetc/enetc.c
drivers/net/ethernet/freescale/enetc/enetc.h