From: Ingo Molnar Date: Wed, 24 Oct 2012 07:04:41 +0000 (+0200) Subject: numa, sched: Eliminate unused functions X-Git-Tag: next-20121025~31^2~17^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b6fc69b9e76352786cd945ce3175780fffb467f0;p=karo-tx-linux.git numa, sched: Eliminate unused functions Andrew Morton reported these allnoconfig warnings: kernel/sched/fair.c:800: warning: 'task_h_load' declared 'static' but never defined kernel/sched/fair.c:1004: warning: 'account_numa_enqueue' defined but not used These are only used on CONFIG_SMP - fix it. We should eventually resolve the Kconfig complexities here by turning SMP (and NUMA) scheduling either into a separate source code file, or by creating a single-model scheduler, which happens to build to a small object file on !CONFIG_SMP or !CONFIG_NUMA kernels not via #ifdefs but via more clever build time code elimination and zero-size data fields. That's not a simple patch. Reported-by: Andrew Morton Cc: Peter Zijlstra Cc: Andrea Arcangeli Cc: Rik van Riel Link: http://lkml.kernel.org/n/tip-wyctbug9qKulTs0umsxjyixi@git.kernel.org Signed-off-by: Ingo Molnar --- diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index dea3ca6e1c67..41ad4585656e 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -797,7 +797,9 @@ update_stats_curr_start(struct cfs_rq *cfs_rq, struct sched_entity *se) * have. */ +#ifdef CONFIG_SMP static unsigned long task_h_load(struct task_struct *p); +#endif #ifdef CONFIG_SCHED_NUMA static struct list_head *account_numa_enqueue(struct rq *rq, struct task_struct *p) @@ -995,10 +997,12 @@ void task_tick_numa(struct rq *rq, struct task_struct *curr) } } #else +#ifdef CONFIG_SMP static struct list_head *account_numa_enqueue(struct rq *rq, struct task_struct *p) { return NULL; } +#endif static void account_numa_dequeue(struct rq *rq, struct task_struct *p) { @@ -3760,12 +3764,13 @@ static inline void update_shares(int cpu) static inline void update_h_load(long cpu) { } - +#ifdef CONFIG_SMP static unsigned long task_h_load(struct task_struct *p) { return p->se.load.weight; } #endif +#endif /********** Helpers for find_busiest_group ************************/ /*