From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Sender: rtc-linux@googlegroups.com Received: from mail.free-electrons.com (down.free-electrons.com. [37.187.137.238]) by gmr-mx.google.com with ESMTP id s140si1084689wme.1.2016.06.07.08.30.28 for ; Tue, 07 Jun 2016 08:30:28 -0700 (PDT) Date: Tue, 7 Jun 2016 17:30:27 +0200 From: Alexandre Belloni To: David Binderman Cc: kumba@gentoo.org, a.zummo@towertech.it, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, dcb314@hotmail.com Subject: [rtc-linux] Re: linux-4.7-rc2/drivers/rtc/rtc-ds1685.c: 2 * bad if test ? Message-ID: <20160607153027.GK3363@piout.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 In-Reply-To: Reply-To: rtc-linux@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Hi, On 07/06/2016 at 16:18:31 +0100, David Binderman wrote : > Hello there, > > 1. > > linux-4.7-rc2/drivers/rtc/rtc-ds1685.c:392]: (style) Redundant > condition: If '!(mday >= 1)', the comparison 'mday <= 31' is always > true. > > Source code is > > if (!(mday >= 1) && (mday <= 31)) > > Maybe better code > > if (!((mday >= 1) && (mday <= 31))) > > 2. > > linux-4.7-rc2/drivers/rtc/rtc-ds1685.c:464]: (style) Redundant > condition: If '!(mday >= 1)', the comparison 'mday <= 31' is always > true. > See http://git.kernel.org/cgit/linux/kernel/git/abelloni/linux.git/commit/?h=rtc-next&id=c5776dec8f2a90a0aa9e197c2900f68fda8dd978 This should fix that issue. > Duplicate. Also in the same file: > > [drivers/rtc/rtc-ds1685.c:265]: (style) Variable 'ctrlb' is assigned a > value that is never used. > [drivers/rtc/rtc-ds1685.c:812]: (style) Variable 'ctrlc' is assigned a > value that is never used. > Well, feel free to send a patch. Please include the name of the tool you used to find that as I pretty much prefer changes that are tested over cleanup form static analysis tools. -- Alexandre Belloni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.