* [Patch] kernel/module.c: fix an unused goto label
@ 2009-03-24 16:07 Américo Wang
2009-03-24 19:26 ` Ingo Molnar
2009-03-25 1:05 ` Rusty Russell
0 siblings, 2 replies; 4+ messages in thread
From: Américo Wang @ 2009-03-24 16:07 UTC (permalink / raw)
To: LKML; +Cc: Rusty Russell, Andrew Morton
Label 'free_init' is only used when defined(CONFIG_MODULE_UNLOAD) &&
defined(CONFIG_SMP), so move it inside to shut up gcc.
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
---
diff --git a/kernel/module.c b/kernel/module.c
index 1196f5d..df00a1b 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -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);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Patch] kernel/module.c: fix an unused goto label
2009-03-24 16:07 [Patch] kernel/module.c: fix an unused goto label Américo Wang
@ 2009-03-24 19:26 ` Ingo Molnar
2009-03-29 16:41 ` Américo Wang
2009-03-25 1:05 ` Rusty Russell
1 sibling, 1 reply; 4+ messages in thread
From: Ingo Molnar @ 2009-03-24 19:26 UTC (permalink / raw)
To: Américo Wang; +Cc: LKML, Rusty Russell, Andrew Morton
* Américo Wang <xiyou.wangcong@gmail.com> wrote:
> Label 'free_init' is only used when defined(CONFIG_MODULE_UNLOAD) &&
> defined(CONFIG_SMP), so move it inside to shut up gcc.
>
> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
> Cc: Rusty Russell <rusty@rustcorp.com.au>
was already sent a week ago - see below.
Ingo
------------->
>From 67f5ca081c6ace125e8ccc76b8a7d99b091abaa7 Mon Sep 17 00:00:00 2001
From: Dmitri Vorobiev <dmitri.vorobiev@movial.com>
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.
Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.com>
Cc: akpm@linux-foundation.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
kernel/module.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/module.c b/kernel/module.c
index 1196f5d..df00a1b 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -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);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Patch] kernel/module.c: fix an unused goto label
2009-03-24 16:07 [Patch] kernel/module.c: fix an unused goto label Américo Wang
2009-03-24 19:26 ` Ingo Molnar
@ 2009-03-25 1:05 ` Rusty Russell
1 sibling, 0 replies; 4+ messages in thread
From: Rusty Russell @ 2009-03-25 1:05 UTC (permalink / raw)
To: Américo Wang; +Cc: LKML, Andrew Morton
On Wednesday 25 March 2009 02:37:19 Américo Wang wrote:
>
> Label 'free_init' is only used when defined(CONFIG_MODULE_UNLOAD) &&
> defined(CONFIG_SMP), so move it inside to shut up gcc.
Thanks, applied!
Rusty.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch] kernel/module.c: fix an unused goto label
2009-03-24 19:26 ` Ingo Molnar
@ 2009-03-29 16:41 ` Américo Wang
0 siblings, 0 replies; 4+ messages in thread
From: Américo Wang @ 2009-03-29 16:41 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Américo Wang, LKML, Rusty Russell, Andrew Morton
On Tue, Mar 24, 2009 at 08:26:47PM +0100, Ingo Molnar wrote:
>
>* Américo Wang <xiyou.wangcong@gmail.com> wrote:
>
>> Label 'free_init' is only used when defined(CONFIG_MODULE_UNLOAD) &&
>> defined(CONFIG_SMP), so move it inside to shut up gcc.
>>
>> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
>> Cc: Rusty Russell <rusty@rustcorp.com.au>
>
>was already sent a week ago - see below.
>
Oh, OK then! Thanks for your point! Please ignore my patch. :)
--
Do what you love, f**k the rest! F**k the regulations!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-03-29 16:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-24 16:07 [Patch] kernel/module.c: fix an unused goto label Américo Wang
2009-03-24 19:26 ` Ingo Molnar
2009-03-29 16:41 ` Américo Wang
2009-03-25 1:05 ` Rusty Russell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox