[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210422003334.139452-1-linux@roeck-us.net>
Date: Wed, 21 Apr 2021 17:33:34 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>,
Jason Baron <jbaron@...mai.com>,
Steven Rostedt <rostedt@...dmis.org>,
Ard Biesheuvel <ardb@...nel.org>, linux-kernel@...r.kernel.org,
Guenter Roeck <linux@...ck-us.net>
Subject: [PATCH] static_call: Fix unused variable warning
If CONFIG_MODULES=n, the following build warning is reported.
kernel/static_call.c: In function ‘__static_call_update’:
kernel/static_call.c:153:18: warning: unused variable ‘mod’
Mark the variable as __maybe_unused to fix the problem.
Fixes: 9183c3f9ed71 ("static_call: Add inline static call infrastructure")
Reported-by: Zach Reizner <zachr@...gle.com>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>
Signed-off-by: Guenter Roeck <linux@...ck-us.net>
---
kernel/static_call.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/static_call.c b/kernel/static_call.c
index 2c5950b0b90e..8211a34251f8 100644
--- a/kernel/static_call.c
+++ b/kernel/static_call.c
@@ -150,7 +150,7 @@ void __static_call_update(struct static_call_key *key, void *tramp, void *func)
for (site_mod = &first; site_mod; site_mod = site_mod->next) {
bool init = system_state < SYSTEM_RUNNING;
- struct module *mod = site_mod->mod;
+ struct module __maybe_unused *mod = site_mod->mod;
if (!site_mod->sites) {
/*
--
2.17.1
Powered by blists - more mailing lists