lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Fri, 19 Sep 2014 12:52:27 -0700 From: Joe Perches <joe@...ches.com> To: Javier Martinez Canillas <javier.martinez@...labora.co.uk> Cc: Andrew Morton <akpm@...ux-foundation.org>, Alessandro Zummo <a.zummo@...ertech.it>, Doug Anderson <dianders@...omium.org>, Krzysztof Kozlowski <k.kozlowski@...sung.com>, rtc-linux@...glegroups.com, linux-samsung-soc@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org Subject: Re: [PATCH v10 5/6] rtc: max77686: Use ffs() to calculate tm_wday On Fri, 2014-09-19 at 21:27 +0200, Javier Martinez Canillas wrote: > Hello Joe, Hello Javier. > On 09/19/2014 04:39 PM, Joe Perches wrote: > > On Fri, 2014-09-19 at 12:26 +0200, Javier Martinez Canillas wrote: > >> 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. Perhaps you can specify that ffs==fls in the changelog. -- 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