Skip to content

Commit

Permalink
sched/idle: Drop !! while calculating 'broadcast'
Browse files Browse the repository at this point in the history
We don't need 'broadcast' to be set to 'zero or one', but to 'zero or non-zero'
and so the extra operation to convert it to 'zero or one' can be skipped.

Also change type of 'broadcast' to unsigned int, i.e. type of
drv->states[*].flags.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linaro-kernel@lists.linaro.org
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/0dfbe2976aa108c53e08d3477ea90f6360c1f54c.1403584026.git.viresh.kumar@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Viresh Kumar authored and Ingo Molnar committed Jul 5, 2014
1 parent 4036ac1 commit 89abb5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/sched/idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static void cpuidle_idle_call(void)
struct cpuidle_device *dev = __this_cpu_read(cpuidle_devices);
struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev);
int next_state, entered_state;
bool broadcast;
unsigned int broadcast;

/*
* Check if the idle task must be rescheduled. If it is the
Expand Down Expand Up @@ -135,7 +135,7 @@ static void cpuidle_idle_call(void)
goto exit_idle;
}

broadcast = !!(drv->states[next_state].flags & CPUIDLE_FLAG_TIMER_STOP);
broadcast = drv->states[next_state].flags & CPUIDLE_FLAG_TIMER_STOP;

/*
* Tell the time framework to switch to a broadcast timer
Expand Down

0 comments on commit 89abb5a

Please sign in to comment.