Thread (3 messages) 3 messages, 3 authors, 2021-07-10

Re: [PATCH] rtc: at91sam9: Remove unnecessary offset variable checks

From: Nicolas Ferre <nicolas.ferre@microchip.com>
Date: 2021-07-08 12:49:50

On 08/07/2021 at 07:13, Nobuhiro Iwamatsu wrote:
The offset variable is checked by at91_rtc_readalarm(), but this check
is unnecessary because the previous check knew that the value of this
variable was not 0.
This removes that unnecessary offset variable checks.

Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
quoted hunk ↗ jump to hunk
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Nobuhiro Iwamatsu <redacted>
---
  drivers/rtc/rtc-at91sam9.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
index 2216be429ab727..b7b5ea1a4e6726 100644
--- a/drivers/rtc/rtc-at91sam9.c
+++ b/drivers/rtc/rtc-at91sam9.c
@@ -184,7 +184,7 @@ static int at91_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm)
                 return -EILSEQ;

         memset(alrm, 0, sizeof(*alrm));
-       if (alarm != ALARM_DISABLED && offset != 0) {
+       if (alarm != ALARM_DISABLED) {
                 rtc_time64_to_tm(offset + alarm, tm);

                 dev_dbg(dev, "%s: %ptR\n", __func__, tm);
--
2.31.1

-- 
Nicolas Ferre
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help