Thread (12 messages) flat view 12 messages, 3 authors, 2014-09-20

[PATCH v10 5/6] rtc: max77686: Use ffs() to calculate tm_wday

From: Javier Martinez Canillas <hidden>
Date: 2014-09-19 21:44:35
Also in: linux-samsung-soc, lkml

Hello Joe,

On 09/19/2014 09:52 PM, Joe Perches wrote:
On Fri, 2014-09-19 at 21:27 +0200, Javier Martinez Canillas wrote:
quoted
On 09/19/2014 04:39 PM, Joe Perches wrote:
quoted
On Fri, 2014-09-19 at 12:26 +0200, Javier Martinez Canillas wrote:
quoted
The function max77686_rtc_calculate_wday() is used to
calculate the day of the week to be filled in struct
rtc_time but that function only calculates the number
of bits shifted. So the ffs() function can be used to
find the first bit set instead of a special function.
This isn't the same logic.  Perhaps you want fls.
Right, the removed function has the same logic than fls() - 1 but the value
stored in data[RTC_WEEKDAY] is:

data[RTC_WEEKDAY] = 1 << tm->tm_wday;

so for this particular case, it doesn't matter since ffs() == fls() always.
I didn't look that far.

I just wanted to show that the logic wasn't the same.
No worries, thanks a lot for your feedback. Probably it would had been good to
mention that in the commit message.
Perhaps you can specify that ffs==fls in the changelog.
I won't say I'm thrilled to do a whole re-spin of the series just to change
that ;)

Specially since I already did too many revisions and this series have been
floating around for months but is up to Andrew to decide if is worth it.

Best regards,
Javier
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help