Skip to contentSkip to conversation

rtc: sh: remove unused variable rtc_dev

PATCH Applied Anders Roxell 2 participants 2 messages Jul 27, 2018 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: sh: remove unused variable rtc_dev

When building rtc-sh, rtc_dev isn't used in function __sh_rtc_periodic. drivers/rtc/rtc-sh.c: In function ‘__sh_rtc_periodic’:
drivers/rtc/rtc-sh.c:146:21: warning: unused variable ‘rtc_dev’ [-Wunused-variable]

  struct rtc_device *rtc_dev = rtc->rtc_dev;
                     ^~~~~~~

Remove the declaration of rtc_dev to dispose the warning.

Fixes ec623ff014c4 ("rtc: sh: remove dead code")
---
 drivers/rtc/rtc-sh.c | 1 -
 1 file changed, 1 deletion(-)
drivers/rtc/rtc-sh.c +0 -1
index 25ec6a937858..51ba414798a8 100644
@@ -143,7 +143,6 @@ static int __sh_rtc_alarm(struct sh_rtc *rtc)
 
 static int __sh_rtc_periodic(struct sh_rtc *rtc)
 {
-	struct rtc_device *rtc_dev = rtc->rtc_dev;
 	unsigned int tmp, pending;
 
 	tmp = readb(rtc->regbase + RCR2);
Signature · 1 line
2.18.0
maintainer Applied
#1 lore raw
Quoted 5 lines · Anders Roxell

When building rtc-sh, rtc_dev isn't used in function __sh_rtc_periodic. drivers/rtc/rtc-sh.c: In function ‘__sh_rtc_periodic’:
drivers/rtc/rtc-sh.c:146:21: warning: unused variable ‘rtc_dev’ [-Wunused-variable]

  struct rtc_device *rtc_dev = rtc->rtc_dev;
                     ^~~~~~~
Quoted 8 lines

Remove the declaration of rtc_dev to dispose the warning.

Fixes ec623ff014c4 ("rtc: sh: remove dead code")
---
 drivers/rtc/rtc-sh.c | 1 -
 1 file changed, 1 deletion(-)

Applied, thanks.

It is weird that kbuild didn't complain about it though.

Signature · 3 lines
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com