Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1416310

linux-4.7-rc2/drivers/rtc/rtc-ds1685.c: 2 * bad if test ?

From David Binderman <linuxdev.baldrick@gmail.com>
Newsgroups linux.kernel
Subject linux-4.7-rc2/drivers/rtc/rtc-ds1685.c: 2 * bad if test ?
Date 2016-06-07 17:20 +0200
Message-ID <rHqXo-4lt-55@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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.

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.


Regards

David Binderman

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

linux-4.7-rc2/drivers/rtc/rtc-ds1685.c: 2 * bad if test ? David Binderman <linuxdev.baldrick@gmail.com> - 2016-06-07 17:20 +0200
  Re: linux-4.7-rc2/drivers/rtc/rtc-ds1685.c: 2 * bad if test ? Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2016-06-07 17:40 +0200
    Re: linux-4.7-rc2/drivers/rtc/rtc-ds1685.c: 2 * bad if test ? Joshua Kinard <kumba@gentoo.org> - 2016-06-08 00:30 +0200

csiph-web