Commit bd490f82 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Wim Van Sebroeck

watchdog: Use fallthrough pseudo-keyword

Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-throughSigned-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20200707171121.GA13472@embeddedorSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent 5edc8c68
...@@ -177,7 +177,7 @@ static long advwdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -177,7 +177,7 @@ static long advwdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (advwdt_set_heartbeat(new_timeout)) if (advwdt_set_heartbeat(new_timeout))
return -EINVAL; return -EINVAL;
advwdt_ping(); advwdt_ping();
/* fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(timeout, p); return put_user(timeout, p);
default: default:
......
...@@ -220,7 +220,7 @@ static long ali_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -220,7 +220,7 @@ static long ali_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
return -EINVAL; return -EINVAL;
ali_keepalive(); ali_keepalive();
} }
/* fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(timeout, p); return put_user(timeout, p);
default: default:
......
...@@ -279,7 +279,7 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -279,7 +279,7 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
timeout = new_timeout; timeout = new_timeout;
wdt_keepalive(); wdt_keepalive();
} }
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(timeout, p); return put_user(timeout, p);
default: default:
......
...@@ -235,8 +235,7 @@ static long ar7_wdt_ioctl(struct file *file, ...@@ -235,8 +235,7 @@ static long ar7_wdt_ioctl(struct file *file,
ar7_wdt_update_margin(new_margin); ar7_wdt_update_margin(new_margin);
ar7_wdt_kick(1); ar7_wdt_kick(1);
spin_unlock(&wdt_lock); spin_unlock(&wdt_lock);
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
if (put_user(margin, (int *)arg)) if (put_user(margin, (int *)arg))
return -EFAULT; return -EFAULT;
......
...@@ -215,8 +215,8 @@ static long ath79_wdt_ioctl(struct file *file, unsigned int cmd, ...@@ -215,8 +215,8 @@ static long ath79_wdt_ioctl(struct file *file, unsigned int cmd,
err = ath79_wdt_set_timeout(t); err = ath79_wdt_set_timeout(t);
if (err) if (err)
break; break;
fallthrough;
/* fallthrough */
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
err = put_user(timeout, p); err = put_user(timeout, p);
break; break;
......
...@@ -286,7 +286,7 @@ static long eurwdt_ioctl(struct file *file, ...@@ -286,7 +286,7 @@ static long eurwdt_ioctl(struct file *file,
eurwdt_timeout = time; eurwdt_timeout = time;
eurwdt_set_timeout(time); eurwdt_set_timeout(time);
spin_unlock(&eurwdt_lock); spin_unlock(&eurwdt_lock);
/* fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(eurwdt_timeout, p); return put_user(eurwdt_timeout, p);
......
...@@ -612,7 +612,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd, ...@@ -612,7 +612,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd,
if (new_options & WDIOS_ENABLECARD) if (new_options & WDIOS_ENABLECARD)
return watchdog_start(); return watchdog_start();
/* fall through */ fallthrough;
case WDIOC_KEEPALIVE: case WDIOC_KEEPALIVE:
watchdog_keepalive(); watchdog_keepalive();
...@@ -626,7 +626,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd, ...@@ -626,7 +626,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd,
return -EINVAL; return -EINVAL;
watchdog_keepalive(); watchdog_keepalive();
/* fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(watchdog.timeout, uarg.i); return put_user(watchdog.timeout, uarg.i);
......
...@@ -201,7 +201,7 @@ static long gef_wdt_ioctl(struct file *file, unsigned int cmd, ...@@ -201,7 +201,7 @@ static long gef_wdt_ioctl(struct file *file, unsigned int cmd,
if (get_user(timeout, (int __user *)argp)) if (get_user(timeout, (int __user *)argp))
return -EFAULT; return -EFAULT;
gef_wdt_set_timeout(timeout); gef_wdt_set_timeout(timeout);
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
if (put_user(gef_wdt_timeout, (int __user *)argp)) if (put_user(gef_wdt_timeout, (int __user *)argp))
......
...@@ -185,7 +185,7 @@ static long geodewdt_ioctl(struct file *file, unsigned int cmd, ...@@ -185,7 +185,7 @@ static long geodewdt_ioctl(struct file *file, unsigned int cmd,
if (geodewdt_set_heartbeat(interval)) if (geodewdt_set_heartbeat(interval))
return -EINVAL; return -EINVAL;
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(timeout, p); return put_user(timeout, p);
......
...@@ -214,7 +214,7 @@ static long ibwdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -214,7 +214,7 @@ static long ibwdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (ibwdt_set_heartbeat(new_margin)) if (ibwdt_set_heartbeat(new_margin))
return -EINVAL; return -EINVAL;
ibwdt_ping(); ibwdt_ping();
/* fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(timeout, p); return put_user(timeout, p);
......
...@@ -303,7 +303,7 @@ static long it8712f_wdt_ioctl(struct file *file, unsigned int cmd, ...@@ -303,7 +303,7 @@ static long it8712f_wdt_ioctl(struct file *file, unsigned int cmd,
superio_exit(); superio_exit();
it8712f_wdt_ping(); it8712f_wdt_ping();
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
if (put_user(margin, p)) if (put_user(margin, p))
return -EFAULT; return -EFAULT;
......
...@@ -136,7 +136,7 @@ static long ixp4xx_wdt_ioctl(struct file *file, unsigned int cmd, ...@@ -136,7 +136,7 @@ static long ixp4xx_wdt_ioctl(struct file *file, unsigned int cmd,
heartbeat = time; heartbeat = time;
wdt_enable(); wdt_enable();
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
ret = put_user(heartbeat, (int *)arg); ret = put_user(heartbeat, (int *)arg);
......
...@@ -155,7 +155,7 @@ static long m54xx_wdt_ioctl(struct file *file, unsigned int cmd, ...@@ -155,7 +155,7 @@ static long m54xx_wdt_ioctl(struct file *file, unsigned int cmd,
heartbeat = time; heartbeat = time;
wdt_enable(); wdt_enable();
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
ret = put_user(heartbeat, (int *)arg); ret = put_user(heartbeat, (int *)arg);
......
...@@ -171,7 +171,7 @@ static inline void zf_set_timer(unsigned short new, unsigned char n) ...@@ -171,7 +171,7 @@ static inline void zf_set_timer(unsigned short new, unsigned char n)
switch (n) { switch (n) {
case WD1: case WD1:
zf_writew(COUNTER_1, new); zf_writew(COUNTER_1, new);
/* fall through */ fallthrough;
case WD2: case WD2:
zf_writeb(COUNTER_2, new > 0xff ? 0xff : new); zf_writeb(COUNTER_2, new > 0xff ? 0xff : new);
default: default:
......
...@@ -222,7 +222,7 @@ static long mv64x60_wdt_ioctl(struct file *file, ...@@ -222,7 +222,7 @@ static long mv64x60_wdt_ioctl(struct file *file,
if (get_user(timeout, (int __user *)argp)) if (get_user(timeout, (int __user *)argp))
return -EFAULT; return -EFAULT;
mv64x60_wdt_set_timeout(timeout); mv64x60_wdt_set_timeout(timeout);
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
if (put_user(mv64x60_wdt_timeout, (int __user *)argp)) if (put_user(mv64x60_wdt_timeout, (int __user *)argp))
......
...@@ -250,7 +250,7 @@ static long nv_tco_ioctl(struct file *file, unsigned int cmd, ...@@ -250,7 +250,7 @@ static long nv_tco_ioctl(struct file *file, unsigned int cmd,
if (tco_timer_set_heartbeat(new_heartbeat)) if (tco_timer_set_heartbeat(new_heartbeat))
return -EINVAL; return -EINVAL;
tco_timer_keepalive(); tco_timer_keepalive();
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(heartbeat, p); return put_user(heartbeat, p);
default: default:
......
...@@ -433,7 +433,7 @@ static long pc87413_ioctl(struct file *file, unsigned int cmd, ...@@ -433,7 +433,7 @@ static long pc87413_ioctl(struct file *file, unsigned int cmd,
return -EINVAL; return -EINVAL;
timeout = new_timeout; timeout = new_timeout;
pc87413_refresh(); pc87413_refresh();
/* fall through - and return the new timeout... */ fallthrough; /* and return the new timeout */
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
new_timeout = timeout * 60; new_timeout = timeout * 60;
return put_user(new_timeout, uarg.i); return put_user(new_timeout, uarg.i);
......
...@@ -651,7 +651,7 @@ static long pcwd_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -651,7 +651,7 @@ static long pcwd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
return -EINVAL; return -EINVAL;
pcwd_keepalive(); pcwd_keepalive();
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(heartbeat, argp); return put_user(heartbeat, argp);
......
...@@ -542,7 +542,7 @@ static long pcipcwd_ioctl(struct file *file, unsigned int cmd, ...@@ -542,7 +542,7 @@ static long pcipcwd_ioctl(struct file *file, unsigned int cmd,
pcipcwd_keepalive(); pcipcwd_keepalive();
} }
/* fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(heartbeat, p); return put_user(heartbeat, p);
......
...@@ -452,7 +452,7 @@ static long usb_pcwd_ioctl(struct file *file, unsigned int cmd, ...@@ -452,7 +452,7 @@ static long usb_pcwd_ioctl(struct file *file, unsigned int cmd,
usb_pcwd_keepalive(usb_pcwd_device); usb_pcwd_keepalive(usb_pcwd_device);
} }
/* fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(heartbeat, p); return put_user(heartbeat, p);
......
...@@ -230,7 +230,7 @@ static long rc32434_wdt_ioctl(struct file *file, unsigned int cmd, ...@@ -230,7 +230,7 @@ static long rc32434_wdt_ioctl(struct file *file, unsigned int cmd,
return -EFAULT; return -EFAULT;
if (rc32434_wdt_set(new_timeout)) if (rc32434_wdt_set(new_timeout))
return -EINVAL; return -EINVAL;
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return copy_to_user(argp, &timeout, sizeof(int)) ? -EFAULT : 0; return copy_to_user(argp, &timeout, sizeof(int)) ? -EFAULT : 0;
default: default:
......
...@@ -134,7 +134,7 @@ static long riowd_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ...@@ -134,7 +134,7 @@ static long riowd_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
return -EINVAL; return -EINVAL;
riowd_timeout = (new_margin + 59) / 60; riowd_timeout = (new_margin + 59) / 60;
riowd_writereg(p, riowd_timeout, WDTO_INDEX); riowd_writereg(p, riowd_timeout, WDTO_INDEX);
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(riowd_timeout * 60, (int __user *)argp); return put_user(riowd_timeout * 60, (int __user *)argp);
......
...@@ -127,7 +127,7 @@ static long sa1100dog_ioctl(struct file *file, unsigned int cmd, ...@@ -127,7 +127,7 @@ static long sa1100dog_ioctl(struct file *file, unsigned int cmd,
pre_margin = oscr_freq * time; pre_margin = oscr_freq * time;
writel_relaxed(readl_relaxed(OSCR) + pre_margin, OSMR3); writel_relaxed(readl_relaxed(OSCR) + pre_margin, OSMR3);
/*fall through*/ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
ret = put_user(pre_margin / oscr_freq, p); ret = put_user(pre_margin / oscr_freq, p);
......
...@@ -202,7 +202,7 @@ static long sbwdog_ioctl(struct file *file, unsigned int cmd, ...@@ -202,7 +202,7 @@ static long sbwdog_ioctl(struct file *file, unsigned int cmd,
timeout = time; timeout = time;
sbwdog_set(user_dog, timeout); sbwdog_set(user_dog, timeout);
sbwdog_pet(user_dog); sbwdog_pet(user_dog);
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
/* /*
......
...@@ -265,7 +265,7 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -265,7 +265,7 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
timeout = new_timeout; timeout = new_timeout;
wdt_keepalive(); wdt_keepalive();
} }
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(timeout, p); return put_user(timeout, p);
default: default:
......
...@@ -195,7 +195,7 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -195,7 +195,7 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (wdt_set_timeout(new_timeout)) if (wdt_set_timeout(new_timeout))
return -EINVAL; return -EINVAL;
} }
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(timeout, (int __user *)arg); return put_user(timeout, (int __user *)arg);
default: default:
......
...@@ -154,7 +154,7 @@ static long fitpc2_wdt_ioctl(struct file *file, unsigned int cmd, ...@@ -154,7 +154,7 @@ static long fitpc2_wdt_ioctl(struct file *file, unsigned int cmd,
margin = time; margin = time;
wdt_enable(); wdt_enable();
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
ret = put_user(margin, (int *)arg); ret = put_user(margin, (int *)arg);
......
...@@ -321,7 +321,7 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -321,7 +321,7 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
wdt_keepalive(); wdt_keepalive();
} }
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(timeout, p); return put_user(timeout, p);
default: default:
......
...@@ -295,7 +295,7 @@ static long sch311x_wdt_ioctl(struct file *file, unsigned int cmd, ...@@ -295,7 +295,7 @@ static long sch311x_wdt_ioctl(struct file *file, unsigned int cmd,
if (sch311x_wdt_set_heartbeat(new_timeout)) if (sch311x_wdt_set_heartbeat(new_timeout))
return -EINVAL; return -EINVAL;
sch311x_wdt_keepalive(); sch311x_wdt_keepalive();
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(timeout, p); return put_user(timeout, p);
default: default:
......
...@@ -474,7 +474,7 @@ static long wb_smsc_wdt_ioctl(struct file *file, ...@@ -474,7 +474,7 @@ static long wb_smsc_wdt_ioctl(struct file *file,
return -EINVAL; return -EINVAL;
timeout = new_timeout; timeout = new_timeout;
wb_smsc_wdt_set_timeout(timeout); wb_smsc_wdt_set_timeout(timeout);
/* fall through - and return the new timeout... */ fallthrough; /* and return the new timeout */
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
new_timeout = timeout; new_timeout = timeout;
if (unit == UNIT_MINUTE) if (unit == UNIT_MINUTE)
......
...@@ -289,7 +289,7 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -289,7 +289,7 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
timeout = new_timeout; timeout = new_timeout;
wdt_keepalive(); wdt_keepalive();
} }
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(timeout, p); return put_user(timeout, p);
default: default:
......
...@@ -422,7 +422,7 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -422,7 +422,7 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
return -EINVAL; return -EINVAL;
wdt_keepalive(); wdt_keepalive();
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(timeout, uarg.i); return put_user(timeout, uarg.i);
......
...@@ -174,7 +174,7 @@ static long wafwdt_ioctl(struct file *file, unsigned int cmd, ...@@ -174,7 +174,7 @@ static long wafwdt_ioctl(struct file *file, unsigned int cmd,
timeout = new_timeout; timeout = new_timeout;
wafwdt_stop(); wafwdt_stop();
wafwdt_start(); wafwdt_start();
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(timeout, p); return put_user(timeout, p);
......
...@@ -776,7 +776,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd, ...@@ -776,7 +776,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd,
err = watchdog_ping(wdd); err = watchdog_ping(wdd);
if (err < 0) if (err < 0)
break; break;
/* fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
/* timeout == 0 means that we don't know the timeout */ /* timeout == 0 means that we don't know the timeout */
if (wdd->timeout == 0) { if (wdd->timeout == 0) {
......
...@@ -389,7 +389,7 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -389,7 +389,7 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (wdt_set_heartbeat(new_heartbeat)) if (wdt_set_heartbeat(new_heartbeat))
return -EINVAL; return -EINVAL;
wdt_ping(); wdt_ping();
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(heartbeat, p); return put_user(heartbeat, p);
default: default:
......
...@@ -168,7 +168,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd, ...@@ -168,7 +168,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd,
soft_margin = new_margin; soft_margin = new_margin;
reload = soft_margin * (mem_fclk_21285 / 256); reload = soft_margin * (mem_fclk_21285 / 256);
watchdog_ping(); watchdog_ping();
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
ret = put_user(soft_margin, int_arg); ret = put_user(soft_margin, int_arg);
break; break;
......
...@@ -398,7 +398,7 @@ static long wdt977_ioctl(struct file *file, unsigned int cmd, ...@@ -398,7 +398,7 @@ static long wdt977_ioctl(struct file *file, unsigned int cmd,
return -EINVAL; return -EINVAL;
wdt977_keepalive(); wdt977_keepalive();
/* Fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(timeout, uarg.i); return put_user(timeout, uarg.i);
......
...@@ -426,7 +426,7 @@ static long wdtpci_ioctl(struct file *file, unsigned int cmd, ...@@ -426,7 +426,7 @@ static long wdtpci_ioctl(struct file *file, unsigned int cmd,
if (wdtpci_set_heartbeat(new_heartbeat)) if (wdtpci_set_heartbeat(new_heartbeat))
return -EINVAL; return -EINVAL;
wdtpci_ping(); wdtpci_ping();
/* fall through */ fallthrough;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(heartbeat, p); return put_user(heartbeat, p);
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment