Skip to contentSkip to conversation

watchdog: scx200_wdt: Mark expected switch fall-through

PATCH In review Gustavo A. R. Silva 3 participants 4 messages Jul 29, 2019 – Jul 30, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: scx200_wdt: Mark expected switch fall-through

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning (Building: i386):

drivers/watchdog/scx200_wdt.c: In function ‘scx200_wdt_ioctl’:
drivers/watchdog/scx200_wdt.c:188:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
scx200_wdt_ping();
^~~~~~~~~~~~~~~~~
drivers/watchdog/scx200_wdt.c:189:2: note: here
case WDIOC_GETTIMEOUT:
^~~~

---
 drivers/watchdog/scx200_wdt.c | 1 +
 1 file changed, 1 insertion(+)
drivers/watchdog/scx200_wdt.c +1 -0
index efd7996694de..46268309ee9b 100644
@@ -186,6 +186,7 @@ static long scx200_wdt_ioctl(struct file *file, unsigned int cmd,
 		margin = new_margin;
 		scx200_wdt_update_margin();
 		scx200_wdt_ping();
+		/* Fall through */
 	case WDIOC_GETTIMEOUT:
 		if (put_user(margin, p))
 			return -EFAULT;
Signature · 1 line
2.22.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Gustavo A. R. Silva

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning (Building: i386):

drivers/watchdog/scx200_wdt.c: In function ‘scx200_wdt_ioctl’:
drivers/watchdog/scx200_wdt.c:188:3: warning: this statement may fall through [-Wimplicit-fallthrough=]

Quoted 7 lines
   scx200_wdt_ping();
   ^~~~~~~~~~~~~~~~~

drivers/watchdog/scx200_wdt.c:189:2: note: here
case WDIOC_GETTIMEOUT:
^~~~

Quoted 19 lines
---
 drivers/watchdog/scx200_wdt.c | 1 +
 1 file changed, 1 insertion(+)
drivers/watchdog/scx200_wdt.c +1 -0
index efd7996694de..46268309ee9b 100644
@@ -186,6 +186,7 @@ static long scx200_wdt_ioctl(struct file *file, unsigned int cmd,
 		margin = new_margin;
 		scx200_wdt_update_margin();
 		scx200_wdt_ping();
+		/* Fall through */
 	case WDIOC_GETTIMEOUT:
 		if (put_user(margin, p))
 			return -EFAULT;
Signature · 1 line
2.22.0
Reviewed-by on v1 1/1
#2 lore raw
In reply to Gustavo A. R. Silva
Quoted 6 lines · Gustavo A. R. Silva

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning (Building: i386):

drivers/watchdog/scx200_wdt.c: In function ‘scx200_wdt_ioctl’:
drivers/watchdog/scx200_wdt.c:188:3: warning: this statement may fall through [-Wimplicit-fallthrough=]

Quoted 7 lines
   scx200_wdt_ping();
   ^~~~~~~~~~~~~~~~~

drivers/watchdog/scx200_wdt.c:189:2: note: here
case WDIOC_GETTIMEOUT:
^~~~

-Kees

Quoted 19 lines
---
 drivers/watchdog/scx200_wdt.c | 1 +
 1 file changed, 1 insertion(+)
drivers/watchdog/scx200_wdt.c +1 -0
index efd7996694de..46268309ee9b 100644
@@ -186,6 +186,7 @@ static long scx200_wdt_ioctl(struct file *file, unsigned int cmd,
 		margin = new_margin;
 		scx200_wdt_update_margin();
 		scx200_wdt_ping();
+		/* Fall through */
 	case WDIOC_GETTIMEOUT:
 		if (put_user(margin, p))
 			return -EFAULT;
Signature · 1 line
2.22.0
Signature · 1 line
Kees Cook
maintainer Reviewed-by on v1 1/1
#3 lore raw
In reply to Gustavo A. R. Silva
Quoted 6 lines · Gustavo A. R. Silva

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning (Building: i386):

drivers/watchdog/scx200_wdt.c: In function ‘scx200_wdt_ioctl’:
drivers/watchdog/scx200_wdt.c:188:3: warning: this statement may fall through [-Wimplicit-fallthrough=]

Quoted 8 lines
   scx200_wdt_ping();
   ^~~~~~~~~~~~~~~~~

drivers/watchdog/scx200_wdt.c:189:2: note: here
case WDIOC_GETTIMEOUT:
^~~~

Quoted 16 lines
---
 drivers/watchdog/scx200_wdt.c | 1 +
 1 file changed, 1 insertion(+)
drivers/watchdog/scx200_wdt.c +1 -0
index efd7996694de..46268309ee9b 100644
@@ -186,6 +186,7 @@ static long scx200_wdt_ioctl(struct file *file, unsigned int cmd,
 		margin = new_margin;
 		scx200_wdt_update_margin();
 		scx200_wdt_ping();
+		/* Fall through */
 	case WDIOC_GETTIMEOUT:
 		if (put_user(margin, p))
 			return -EFAULT;