| From bcbacb50dc24d6f7af4e59758c82961070265f62 Mon Sep 17 00:00:00 2001 |
| From: Guenter Roeck <linux@roeck-us.net> |
| Date: Wed, 21 Apr 2021 17:33:34 -0700 |
| Subject: [PATCH] FROMLIST: static_call: Fix unused variable warning |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| 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@google.com> |
| Cc: Josh Poimboeuf <jpoimboe@redhat.com> |
| Signed-off-by: Guenter Roeck <linux@roeck-us.net> |
| (am from https://lore.kernel.org/patchwork/patch/1416760/) |
| (also found at https://lore.kernel.org/r/20210422003334.139452-1-linux@roeck-us.net) |
| |
| BUG=b:186055176 |
| TEST=Build chromiumos-container-vm-x86_64_defconfig |
| |
| Change-Id: Id4ec2a1f91c6e442b483b5af3642d0440d7acd80 |
| Disallow-Recycled-Builds: test-failures |
| Signed-off-by: Guenter Roeck <groeck@chromium.org> |
| Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2845280 |
| Reviewed-by: Tomasz Jeznach <tjeznach@chromium.org> |
| Reviewed-by: Sean Paul <seanpaul@chromium.org> |
| Reviewed-by: Zach Reizner <zachr@chromium.org> |
| --- |
| kernel/static_call_inline.c | 2 +- |
| 1 file changed, 1 insertion(+), 1 deletion(-) |
| |
| diff --git a/kernel/static_call_inline.c b/kernel/static_call_inline.c |
| index dc5665b628140ee9b0a841011a4ae495d2c9eee8..060662c860e63ca28dd3c423b13d193e2f0136fc 100644 |
| --- a/kernel/static_call_inline.c |
| +++ b/kernel/static_call_inline.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.38.1.584.g0f3c55d4c2-goog |
| |