From: Markus Elfring Date: Mon, 8 Jul 2019 08:26:47 +0000 (+0200) Subject: rtc: stm32: remove one condition check in stm32_rtc_set_alarm() X-Git-Tag: v5.4-rc1~536^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fe63604c630acfc51797d5896ff01cd59c684572;p=platform%2Fkernel%2Flinux-rpi.git rtc: stm32: remove one condition check in stm32_rtc_set_alarm() A condition check was repeated in this function implementation despite of a corresponding check in the stm32_rtc_alarm_irq_enable() function. Thus delete redundant source code here. This issue was detected by using the Coccinelle software. Suggested-by: Russell King Signed-off-by: Markus Elfring Reviewed-by: Amelie Delaunay Link: https://lore.kernel.org/r/4da614a4-83c6-548c-a112-033b846c561b@web.de Signed-off-by: Alexandre Belloni --- diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c index 8e6c9b3..773a199 100644 --- a/drivers/rtc/rtc-stm32.c +++ b/drivers/rtc/rtc-stm32.c @@ -519,11 +519,7 @@ static int stm32_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) /* Write to Alarm register */ writel_relaxed(alrmar, rtc->base + regs->alrmar); - if (alrm->enabled) - stm32_rtc_alarm_irq_enable(dev, 1); - else - stm32_rtc_alarm_irq_enable(dev, 0); - + stm32_rtc_alarm_irq_enable(dev, alrm->enabled); end: stm32_rtc_wpr_lock(rtc);