From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750967AbcFDNrA (ORCPT ); Sat, 4 Jun 2016 09:47:00 -0400 Received: from down.free-electrons.com ([37.187.137.238]:49338 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750838AbcFDNq6 (ORCPT ); Sat, 4 Jun 2016 09:46:58 -0400 Date: Sat, 4 Jun 2016 15:46:55 +0200 From: Alexandre Belloni To: Heinrich Schuchardt Cc: Joshua Kinard , Alessandro Zummo , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/1] rtc: ds1685: correct check of day of month Message-ID: <20160604134655.GJ4594@piout.net> References: <20160520223829.GA4963@piout.net> <1463869135-32575-1-git-send-email-xypron.glpk@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1463869135-32575-1-git-send-email-xypron.glpk@gmx.de> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 == 32. > > When verifying the day of month the binary and the BCD mode > have to be considered. > > v2: > consider ds1685_rtc_read_alarm > consider rtc->bcd_mode as indicated by Alexandre Belloni > > Signed-off-by: Heinrich Schuchardt > --- > drivers/rtc/rtc-ds1685.c | 34 +++++++++++++++++++++++++++++----- > 1 file changed, 29 insertions(+), 5 deletions(-) > Applied, thanks. -- Alexandre Belloni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com