add an ifdef in sched.c
PATCH 1/1 add an ifdef in sched.c
hi
I have found that in sched.c. the macro for_each_domain only useful for the config
that has CONFIG_SMP defined. so i add an ifdef in sched.c.
below is the patch
kernel/sched.c 2004-11-04 16:34:55.000000000 +0800 renamed from kernel/sched.c 2004-10-23 05:40:05.000000000 +0800 +3 -1
@@ -281,8 +281,10 @@ static DEFINE_PER_CPU(struct runqueue, runqueues); -#define for_each_domain(cpu, domain) \ +#ifdef CONFIG_SMP +# define for_each_domain(cpu, domain) \ for (domain = cpu_rq(cpu)->sd; domain; domain = domain->parent) +#endif #define cpu_rq(cpu) (&per_cpu(runqueues, (cpu))) #define this_rq() (&__get_cpu_var(runqueues))
thanks for reading.
Signature · 1 line
Yours andyliu
kernel/sched.c 2004-11-04 16:34:55.000000000 +0800 line 287
Quoted 5 lines · andyliu
kernel/sched.c 2004-11-04 16:34:55.000000000 +0800 renamed from kernel/sched.c 2004-10-23 05:40:05.000000000 +0800 +3
-1-#define for_each_domain(cpu, domain) \ +#ifdef CONFIG_SMP +# define for_each_domain(cpu, domain) \ for (domain = cpu_rq(cpu)->sd; domain; domain = domain->parent) +#endif
why? A macro hanging around does not cause any bigger code - and the #ifdef certainly makes the code less readable.
Ingo