Messages in this thread | | | Subject | Re: [rtc-linux] [RESEND PATCH] RTC: MAX77686: Add Maxim 77686 driver | From | Joe Perches <> | Date | Tue, 18 Dec 2012 17:00:54 -0800 |
| |
On Tue, 2012-12-18 at 16:30 -0800, Andrew Morton wrote: > On Wed, 28 Nov 2012 15:50:57 +0900 > Jonghwa Lee <jonghwa3.lee@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
| |