From: Ethan Nelson-Moore <enelsonmoore@gmail.com>
To: linux-fsdevel@vger.kernel.org
Cc: Ethan Nelson-Moore <enelsonmoore@gmail.com>,
Kees Cook <kees@kernel.org>,
Joel Granados <joel.granados@kernel.org>
Subject: [PATCH] sysctl: quiet unused variable warning in fs/proc/proc_sysctl.c:init_header()
Date: Thu, 17 Sep 2026 23:23:38 -0700 [thread overview]
Message-ID: <20260918062338.1039303-1-enelsonmoore@gmail.com> (raw)
The init_header() function uses list_for_each_table_entry() without
using the entry argument. This causes a warning when building with W=1.
Since the code is correct, mark the associated variable as
__maybe_unused.
Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
---
fs/proc/proc_sysctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index 04a382178c65..d0d76c31d330 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -206,7 +206,7 @@ static void init_header(struct ctl_table_header *head,
head->node = node;
INIT_HLIST_HEAD(&head->inodes);
if (node) {
- const struct ctl_table *entry;
+ const struct ctl_table *entry __maybe_unused;
list_for_each_table_entry(entry, head) {
node->header = head;
--
2.43.0
next reply other threads:[~2026-09-18 6:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 6:23 Ethan Nelson-Moore [this message]
2026-09-18 11:05 ` [PATCH] sysctl: quiet unused variable warning in fs/proc/proc_sysctl.c:init_header() Joel Granados
2026-09-19 22:58 ` Ethan Nelson-Moore
2026-09-25 10:26 ` Joel Granados
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=20260918062338.1039303-1-enelsonmoore@gmail.com \
--to=enelsonmoore@gmail.com \
--cc=joel.granados@kernel.org \
--cc=kees@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
/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