From: Peter Zijlstra <peterz@infradead.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Guenter Roeck <linux@roeck-us.net>,
Josh Poimboeuf <jpoimboe@redhat.com>,
Jason Baron <jbaron@akamai.com>, Ard Biesheuvel <ardb@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] static_call: Fix unused variable warning
Date: Thu, 22 Apr 2021 09:20:13 +0200 [thread overview]
Message-ID: <YIEjrb7uO1KLgf3y@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20210421204139.669f5c22@oasis.local.home>
On Wed, Apr 21, 2021 at 08:41:39PM -0400, Steven Rostedt wrote:
>
> Second patch with the exact same update. Perhaps we should take one
> before we get more of them ;-)
>
I thought we already fixed that...
---
commit 7d95f22798ecea513f37b792b39fec4bcf20fec3
Author: Matthieu Baerts <matthieu.baerts@tessares.net>
Date: Fri Mar 26 11:50:23 2021 +0100
static_call: Fix unused variable warn w/o MODULE
Here is the warning converted as error and reported by GCC:
kernel/static_call.c: In function ‘__static_call_update’:
kernel/static_call.c:153:18: error: unused variable ‘mod’ [-Werror=unused-variable]
153 | struct module *mod = site_mod->mod;
| ^~~
cc1: all warnings being treated as errors
make[1]: *** [scripts/Makefile.build:271: kernel/static_call.o] Error 1
This is simply because since recently, we no longer use 'mod' variable
elsewhere if MODULE is unset.
When using 'make tinyconfig' to generate the default kconfig, MODULE is
unset.
There are different ways to fix this warning. Here I tried to minimised
the number of modified lines and not add more #ifdef. We could also move
the declaration of the 'mod' variable inside the if-statement or
directly use site_mod->mod.
Fixes: 698bacefe993 ("static_call: Align static_call_is_init() patching condition")
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210326105023.2058860-1-matthieu.baerts@tessares.net
diff --git a/kernel/static_call.c b/kernel/static_call.c
index 2c5950b0b90e..723fcc9d20db 100644
--- a/kernel/static_call.c
+++ b/kernel/static_call.c
@@ -165,13 +165,13 @@ void __static_call_update(struct static_call_key *key, void *tramp, void *func)
stop = __stop_static_call_sites;
-#ifdef CONFIG_MODULES
if (mod) {
+#ifdef CONFIG_MODULES
stop = mod->static_call_sites +
mod->num_static_call_sites;
init = mod->state == MODULE_STATE_COMING;
- }
#endif
+ }
for (site = site_mod->sites;
site < stop && static_call_key(site) == key; site++) {
next prev parent reply other threads:[~2021-04-22 7:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-22 0:33 [PATCH] static_call: Fix unused variable warning Guenter Roeck
2021-04-22 0:41 ` Steven Rostedt
2021-04-22 1:24 ` Guenter Roeck
2021-04-22 1:33 ` Steven Rostedt
2021-04-22 1:45 ` Guenter Roeck
2021-04-22 2:38 ` Steven Rostedt
2021-04-22 7:20 ` Peter Zijlstra [this message]
2021-04-22 14:01 ` Guenter Roeck
2021-04-22 16:13 ` Peter Zijlstra
2021-04-22 18:01 ` Guenter Roeck
-- strict thread matches above, loose matches on Subject: below --
2021-04-16 19:43 [PATCH] static_call: fix " Carlos Llamas
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=YIEjrb7uO1KLgf3y@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=ardb@kernel.org \
--cc=jbaron@akamai.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=rostedt@goodmis.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;
as well as URLs for NNTP newsgroup(s).