Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: at91sam9: Remove unnecessary offset variable checks

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>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20210708051340.341345-1-nobuhiro1.iwamatsu@toshiba.co.jp

authored by

Nobuhiro Iwamatsu and committed by
Alexandre Belloni
37aadf9b f2581b1d

+1 -1
+1 -1
drivers/rtc/rtc-at91sam9.c
··· 184 184 return -EILSEQ; 185 185 186 186 memset(alrm, 0, sizeof(*alrm)); 187 - if (alarm != ALARM_DISABLED && offset != 0) { 187 + if (alarm != ALARM_DISABLED) { 188 188 rtc_time64_to_tm(offset + alarm, tm); 189 189 190 190 dev_dbg(dev, "%s: %ptR\n", __func__, tm);