From: Greg Kroah-Hartman Date: Sat, 4 Sep 2021 06:26:49 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v5.10.63~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=660dedb9b0548777a856dc4e1537558102ee7be4;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: static_call-fix-unused-variable-warn-w-o-module.patch --- diff --git a/queue-5.10/series b/queue-5.10/series index 6e17ea1b872..bfca5227258 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -6,3 +6,4 @@ ubifs-report-correct-st_size-for-encrypted-symlinks.patch revert-ucounts-increase-ucounts-reference-counter-before-the-security-hook.patch revert-cred-add-missing-return-error-code-when-set_cred_ucounts-failed.patch revert-add-a-reference-to-ucounts-for-each-cred.patch +static_call-fix-unused-variable-warn-w-o-module.patch diff --git a/queue-5.10/static_call-fix-unused-variable-warn-w-o-module.patch b/queue-5.10/static_call-fix-unused-variable-warn-w-o-module.patch new file mode 100644 index 00000000000..d7f1f6b7eac --- /dev/null +++ b/queue-5.10/static_call-fix-unused-variable-warn-w-o-module.patch @@ -0,0 +1,59 @@ +From 7d95f22798ecea513f37b792b39fec4bcf20fec3 Mon Sep 17 00:00:00 2001 +From: Matthieu Baerts +Date: Fri, 26 Mar 2021 11:50:23 +0100 +Subject: static_call: Fix unused variable warn w/o MODULE +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Matthieu Baerts + +commit 7d95f22798ecea513f37b792b39fec4bcf20fec3 upstream. + +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 +Signed-off-by: Peter Zijlstra (Intel) +Link: https://lkml.kernel.org/r/20210326105023.2058860-1-matthieu.baerts@tessares.net +Signed-off-by: Greg Kroah-Hartman +--- + kernel/static_call.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/kernel/static_call.c ++++ b/kernel/static_call.c +@@ -165,13 +165,13 @@ void __static_call_update(struct static_ + + 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++) {