[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201015191135.471249-4-alexandre.belloni@bootlin.com>
Date: Thu, 15 Oct 2020 21:11:33 +0200
From: Alexandre Belloni <alexandre.belloni@...tlin.com>
To: Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc: Dan Carpenter <dan.carpenter@...cle.com>,
linux-rtc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 4/6] rtc: r9701: stop setting RWKCNT
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@...cle.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@...tlin.com>
---
Cc: Dan Carpenter <dan.carpenter@...cle.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
Powered by blists - more mailing lists