Re: [PATCH v2 1/1] rtc: ds1685: correct check of day of month

2016-06-04 Thread Alexandre Belloni
On 22/05/2016 at 00:18:55 +0200, Heinrich Schuchardt wrote : > The day of month is checked in ds1685_rtc_read_alarm > and ds1685_rtc_set_alarm. > > Multiple errors exist in the day of month check. > > Operator ! has a higher priority than &&. > (!(mday >= 1) && (mday <= 31)) is false for mday ==

[PATCH v2 1/1] rtc: ds1685: correct check of day of month

2016-05-21 Thread Heinrich Schuchardt
The day of month is checked in ds1685_rtc_read_alarm and ds1685_rtc_set_alarm. Multiple errors exist in the day of month check. Operator ! has a higher priority than &&. (!(mday >= 1) && (mday <= 31)) is false for mday == 32. When verifying the day of month the binary and the BCD mode have to be