public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: David Binderman <linuxdev.baldrick@gmail.com>
Cc: kumba@gentoo.org, a.zummo@towertech.it,
	rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org,
	dcb314@hotmail.com
Subject: Re: linux-4.7-rc2/drivers/rtc/rtc-ds1685.c: 2 * bad if test ?
Date: Tue, 7 Jun 2016 17:30:27 +0200	[thread overview]
Message-ID: <20160607153027.GK3363@piout.net> (raw)
In-Reply-To: <CAMzoamZ64+P0Np6WQj-8JYhCw+zXdG-VQ7g2-q80fSS2cq+xyQ@mail.gmail.com>

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

  reply	other threads:[~2016-06-07 15:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-07 15:18 linux-4.7-rc2/drivers/rtc/rtc-ds1685.c: 2 * bad if test ? David Binderman
2016-06-07 15:30 ` Alexandre Belloni [this message]
2016-06-07 22:12   ` Joshua Kinard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160607153027.GK3363@piout.net \
    --to=alexandre.belloni@free-electrons.com \
    --cc=a.zummo@towertech.it \
    --cc=dcb314@hotmail.com \
    --cc=kumba@gentoo.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxdev.baldrick@gmail.com \
    --cc=rtc-linux@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox