Commit 202530e8 authored by Linus Torvalds's avatar Linus Torvalds

Use '#ifdef' instead of '#if' to test CONFIG_xxxx variables. It works

both ways, but anal compilers will warn about using identifiers that
have never been defined in preprocessor expression statements.
parent 1eb0a9ec
...@@ -79,7 +79,7 @@ typedef struct { ...@@ -79,7 +79,7 @@ typedef struct {
#define nmi_enter() (irq_enter()) #define nmi_enter() (irq_enter())
#define nmi_exit() (preempt_count() -= HARDIRQ_OFFSET) #define nmi_exit() (preempt_count() -= HARDIRQ_OFFSET)
#if CONFIG_PREEMPT #ifdef CONFIG_PREEMPT
# define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked()) # define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
#else #else
......
...@@ -778,7 +778,7 @@ static inline void double_rq_unlock(runqueue_t *rq1, runqueue_t *rq2) ...@@ -778,7 +778,7 @@ static inline void double_rq_unlock(runqueue_t *rq1, runqueue_t *rq2)
spin_unlock(&rq2->lock); spin_unlock(&rq2->lock);
} }
#if CONFIG_NUMA #ifdef CONFIG_NUMA
/* /*
* If dest_cpu is allowed for this process, migrate the task to it. * If dest_cpu is allowed for this process, migrate the task to it.
* This is accomplished by forcing the cpu_allowed mask to only * This is accomplished by forcing the cpu_allowed mask to only
...@@ -1104,7 +1104,7 @@ static void load_balance(runqueue_t *this_rq, int idle, unsigned long cpumask) ...@@ -1104,7 +1104,7 @@ static void load_balance(runqueue_t *this_rq, int idle, unsigned long cpumask)
#define IDLE_NODE_REBALANCE_TICK (IDLE_REBALANCE_TICK * 5) #define IDLE_NODE_REBALANCE_TICK (IDLE_REBALANCE_TICK * 5)
#define BUSY_NODE_REBALANCE_TICK (BUSY_REBALANCE_TICK * 100) #define BUSY_NODE_REBALANCE_TICK (BUSY_REBALANCE_TICK * 100)
#if CONFIG_NUMA #ifdef CONFIG_NUMA
static void balance_node(runqueue_t *this_rq, int idle, int this_cpu) static void balance_node(runqueue_t *this_rq, int idle, int this_cpu)
{ {
int node = find_busiest_node(cpu_to_node(this_cpu)); int node = find_busiest_node(cpu_to_node(this_cpu));
...@@ -1121,7 +1121,7 @@ static void balance_node(runqueue_t *this_rq, int idle, int this_cpu) ...@@ -1121,7 +1121,7 @@ static void balance_node(runqueue_t *this_rq, int idle, int this_cpu)
static void rebalance_tick(runqueue_t *this_rq, int idle) static void rebalance_tick(runqueue_t *this_rq, int idle)
{ {
#if CONFIG_NUMA #ifdef CONFIG_NUMA
int this_cpu = smp_processor_id(); int this_cpu = smp_processor_id();
#endif #endif
unsigned long j = jiffies; unsigned long j = jiffies;
...@@ -1135,7 +1135,7 @@ static void rebalance_tick(runqueue_t *this_rq, int idle) ...@@ -1135,7 +1135,7 @@ static void rebalance_tick(runqueue_t *this_rq, int idle)
* are not balanced.) * are not balanced.)
*/ */
if (idle) { if (idle) {
#if CONFIG_NUMA #ifdef CONFIG_NUMA
if (!(j % IDLE_NODE_REBALANCE_TICK)) if (!(j % IDLE_NODE_REBALANCE_TICK))
balance_node(this_rq, idle, this_cpu); balance_node(this_rq, idle, this_cpu);
#endif #endif
...@@ -1146,7 +1146,7 @@ static void rebalance_tick(runqueue_t *this_rq, int idle) ...@@ -1146,7 +1146,7 @@ static void rebalance_tick(runqueue_t *this_rq, int idle)
} }
return; return;
} }
#if CONFIG_NUMA #ifdef CONFIG_NUMA
if (!(j % BUSY_NODE_REBALANCE_TICK)) if (!(j % BUSY_NODE_REBALANCE_TICK))
balance_node(this_rq, idle, this_cpu); balance_node(this_rq, idle, this_cpu);
#endif #endif
...@@ -2268,7 +2268,7 @@ void __init init_idle(task_t *idle, int cpu) ...@@ -2268,7 +2268,7 @@ void __init init_idle(task_t *idle, int cpu)
local_irq_restore(flags); local_irq_restore(flags);
/* Set the preempt count _outside_ the spinlocks! */ /* Set the preempt count _outside_ the spinlocks! */
#if CONFIG_PREEMPT #ifdef CONFIG_PREEMPT
idle->thread_info->preempt_count = (idle->lock_depth >= 0); idle->thread_info->preempt_count = (idle->lock_depth >= 0);
#else #else
idle->thread_info->preempt_count = 0; idle->thread_info->preempt_count = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment