[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150402134519.GA23123@twins.programming.kicks-ass.net>
Date: Thu, 2 Apr 2015 15:45:19 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, linaro-kernel@...ts.linaro.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] hrtimer: create for_each_active_base() to iterate
over active clock-bases
On Thu, Apr 02, 2015 at 04:21:22PM +0530, Viresh Kumar wrote:
> +#define for_each_active_base(_index, _base, _cpu_base, _active_bases) \
> + for ((_active_bases) = (_cpu_base)->active_bases; \
> + (_index) = ffs(_active_bases), \
> + (_base) = (_cpu_base)->clock_base + (_index) - 1, (_index); \
> + (_active_bases) &= ~(1 << ((_index) - 1)))
Can't use ffs here, some people end up using asm-generic/bitops/ffs.h
and that sucks.
Esp for small vectors like here, the unconditional iteration is faster.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists