linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched: Fix a build warning when CONFIG_SMP=n
@ 2013-03-07  2:00 Li Zefan
  2013-03-11 10:03 ` [tip:sched/core] sched: Fix update_group_power() prototype placement to fix build warning when !CONFIG_SMP tip-bot for Li Zefan
  0 siblings, 1 reply; 2+ messages in thread
From: Li Zefan @ 2013-03-07  2:00 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Peter Zijlstra, Fengguang Wu, LKML

All warnings:

   In file included from kernel/sched/core.c:85:0:
   kernel/sched/sched.h:1036:39: warning: 'struct sched_domain' declared inside parameter list
   kernel/sched/sched.h:1036:39: warning: its scope is only this
   definition or declaration, which is probably not what you want

It's because struct sched_domain is defined inside #if CONFIG_SMP, while
update_group_power() is declared unconditionally.

Fix this warning by declaring update_group_power() only if CONFIG_SMP=n.

Build tested with CONFIG_SMP enabled and then disabled.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Li Zefan <lizefan@huawei.com>
---
 kernel/sched/sched.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 30bebb9..3bd15a4 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1026,6 +1026,8 @@ extern const struct sched_class idle_sched_class;
 
 #ifdef CONFIG_SMP
 
+extern void update_group_power(struct sched_domain *sd, int cpu);
+
 extern void trigger_load_balance(struct rq *rq, int cpu);
 extern void idle_balance(int this_cpu, struct rq *this_rq);
 
@@ -1040,7 +1042,6 @@ static inline void idle_balance(int cpu, struct rq *rq)
 extern void sysrq_sched_debug_show(void);
 extern void sched_init_granularity(void);
 extern void update_max_interval(void);
-extern void update_group_power(struct sched_domain *sd, int cpu);
 extern int update_runtime(struct notifier_block *nfb, unsigned long action, void *hcpu);
 extern void init_sched_rt_class(void);
 extern void init_sched_fair_class(void);
-- 
1.8.0.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip:sched/core] sched: Fix update_group_power() prototype placement to fix build warning when !CONFIG_SMP
  2013-03-07  2:00 [PATCH] sched: Fix a build warning when CONFIG_SMP=n Li Zefan
@ 2013-03-11 10:03 ` tip-bot for Li Zefan
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Li Zefan @ 2013-03-11 10:03 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, peterz, tglx, fengguang.wu, lizefan

Commit-ID:  b719203b846284e77f5c50fca04b458b6484aeae
Gitweb:     http://git.kernel.org/tip/b719203b846284e77f5c50fca04b458b6484aeae
Author:     Li Zefan <lizefan@huawei.com>
AuthorDate: Thu, 7 Mar 2013 10:00:26 +0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 11 Mar 2013 09:07:24 +0100

sched: Fix update_group_power() prototype placement to fix build warning when !CONFIG_SMP

All warnings:

   In file included from kernel/sched/core.c:85:0:
   kernel/sched/sched.h:1036:39: warning: 'struct sched_domain' declared inside parameter list
   kernel/sched/sched.h:1036:39: warning: its scope is only this definition or declaration, which is probably not what you want

It's because struct sched_domain is defined inside #if CONFIG_SMP,
while update_group_power() is declared unconditionally.

Fix this warning by declaring update_group_power() only if
CONFIG_SMP=n.

Build tested with CONFIG_SMP enabled and then disabled.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Li Zefan <lizefan@huawei.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/5137F4BA.2060101@huawei.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/sched/sched.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 30bebb9..3bd15a4 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1026,6 +1026,8 @@ extern const struct sched_class idle_sched_class;
 
 #ifdef CONFIG_SMP
 
+extern void update_group_power(struct sched_domain *sd, int cpu);
+
 extern void trigger_load_balance(struct rq *rq, int cpu);
 extern void idle_balance(int this_cpu, struct rq *this_rq);
 
@@ -1040,7 +1042,6 @@ static inline void idle_balance(int cpu, struct rq *rq)
 extern void sysrq_sched_debug_show(void);
 extern void sched_init_granularity(void);
 extern void update_max_interval(void);
-extern void update_group_power(struct sched_domain *sd, int cpu);
 extern int update_runtime(struct notifier_block *nfb, unsigned long action, void *hcpu);
 extern void init_sched_rt_class(void);
 extern void init_sched_fair_class(void);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-03-11 10:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-07  2:00 [PATCH] sched: Fix a build warning when CONFIG_SMP=n Li Zefan
2013-03-11 10:03 ` [tip:sched/core] sched: Fix update_group_power() prototype placement to fix build warning when !CONFIG_SMP tip-bot for Li Zefan

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).