On Tue, 2012-12-18 at 16:30 -0800, Andrew Morton wrote: > On Wed, 28 Nov 2012 15:50:57 +0900 > Jonghwa Lee <jonghwa3....@samsung.com> wrote: > > > Add driver for support max77686 rtc. > > MAX77686 rtc support smpl and wtsr mode. It has two alarm register > > which can be used for alarming to wake system up. This drvier uses regmap > > to access its register. > > > > ... > > > > +static inline int max77686_rtc_calculate_wday(u8 shifted) > > +{ > > + int counter = -1; > > + while (shifted) { > > + shifted >>= 1; > > + counter++; > > + } > > + return counter; > > +} > > We should be able to use log2() in here?
fls(shifted) - 1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/