diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-08-31 22:23:29 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-09-23 12:15:27 -0400 |
commit | 289828e62de0334a0d01c0f65df91cd47d3a9e05 (patch) | |
tree | 8bda5b11aa9e8bfcd2e176b7e12b365bfa7b79fe | |
parent | c9d4b0af9e0609cc525c55de18229fde7c926d61 (diff) |
rcu: Silence unused-variable warnings
The "idle" variable in both rcu_eqs_enter_common() and
rcu_eqs_exit_common() is only used in a WARN_ON_ONCE(). If the kernel
is built disabling WARN_ON_ONCE(), the compiler will complain (rightly)
that "idle" is unused. This commit therefore adds a __maybe_unused to
the declaration of both variables.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rw-r--r-- | kernel/rcutree.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c index 8eb9cfd9e2b1..e6f2e8f14140 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c | |||
@@ -371,7 +371,8 @@ static void rcu_eqs_enter_common(struct rcu_dynticks *rdtp, long long oldval, | |||
371 | { | 371 | { |
372 | trace_rcu_dyntick(TPS("Start"), oldval, rdtp->dynticks_nesting); | 372 | trace_rcu_dyntick(TPS("Start"), oldval, rdtp->dynticks_nesting); |
373 | if (!user && !is_idle_task(current)) { | 373 | if (!user && !is_idle_task(current)) { |
374 | struct task_struct *idle = idle_task(smp_processor_id()); | 374 | struct task_struct *idle __maybe_unused = |
375 | idle_task(smp_processor_id()); | ||
375 | 376 | ||
376 | trace_rcu_dyntick(TPS("Error on entry: not idle task"), oldval, 0); | 377 | trace_rcu_dyntick(TPS("Error on entry: not idle task"), oldval, 0); |
377 | ftrace_dump(DUMP_ORIG); | 378 | ftrace_dump(DUMP_ORIG); |
@@ -508,7 +509,8 @@ static void rcu_eqs_exit_common(struct rcu_dynticks *rdtp, long long oldval, | |||
508 | rcu_cleanup_after_idle(smp_processor_id()); | 509 | rcu_cleanup_after_idle(smp_processor_id()); |
509 | trace_rcu_dyntick(TPS("End"), oldval, rdtp->dynticks_nesting); | 510 | trace_rcu_dyntick(TPS("End"), oldval, rdtp->dynticks_nesting); |
510 | if (!user && !is_idle_task(current)) { | 511 | if (!user && !is_idle_task(current)) { |
511 | struct task_struct *idle = idle_task(smp_processor_id()); | 512 | struct task_struct *idle __maybe_unused = |
513 | idle_task(smp_processor_id()); | ||
512 | 514 | ||
513 | trace_rcu_dyntick(TPS("Error on exit: not idle task"), | 515 | trace_rcu_dyntick(TPS("Error on exit: not idle task"), |
514 | oldval, rdtp->dynticks_nesting); | 516 | oldval, rdtp->dynticks_nesting); |