From: Sameeksha Sankpal <sameekshasankpal@gmail.com>
To: akpm@linux-foundation.org
Cc: rppt@kernel.org, tglx@linutronix.de, chenhuacai@kernel.org,
mhiramat@kernel.org, mingo@kernel.org, francesco@valla.it,
link@vivo.com, brauner@kernel.org, lillian@star-ark.net,
guoweikang.kernel@gmail.com, alexander.shishkin@linux.intel.com,
linux-kernel@vger.kernel.org,
Sameeksha Sankpal <sameekshasankpal@gmail.com>
Subject: [PATCH] init: mark envp_init as static
Date: Sat, 29 Nov 2025 00:46:50 +0530 [thread overview]
Message-ID: <20251128191650.18821-1-sameekshasankpal@gmail.com> (raw)
Sparse reports a warning that 'envp_init' has no prior
declaration:
warning: symbol 'envp_init' was not declared. Should it be static?
The variable is only used within init/main.c and does not
need external linkage. Mark it as static to limit its scope
and fix the sparse warning.
Signed-off-by: Sameeksha Sankpal <sameekshasankpal@gmail.com>
---
init/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/init/main.c b/init/main.c
index 07a3116811c5..792ab00e62e6 100644
--- a/init/main.c
+++ b/init/main.c
@@ -191,7 +191,7 @@ static int __init set_reset_devices(char *str)
__setup("reset_devices", set_reset_devices);
static const char *argv_init[MAX_INIT_ARGS+2] = { "init", NULL, };
-const char *envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, };
+static const char *envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, };
static const char *panic_later, *panic_param;
static bool __init obsolete_checksetup(char *line)
--
2.43.0
next reply other threads:[~2025-11-28 19:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-28 19:16 Sameeksha Sankpal [this message]
2025-11-30 9:38 ` [PATCH] init: mark envp_init as static Mike Rapoport
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=20251128191650.18821-1-sameekshasankpal@gmail.com \
--to=sameekshasankpal@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=brauner@kernel.org \
--cc=chenhuacai@kernel.org \
--cc=francesco@valla.it \
--cc=guoweikang.kernel@gmail.com \
--cc=lillian@star-ark.net \
--cc=link@vivo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@kernel.org \
--cc=rppt@kernel.org \
--cc=tglx@linutronix.de \
/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