rtc: remove 'pending' variable from mpfs_rtc_wakeup_irq_handler()
Subsystems (3)
PATCH 1/1 rtc: remove 'pending' variable from mpfs_rtc_wakeup_irq_handler()
cppcheck reports
[drivers/rtc/rtc-mpfs.c:219]: (style) Variable 'pending' is assigned a value that is never used.
The fetched CONTROL_REG stored in pending is unused and partially duplicates the functionality of the later call to mpfs_rtc_clear(). This looks like leftover development code, so remove pending.
--- drivers/rtc/rtc-mpfs.c | 3 --- 1 file changed, 3 deletions(-)
drivers/rtc/rtc-mpfs.c +0 -3
@@ -213,10 +213,7 @@ static inline struct clk *mpfs_rtc_init_clk(struct device *dev)static irqreturn_t mpfs_rtc_wakeup_irq_handler (int irq,void *dev) {struct mpfs_rtc_dev *rtcdev = dev; -unsigned long pending; - pending =readl (rtcdev->base +CONTROL_REG ); - pending &=CONTROL_ALARM_ON_BIT ;mpfs_rtc_clear_irq (rtcdev);rtc_update_irq (rtcdev->rtc,1 ,RTC_IRQF |RTC_AF );
Signature · 1 line
2.27.0
Quoted 8 lines · Tom Rix
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
cppcheck reports
[drivers/rtc/rtc-mpfs.c:219]: (style) Variable 'pending' is assigned a value that is never used.The fetched
CONTROL_REGstored in pending is unused and partially duplicates the functionality of the later call tompfs_rtc_clear(). This looks like leftover development code, so remove pending.
It predates my involvement with the driver so I am not sure why exactly it was introduced, but it looks to me to be surplus to requirements.
Quoted 25 lines
Fixes 0b31d703598d ("rtc: Add driver for Microchip PolarFire SoC")Signed-off-by Tom Rix <[email protected]>--- drivers/rtc/rtc-mpfs.c | 3 --- 1 file changed, 3 deletions(-)drivers/rtc/rtc-mpfs.c +0
-4@@ -213,10 +213,7 @@ static inline struct clk *mpfs_rtc_init_clk(struct device *dev)static irqreturn_t mpfs_rtc_wakeup_irq_handler (int irq,void *dev) {struct mpfs_rtc_dev *rtcdev = dev; -unsigned long pending; - pending =readl (rtcdev->base +CONTROL_REG ); - pending &=CONTROL_ALARM_ON_BIT ;mpfs_rtc_clear_irq (rtcdev);rtc_update_irq (rtcdev->rtc,1 ,RTC_IRQF |RTC_AF ); --2.27.0
Quoted 8 lines · Tom Rix
cppcheck reports
[drivers/rtc/rtc-mpfs.c:219]: (style) Variable 'pending' is assigned a value that is never used.The fetched
CONTROL_REGstored in pending is unused and partially duplicates the functionality of the later call tompfs_rtc_clear(). This looks like leftover development code, so remove pending.[...]
Applied, thanks!
[1/1] rtc: remove 'pending' variable from mpfs_rtc_wakeup_irq_handler()
commit: 3fa0cb37bda9d45d3c6f07e67051e7118d3ffe63
Best regards,
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com