kernel/module.c: fix an unused goto label
PATCH 1/1 kernel/module.c: fix an unused goto label
Label 'free_init' is only used when defined(CONFIG_MODULE_UNLOAD) && defined(CONFIG_SMP), so move it inside to shut up gcc.
---
kernel/module.c +1 -1
@@ -2288,8 +2288,8 @@ static noinline struct module *load_module(void __user *umod,ftrace_release (mod->module_core, mod->core_size); free_unload:module_unload_free (mod); - free_init:#if defined(CONFIG_MODULE_UNLOAD ) && defined(CONFIG_SMP ) + free_init:percpu_modfree (mod->refptr);#endif module_free (mod, mod->module_init);
Quoted 5 lines · Américo Wang
Label '
free_init' is only used whendefined(CONFIG_MODULE_UNLOAD)&&defined(CONFIG_SMP), so move it inside to shut up gcc.Signed-off-by WANG Cong <[email protected]>Cc Rusty Russell <[email protected]>
was already sent a week ago - see below.
Ingo
------------->
Quoted 1 line
From
67f5ca081c6ace125e8ccc76b8a7d99b091abaa7Mon Sep 17 00:00:00 2001
From: Dmitri Vorobiev <[email protected]>
Date: Wed, 18 Mar 2009 23:49:26 +0200
Subject: [PATCH] modules: Restrict definition of a label in kernel/module.c
Impact: cleanup
In function 'load_module' in kernel/module.c, the label 'free_init' is used if and only if both CONFIG_MODULE_UNLOAD and CONFIG_SMP are defined. However, the label itself is defined unconditionally, which may produce the following warning:
kernel/module.c:2291: warning: label 'free_init' defined but not used
This patch fixes the warning by moving the label definition under an appropriate preprocessor construct.
--- kernel/module.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/module.c +1 -1
@@ -2288,8 +2288,8 @@ static noinline struct module *load_module(void __user *umod,ftrace_release (mod->module_core, mod->core_size); free_unload:module_unload_free (mod); - free_init:#if defined(CONFIG_MODULE_UNLOAD ) && defined(CONFIG_SMP ) + free_init:percpu_modfree (mod->refptr);#endif module_free (mod, mod->module_init);
Rusty Russell
AppliedQuoted 3 lines · On Wednesday 25 March 2009 02:37:19 Américo Wang wrote:
Label '
free_init' is only used whendefined(CONFIG_MODULE_UNLOAD)&&defined(CONFIG_SMP), so move it inside to shut up gcc.
Thanks, applied!
Rusty.
Quoted 11 lines · Ingo Molnar
Quoted 5 lines · Américo Wang
Label '
free_init' is only used whendefined(CONFIG_MODULE_UNLOAD)&&defined(CONFIG_SMP), so move it inside to shut up gcc.Signed-off-by WANG Cong <[email protected]>Cc Rusty Russell <[email protected]>was already sent a week ago - see below.
Oh, OK then! Thanks for your point! Please ignore my patch. :)
Signature · 1 line
Do what you love, f**k the rest! F**k the regulations!