At several instances we iterate over all possible clock-bases for a particular cpu-base. Whereas, we only need to iterate over active bases.
We already have per cpu-base 'active_bases' field which is updated on addition/removal of hrtimers.
To prepare for this, first patch updates '->active_bases' before calling hrtimer_force_reprogram(), otherwise kernel will throw NULL pointer dereference errors and will crash.
Second patch creates for_each_active_base() and converts other routines to use it.
git://git.linaro.org/people/viresh.kumar/linux.git cleanup-hrtimer-for-each-active
V1->V2: - Added reviewed-by's from Preeti - Merged 1/3 and 3/3 to form 2/2 as suggested by Frederic - Added a coverletter as well..
Viresh Kumar (2): hrtimer: update '->active_bases' before calling hrtimer_force_reprogram() hrtimer: create for_each_active_base() to iterate over active clock-bases
kernel/hrtimer.c | 74 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 36 deletions(-)