diff mbox series

[23/33] lnet: use list_first_entry() where appropriate.

Message ID 20250202204633.1148872-24-jsimmons@infradead.org (mailing list archive)
State New
Headers show
Series lustre: sync to OpenSFS branch May 31, 2023 | expand

Commit Message

James Simmons Feb. 2, 2025, 8:46 p.m. UTC
From: Mr NeilBrown <neilb@suse.de>

Lustre already uses list_first_entry() in many places, but
it is not consistent.  Let's make it consistent.
The patch was generated with

sed -i 's/list_entry(([^,]*)->next,/list_first_entry(1,/'
        `git grep -l 'list_entry(.*->next' lustre/ lnet/ libcfs/ `

followed by some manual cleanup of indents.

WC-bug-id: https://jira.whamcloud.com/browse/LU-6142
Lustre-commit: 01e054b34cb894bd4 ("LU-6142 all: use list_first_entry() where appropriate.")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50826
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 net/lnet/lnet/lib-move.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/net/lnet/lnet/lib-move.c b/net/lnet/lnet/lib-move.c
index 9d50260d917a..d9f5eb94ff6e 100644
--- a/net/lnet/lnet/lib-move.c
+++ b/net/lnet/lnet/lib-move.c
@@ -3162,8 +3162,8 @@  lnet_resend_pending_msgs_locked(struct list_head *resendq, int cpt)
 	while (!list_empty(resendq)) {
 		struct lnet_peer_ni *lpni;
 
-		msg = list_entry(resendq->next, struct lnet_msg,
-				 msg_list);
+		msg = list_first_entry(resendq, struct lnet_msg,
+				       msg_list);
 
 		list_del_init(&msg->msg_list);