Skip to content

Commit

Permalink
net: ag71xx: Slightly simplify 'ag71xx_rx_packets()'
Browse files Browse the repository at this point in the history
There is no need to use 'list_for_each_entry_safe' here, as nothing is
removed from the list in the 'for' loop.
Use 'list_for_each_entry' instead, it is slightly less verbose.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Christophe JAILLET authored and David S. Miller committed Apr 5, 2021
1 parent 514e115 commit 0282bc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/atheros/ag71xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1658,9 +1658,9 @@ static int ag71xx_rx_packets(struct ag71xx *ag, int limit)
struct net_device *ndev = ag->ndev;
int ring_mask, ring_size, done = 0;
unsigned int pktlen_mask, offset;
struct sk_buff *next, *skb;
struct ag71xx_ring *ring;
struct list_head rx_list;
struct sk_buff *skb;

ring = &ag->rx_ring;
pktlen_mask = ag->dcfg->desc_pktlen_mask;
Expand Down Expand Up @@ -1725,7 +1725,7 @@ static int ag71xx_rx_packets(struct ag71xx *ag, int limit)

ag71xx_ring_rx_refill(ag);

list_for_each_entry_safe(skb, next, &rx_list, list)
list_for_each_entry(skb, &rx_list, list)
skb->protocol = eth_type_trans(skb, ndev);
netif_receive_skb_list(&rx_list);

Expand Down

0 comments on commit 0282bc6

Please sign in to comment.