Skip to content

Commit

Permalink
watchdog: sc520_wdt: Mark expected switch fall-through
Browse files Browse the repository at this point in the history
In preparation to enabling -Wimplicit-fallthrough, mark switch
cases where we are expecting to fall through.

This patch fixes the following warning:

drivers/watchdog/sc520_wdt.c: In function ‘fop_ioctl’:
drivers/watchdog/sc520_wdt.c:326:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
   wdt_keepalive();
   ^~~~~~~~~~~~~~~
drivers/watchdog/sc520_wdt.c:329:2: note: here
  case WDIOC_GETTIMEOUT:
  ^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

Notice that, in this particular case, the code comment is modified
in accordance with what GCC is expecting to find.

This patch is part of the ongoing efforts to enable
-Wimplicit-fallthrough.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
  • Loading branch information
Gustavo A. R. Silva authored and Wim Van Sebroeck committed Mar 2, 2019
1 parent 3612b87 commit e70d354
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/watchdog/sc520_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
return -EINVAL;

wdt_keepalive();
/* Fall through */
}
/* Fall through */
case WDIOC_GETTIMEOUT:
return put_user(timeout, p);
default:
Expand Down

0 comments on commit e70d354

Please sign in to comment.