Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-6142 lnet: use list_first_entry() in lnet/lnet subdirectory.
[fs/lustre-release.git]
/
lnet
/
lnet
/
nidstrings.c
diff --git
a/lnet/lnet/nidstrings.c
b/lnet/lnet/nidstrings.c
index
d732684
..
2af9d8a
100644
(file)
--- a/
lnet/lnet/nidstrings.c
+++ b/
lnet/lnet/nidstrings.c
@@
-277,11
+277,11
@@
failed:
static void
free_addrranges(struct list_head *list)
{
static void
free_addrranges(struct list_head *list)
{
- while (!list_empty(list)) {
- struct addrrange *ar;
-
- ar = list_entry(list->next, struct addrrange, ar_link);
+ struct addrrange *ar;
+ while ((ar = list_first_entry_or_null(list,
+ struct addrrange,
+ ar_link)) != NULL) {
cfs_expr_list_free_list(&ar->ar_numaddr_ranges);
list_del(&ar->ar_link);
CFS_FREE_PTR(ar);
cfs_expr_list_free_list(&ar->ar_numaddr_ranges);
list_del(&ar->ar_link);
CFS_FREE_PTR(ar);
@@
-702,7
+702,7
@@
libcfs_num_match(__u32 addr, struct list_head *numaddr)
struct cfs_expr_list *el;
LASSERT(!list_empty(numaddr));
struct cfs_expr_list *el;
LASSERT(!list_empty(numaddr));
- el = list_
entry(numaddr->next
, struct cfs_expr_list, el_link);
+ el = list_
first_entry(numaddr
, struct cfs_expr_list, el_link);
return cfs_expr_list_match(addr, el);
}
return cfs_expr_list_match(addr, el);
}