o LLC: use list_for_each_entry in llc_sap_find

parent 874d7485
...@@ -78,17 +78,14 @@ void llc_del_sap(struct llc_sap *sap) ...@@ -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 *llc_sap_find(unsigned char sap_value)
{ {
struct llc_sap* sap = NULL; struct llc_sap* sap;
struct list_head *entry;
read_lock_bh(&llc_sap_list_lock); read_lock_bh(&llc_sap_list_lock);
list_for_each(entry, &llc_sap_list) { list_for_each_entry(sap, &llc_sap_list, node)
sap = list_entry(entry, struct llc_sap, node);
if (sap->laddr.lsap == sap_value) if (sap->laddr.lsap == sap_value)
break; goto out;
} sap = NULL;
if (entry == &llc_sap_list) /* not found */ out:
sap = NULL;
read_unlock_bh(&llc_sap_list_lock); read_unlock_bh(&llc_sap_list_lock);
return sap; return sap;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment