lkml.org 
[lkml]   [2008]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Latest Linus git: kernel/s ched.c:1216: warning: ‘init hrtick ’ defined but not used

* Kevin Winchester <kjwinchester@gmail.com> wrote:

> Hi Ingo,
>
> I got the above warning in my latest build. I assume it is because
> init_hrtick() is only called from CONFIG_SMP sched_init_smp(), and I
> have a HRT-enabled UP box.
>
> I could write up the simple patch to put #ifdef CONFIG_SMP around
> init_hrtick(), but with all of the #ifdefs in that file, I figure it
> is probably a little more complicated than that.

the fix seems simple - see below. The #ifdef jungle ... less so.

Ingo

--------------->
Subject: sched: fix defined-but-unused warning
From: Rabin Vincent <rabin@rab.in>
Date: Sun, 11 May 2008 05:55:33 +0530

Fix this warning, which appears with !CONFIG_SMP:
kernel/sched.c:1216: warning: `init_hrtick' defined but not used

Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
kernel/sched.c | 2 ++
1 file changed, 2 insertions(+)

Index: linux/kernel/sched.c
===================================================================
--- linux.orig/kernel/sched.c
+++ linux/kernel/sched.c
@@ -1130,6 +1130,7 @@ static enum hrtimer_restart hrtick(struc
return HRTIMER_NORESTART;
}

+#ifdef CONFIG_SMP
static void hotplug_hrtick_disable(int cpu)
{
struct rq *rq = cpu_rq(cpu);
@@ -1185,6 +1186,7 @@ static void init_hrtick(void)
{
hotcpu_notifier(hotplug_hrtick, 0);
}
+#endif /* CONFIG_SMP */

static void init_rq_hrtick(struct rq *rq)
{

\
 
 \ /
  Last update: 2008-05-13 15:27    [W:1.051 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site