watchdog: Mark expected switch fall-throughs
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Mon, 29 Jul 2019 15:08:05 +0000 (10:08 -0500)
committerGustavo A. R. Silva <gustavo@embeddedor.com>
Sat, 10 Aug 2019 00:47:24 +0000 (19:47 -0500)
Mark switch cases where we are expecting to fall through.

This patch fixes the following warnings:

drivers/watchdog/ar7_wdt.c: warning: this statement may fall
through [-Wimplicit-fallthrough=]:  => 237:3
drivers/watchdog/pcwd.c: warning: this statement may fall
through [-Wimplicit-fallthrough=]:  => 653:3
drivers/watchdog/sb_wdog.c: warning: this statement may fall
through [-Wimplicit-fallthrough=]:  => 204:3
drivers/watchdog/wdt.c: warning: this statement may fall
through [-Wimplicit-fallthrough=]:  => 391:3

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
drivers/watchdog/ar7_wdt.c
drivers/watchdog/pcwd.c
drivers/watchdog/sb_wdog.c
drivers/watchdog/wdt.c

index b9b2d06b387965eb206e1f08c6ffad7129b4f707..668a1c704f28063602b87a90713522d593be80d6 100644 (file)
@@ -235,6 +235,7 @@ static long ar7_wdt_ioctl(struct file *file,
                ar7_wdt_update_margin(new_margin);
                ar7_wdt_kick(1);
                spin_unlock(&wdt_lock);
+               /* Fall through */
 
        case WDIOC_GETTIMEOUT:
                if (put_user(margin, (int *)arg))
index 1b2cf5b95a89d301a14e8413bc1fcb2c47b17110..c3c93e00b32050947d6bd0a592915ba2a8fb4f03 100644 (file)
@@ -651,7 +651,7 @@ static long pcwd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                        return -EINVAL;
 
                pcwd_keepalive();
-               /* Fall */
+               /* Fall through */
 
        case WDIOC_GETTIMEOUT:
                return put_user(heartbeat, argp);
index 5a6ced7a7e8f80a95ebc0ecba3e70c793caea701..202fc8d8ca5fa573385279ca14c6d7557784c71c 100644 (file)
@@ -202,6 +202,7 @@ static long sbwdog_ioctl(struct file *file, unsigned int cmd,
                timeout = time;
                sbwdog_set(user_dog, timeout);
                sbwdog_pet(user_dog);
+               /* Fall through */
 
        case WDIOC_GETTIMEOUT:
                /*
index 0650100fad001e1c337f7f9839e1dd82dc8945df..7d278b37e083d2bb4b8d5f0401593554e0e94a5b 100644 (file)
@@ -389,7 +389,7 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                if (wdt_set_heartbeat(new_heartbeat))
                        return -EINVAL;
                wdt_ping();
-               /* Fall */
+               /* Fall through */
        case WDIOC_GETTIMEOUT:
                return put_user(heartbeat, p);
        default: