From: ssrane_b23@ee.vjti.ac.in
To: aahringo@redhat.com, teigland@redhat.com
Cc: gfs2@lists.linux.dev, linux-kernel@vger.kernel.org,
skhan@linuxfoundation.org, linux-kernel-mentees@lists.linux.dev,
david.hunter.linux@gmail.com, khalid@kernel.org,
Shaurya Rane <ssrane_b23@ee.vjti.ac.in>
Subject: [PATCH] fs/dlm: use list_add_tail() instead of open-coding list insertion
Date: Mon, 17 Nov 2025 21:33:17 +0530 [thread overview]
Message-ID: <20251117160317.127978-1-ssranevjti@gmail.com> (raw)
From: Shaurya Rane <ssrane_b23@ee.vjti.ac.in>
Replace the manual list pointer manipulation in add_ordered_member()
with the standard list_add_tail() helper. The original code explicitly
updated ->prev and ->next pointers to insert @newlist before @tmp,
which is exactly what list_add_tail(newlist, tmp) provides.
Using the list macro improves readability, removes a source of
potential pointer bugs, and satisfies the existing FIXME requesting
conversion to the list helpers. No functional change in the ordering
logic for DLM members.
Signed-off-by: Shaurya Rane <ssrane_b23@ee.vjti.ac.in>
---
fs/dlm/member.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/fs/dlm/member.c b/fs/dlm/member.c
index c0f557a80a75..c1b5598997b7 100644
--- a/fs/dlm/member.c
+++ b/fs/dlm/member.c
@@ -299,11 +299,7 @@ static void add_ordered_member(struct dlm_ls *ls, struct dlm_member *new)
if (!memb)
list_add_tail(newlist, head);
else {
- /* FIXME: can use list macro here */
- newlist->prev = tmp->prev;
- newlist->next = tmp;
- tmp->prev->next = newlist;
- tmp->prev = newlist;
+ list_add_tail(newlist, tmp);
}
}
--
2.34.1
reply other threads:[~2025-11-17 16:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251117160317.127978-1-ssranevjti@gmail.com \
--to=ssrane_b23@ee.vjti.ac.in \
--cc=aahringo@redhat.com \
--cc=david.hunter.linux@gmail.com \
--cc=gfs2@lists.linux.dev \
--cc=khalid@kernel.org \
--cc=linux-kernel-mentees@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=teigland@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox