watchdog: scx200_wdt: Mark expected switch fall-through
Subsystems (2)
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
@@ -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
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
caseWDIOC_GETTIMEOUT:
^~~~Signed-off-by Gustavo A. R. Silva <[email protected]>
Quoted 19 lines
--- drivers/watchdog/scx200_wdt.c | 1 + 1 file changed, 1 insertion(+)drivers/watchdog/scx200_wdt.c +1
-0@@ -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
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
caseWDIOC_GETTIMEOUT:
^~~~Signed-off-by Gustavo A. R. Silva <[email protected]>
-Kees
Quoted 19 lines
--- drivers/watchdog/scx200_wdt.c | 1 + 1 file changed, 1 insertion(+)drivers/watchdog/scx200_wdt.c +1
-0@@ -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
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
caseWDIOC_GETTIMEOUT:
^~~~Signed-off-by Gustavo A. R. Silva <[email protected]>Reviewed-by Kees Cook <[email protected]>
Quoted 16 lines
--- drivers/watchdog/scx200_wdt.c | 1 + 1 file changed, 1 insertion(+)drivers/watchdog/scx200_wdt.c +1
-0@@ -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 ;