This patch changes
list_entry(foo.next, ...)
to
list_first_entry(&foo, ...)
in cases where 'foo' is a list head, rather than a list member.
It also re-indents following lines where that is needed.
Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Ib7ec3f3ab7f34afb3b39fda0ff9d916514b062ff
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50829
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
while (!list_empty(&expr_list->el_exprs)) {
struct cfs_range_expr *expr;
- expr = list_entry(expr_list->el_exprs.next,
- struct cfs_range_expr, re_link);
+ expr = list_first_entry(&expr_list->el_exprs,
+ struct cfs_range_expr, re_link);
list_del(&expr->re_link);
LIBCFS_FREE(expr, sizeof(*expr));
}