mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 4/6] rtc: r9701: stop setting RWKCNT
Date: Thu, 15 Oct 2020 21:11:33 +0200	[thread overview]
Message-ID: <20201015191135.471249-4-alexandre.belloni@bootlin.com> (raw)
In-Reply-To: <20201015191135.471249-1-alexandre.belloni@bootlin.com>

tm_wday is never checked for validity and it is not read back in
r9701_get_datetime. Avoid setting it to stop tripping static checkers:

        drivers/rtc/rtc-r9701.c:109 r9701_set_datetime()
        error: undefined (user controlled) shift '1 << dt->tm_wday'

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
Cc: Dan Carpenter <dan.carpenter@oracle.com>

 drivers/rtc/rtc-r9701.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/rtc/rtc-r9701.c b/drivers/rtc/rtc-r9701.c
index 4b688e9c4192..183c5a0fe78c 100644
--- a/drivers/rtc/rtc-r9701.c
+++ b/drivers/rtc/rtc-r9701.c
@@ -100,7 +100,6 @@ static int r9701_set_datetime(struct device *dev, struct rtc_time *dt)
 	ret = ret ? ret : write_reg(dev, RDAYCNT, bin2bcd(dt->tm_mday));
 	ret = ret ? ret : write_reg(dev, RMONCNT, bin2bcd(dt->tm_mon + 1));
 	ret = ret ? ret : write_reg(dev, RYRCNT, bin2bcd(dt->tm_year - 100));
-	ret = ret ? ret : write_reg(dev, RWKCNT, 1 << dt->tm_wday);
 
 	return ret;
 }
-- 
2.26.2


  parent reply	other threads:[~2020-10-15 19:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15 19:11 [PATCH 1/6] rtc: r9701: remove leftover comment Alexandre Belloni
2020-10-15 19:11 ` [PATCH 2/6] rtc: r9701: stop setting a default time Alexandre Belloni
2020-10-15 19:11 ` [PATCH 3/6] rtc: r9701: remove useless memset Alexandre Belloni
2020-10-15 19:11 ` Alexandre Belloni [this message]
2020-10-15 19:11 ` [PATCH 5/6] rtc: r9701: convert to devm_rtc_allocate_device Alexandre Belloni
2020-10-15 19:11 ` [PATCH 6/6] rtc: r9701: set range Alexandre Belloni

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=20201015191135.471249-4-alexandre.belloni@bootlin.com \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®