]> git.hungrycats.org Git - linux/commitdiff
o LLC: use list_for_each_entry in llc_sap_find
authorArnaldo Carvalho de Melo <acme@conectiva.com.br>
Sat, 20 Sep 2003 13:06:18 +0000 (10:06 -0300)
committerArnaldo Carvalho de Melo <acme@conectiva.com.br>
Sat, 20 Sep 2003 13:06:18 +0000 (10:06 -0300)
net/llc/llc_core.c

index fb0b0aca56c1e8400f72aa71b350cbd9f86a7ee0..06afd7610ad398a3d88e44f8802b8d96a54498d1 100644 (file)
@@ -78,17 +78,14 @@ void llc_del_sap(struct llc_sap *sap)
  */
 struct llc_sap *llc_sap_find(unsigned char sap_value)
 {
-       struct llc_sap* sap = NULL;
-       struct list_head *entry;
+       struct llc_sap* sap;
 
        read_lock_bh(&llc_sap_list_lock);
-       list_for_each(entry, &llc_sap_list) {
-               sap = list_entry(entry, struct llc_sap, node);
+       list_for_each_entry(sap, &llc_sap_list, node)
                if (sap->laddr.lsap == sap_value)
-                       break;
-       }
-       if (entry == &llc_sap_list) /* not found */
-               sap = NULL;
+                       goto out;
+       sap = NULL;
+out:
        read_unlock_bh(&llc_sap_list_lock);
        return sap;
 }