watchdog: Mark expected switch fall-throughs
PATCH 1/1 watchdog: Mark expected switch fall-throughs
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
--- drivers/watchdog/ar7_wdt.c | 1 + drivers/watchdog/pcwd.c | 2 +- drivers/watchdog/sb_wdog.c | 1 + drivers/watchdog/wdt.c | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-)
drivers/watchdog/ar7_wdt.c +1 -0
@@ -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))
drivers/watchdog/pcwd.c +1 -1
@@ -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);
drivers/watchdog/sb_wdog.c +1 -0
@@ -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 :/*
drivers/watchdog/wdt.c +1 -1
@@ -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 :
Signature · 1 line
2.22.0
Quoted 13 lines · Gustavo A. R. Silva
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:3drivers/watchdog/pcwd.c: warning: this statement may fall through [-Wimplicit-fallthrough=]: => 653:3drivers/watchdog/sb_wdog.c: warning: this statement may fall through [-Wimplicit-fallthrough=]: => 204:3drivers/watchdog/wdt.c: warning: this statement may fall through [-Wimplicit-fallthrough=]: => 391:3
Quoted 2 lines
Reported-by Geert Uytterhoeven <[email protected]>Signed-off-by Gustavo A. R. Silva <[email protected]>
-Kees
Quoted 60 lines
--- drivers/watchdog/ar7_wdt.c | 1 + drivers/watchdog/pcwd.c | 2 +- drivers/watchdog/sb_wdog.c | 1 + drivers/watchdog/wdt.c | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-)drivers/watchdog/ar7_wdt.c +1
-0@@ -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))drivers/watchdog/pcwd.c +1
-1@@ -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);drivers/watchdog/sb_wdog.c +1
-0@@ -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 :/* drivers/watchdog/wdt.c +1
-1@@ -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 :Signature · 1 line
2.22.0
Signature · 1 line
Kees Cook
Quoted 13 lines · Gustavo A. R. Silva
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:3drivers/watchdog/pcwd.c: warning: this statement may fall through [-Wimplicit-fallthrough=]: => 653:3drivers/watchdog/sb_wdog.c: warning: this statement may fall through [-Wimplicit-fallthrough=]: => 204:3drivers/watchdog/wdt.c: warning: this statement may fall through [-Wimplicit-fallthrough=]: => 391:3
Quoted 2 lines
Reported-by Geert Uytterhoeven <[email protected]>Signed-off-by Gustavo A. R. Silva <[email protected]>
Quoted 60 lines
--- drivers/watchdog/ar7_wdt.c | 1 + drivers/watchdog/pcwd.c | 2 +- drivers/watchdog/sb_wdog.c | 1 + drivers/watchdog/wdt.c | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-)drivers/watchdog/ar7_wdt.c +1
-0@@ -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))drivers/watchdog/pcwd.c +1
-1@@ -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);drivers/watchdog/sb_wdog.c +1
-0@@ -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 :/* drivers/watchdog/wdt.c +1
-1@@ -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 :Signature · 1 line
2.22.0