Skip to content

Commit

Permalink
rtc: at91sam9: Remove unnecessary offset variable checks
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Ludovic Desroches <[email protected]>
Signed-off-by: Nobuhiro Iwamatsu <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Signed-off-by: Alexandre Belloni <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
iwamatsu-t authored and alexandrebelloni committed Jul 10, 2021
1 parent f2581b1 commit 37aadf9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/rtc/rtc-at91sam9.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 37aadf9

Please sign in to comment.