public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched/idle: Drop !! while calculating 'broadcast'
@ 2014-06-24  4:31 Viresh Kumar
  2014-06-24  8:03 ` Peter Zijlstra
  2014-07-05 10:43 ` [tip:sched/core] sched/idle: Drop !! while calculating 'broadcast ' tip-bot for Viresh Kumar
  0 siblings, 2 replies; 6+ messages in thread
From: Viresh Kumar @ 2014-06-24  4:31 UTC (permalink / raw)
  To: mingo, peterz; +Cc: linux-kernel, linaro-kernel, Viresh Kumar

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>
---
Rebased over: 3.16-rc2.

 kernel/sched/idle.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
index cf009fb..9f1608f 100644
--- a/kernel/sched/idle.c
+++ b/kernel/sched/idle.c
@@ -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
@@ -135,7 +135,7 @@ use_default:
 		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
-- 
2.0.0.rc2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-07-05 10:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-24  4:31 [PATCH] sched/idle: Drop !! while calculating 'broadcast' Viresh Kumar
2014-06-24  8:03 ` Peter Zijlstra
2014-06-24 10:48   ` Viresh Kumar
2014-06-24 12:18   ` Mike Galbraith
2014-06-24 12:35     ` Viresh Kumar
2014-07-05 10:43 ` [tip:sched/core] sched/idle: Drop !! while calculating 'broadcast ' tip-bot for Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox