Skip to content

Commit

Permalink
net: lapb: Use list_for_each_entry() to simplify code in lapb_iface.c
Browse files Browse the repository at this point in the history
Convert list_for_each() to list_for_each_entry() where
applicable. This simplifies the code.

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Wang Hai <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Wang Hai authored and davem330 committed Jun 8, 2021
1 parent 3835a66 commit e833328
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/lapb/lapb_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,9 @@ static void __lapb_insert_cb(struct lapb_cb *lapb)

static struct lapb_cb *__lapb_devtostruct(struct net_device *dev)
{
struct list_head *entry;
struct lapb_cb *lapb, *use = NULL;

list_for_each(entry, &lapb_list) {
lapb = list_entry(entry, struct lapb_cb, node);
list_for_each_entry(lapb, &lapb_list, node) {
if (lapb->dev == dev) {
use = lapb;
break;
Expand Down

0 comments on commit e833328

Please sign in to comment.