Skip to content

Commit e833328

Browse files
Wang Haidavem330
authored andcommitted
net: lapb: Use list_for_each_entry() to simplify code in lapb_iface.c
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]>
1 parent 3835a66 commit e833328

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

net/lapb/lapb_iface.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,9 @@ static void __lapb_insert_cb(struct lapb_cb *lapb)
8080

8181
static struct lapb_cb *__lapb_devtostruct(struct net_device *dev)
8282
{
83-
struct list_head *entry;
8483
struct lapb_cb *lapb, *use = NULL;
8584

86-
list_for_each(entry, &lapb_list) {
87-
lapb = list_entry(entry, struct lapb_cb, node);
85+
list_for_each_entry(lapb, &lapb_list, node) {
8886
if (lapb->dev == dev) {
8987
use = lapb;
9088
break;

0 commit comments

Comments
 (0)