watchdog: Use fallthrough pseudo-keyword
authorGustavo A. R. Silva <gustavoars@kernel.org>
Tue, 7 Jul 2020 17:11:21 +0000 (12:11 -0500)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Wed, 5 Aug 2020 16:42:53 +0000 (18:42 +0200)
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-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20200707171121.GA13472@embeddedor
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
38 files changed:
drivers/watchdog/advantechwdt.c
drivers/watchdog/alim1535_wdt.c
drivers/watchdog/alim7101_wdt.c
drivers/watchdog/ar7_wdt.c
drivers/watchdog/ath79_wdt.c
drivers/watchdog/eurotechwdt.c
drivers/watchdog/f71808e_wdt.c
drivers/watchdog/gef_wdt.c
drivers/watchdog/geodewdt.c
drivers/watchdog/ib700wdt.c
drivers/watchdog/it8712f_wdt.c
drivers/watchdog/ixp4xx_wdt.c
drivers/watchdog/m54xx_wdt.c
drivers/watchdog/machzwd.c
drivers/watchdog/mv64x60_wdt.c
drivers/watchdog/nv_tco.c
drivers/watchdog/pc87413_wdt.c
drivers/watchdog/pcwd.c
drivers/watchdog/pcwd_pci.c
drivers/watchdog/pcwd_usb.c
drivers/watchdog/rc32434_wdt.c
drivers/watchdog/riowd.c
drivers/watchdog/sa1100_wdt.c
drivers/watchdog/sb_wdog.c
drivers/watchdog/sbc60xxwdt.c
drivers/watchdog/sbc7240_wdt.c
drivers/watchdog/sbc_fitpc2_wdt.c
drivers/watchdog/sc520_wdt.c
drivers/watchdog/sch311x_wdt.c
drivers/watchdog/smsc37b787_wdt.c
drivers/watchdog/w83877f_wdt.c
drivers/watchdog/w83977f_wdt.c
drivers/watchdog/wafer5823wdt.c
drivers/watchdog/watchdog_dev.c
drivers/watchdog/wdt.c
drivers/watchdog/wdt285.c
drivers/watchdog/wdt977.c
drivers/watchdog/wdt_pci.c

index 0e4c18a2aa42b5c2ea05a643b1d12a818d8c4b68..554fe85da50e83315e932aceeeda12a16b060c51 100644 (file)
@@ -177,7 +177,7 @@ static long advwdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                if (advwdt_set_heartbeat(new_timeout))
                        return -EINVAL;
                advwdt_ping();
-               /* fall through */
+               fallthrough;
        case WDIOC_GETTIMEOUT:
                return put_user(timeout, p);
        default:
index 42338c7d4540d0fb1a1c582d727726b2ca346372..bfb9a91ca1df2d3dda51edd190e646c600491283 100644 (file)
@@ -220,7 +220,7 @@ static long ali_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                        return -EINVAL;
                ali_keepalive();
        }
-               /* fall through */
+               fallthrough;
        case WDIOC_GETTIMEOUT:
                return put_user(timeout, p);
        default:
index 5af0358f439008c964e36e282c8feff9621a85ac..4ff7f5afb7aa17435b69575ffbe469fc8e8181b2 100644 (file)
@@ -279,7 +279,7 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                timeout = new_timeout;
                wdt_keepalive();
        }
-               /* Fall through */
+               fallthrough;
        case WDIOC_GETTIMEOUT:
                return put_user(timeout, p);
        default:
index c087027ffd5d5da7fbf059017f24d98356806a92..ff37dc91057d178fda58387743f272307ef9175b 100644 (file)
@@ -235,8 +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 */
-
+               fallthrough;
        case WDIOC_GETTIMEOUT:
                if (put_user(margin, (int *)arg))
                        return -EFAULT;
index d6dff97c280be69853d6747b219f1bb9194e7b04..0f18f06a21b6b4b895cfc8b32ca8d7a47f47b27e 100644 (file)
@@ -215,8 +215,8 @@ static long ath79_wdt_ioctl(struct file *file, unsigned int cmd,
                err = ath79_wdt_set_timeout(t);
                if (err)
                        break;
+               fallthrough;
 
-               /* fallthrough */
        case WDIOC_GETTIMEOUT:
                err = put_user(timeout, p);
                break;
index f5ffa7be066e36f75703954b158ff00277601e1f..2418ebb707bd5da753c3f0af9793002709dd9099 100644 (file)
@@ -286,7 +286,7 @@ static long eurwdt_ioctl(struct file *file,
                eurwdt_timeout = time;
                eurwdt_set_timeout(time);
                spin_unlock(&eurwdt_lock);
-               /* fall through */
+               fallthrough;
 
        case WDIOC_GETTIMEOUT:
                return put_user(eurwdt_timeout, p);
index 9f7823819ed1b5836b3b48603aeea34171bfd830..f60beec1bbaea3451379f203a500d4d9d113ef7f 100644 (file)
@@ -612,7 +612,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd,
 
                if (new_options & WDIOS_ENABLECARD)
                        return watchdog_start();
-               /* fall through */
+               fallthrough;
 
        case WDIOC_KEEPALIVE:
                watchdog_keepalive();
@@ -626,7 +626,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd,
                        return -EINVAL;
 
                watchdog_keepalive();
-               /* fall through */
+               fallthrough;
 
        case WDIOC_GETTIMEOUT:
                return put_user(watchdog.timeout, uarg.i);
index f6541d1b65e3ad325fc638f4aa8cee19ca338d43..df5406aa7d25e03200035d0ad9a0a0c8357ccebd 100644 (file)
@@ -201,7 +201,7 @@ static long gef_wdt_ioctl(struct file *file, unsigned int cmd,
                if (get_user(timeout, (int __user *)argp))
                        return -EFAULT;
                gef_wdt_set_timeout(timeout);
-               /* Fall through */
+               fallthrough;
 
        case WDIOC_GETTIMEOUT:
                if (put_user(gef_wdt_timeout, (int __user *)argp))
index 9914a4283cb2a5582e5f1b00426e6ff708ba17ad..83418924e30af3f62995e2b7293de131696a615d 100644 (file)
@@ -185,7 +185,7 @@ static long geodewdt_ioctl(struct file *file, unsigned int cmd,
 
                if (geodewdt_set_heartbeat(interval))
                        return -EINVAL;
-       /* Fall through */
+               fallthrough;
        case WDIOC_GETTIMEOUT:
                return put_user(timeout, p);
 
index 2b65ea9451d12bdc1147ba09fbcbdbce730f6479..a0ddedc362fc8fa0ac2faab3bd646fabdf021589 100644 (file)
@@ -214,7 +214,7 @@ static long ibwdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                if (ibwdt_set_heartbeat(new_margin))
                        return -EINVAL;
                ibwdt_ping();
-               /* fall through */
+               fallthrough;
 
        case WDIOC_GETTIMEOUT:
                return put_user(timeout, p);
index 2fed40d1400783a014b777e75f0e81fa238eb050..9b89d2f09568d6f24f08d9b33feb0d74930548e3 100644 (file)
@@ -303,7 +303,7 @@ static long it8712f_wdt_ioctl(struct file *file, unsigned int cmd,
 
                superio_exit();
                it8712f_wdt_ping();
-               /* Fall through */
+               fallthrough;
        case WDIOC_GETTIMEOUT:
                if (put_user(margin, p))
                        return -EFAULT;
index 09886616fd212c92338577d0aaf631fb080a3bfe..aae29dcfaf1129755ab1f137fdf3b7e508044d2e 100644 (file)
@@ -136,7 +136,7 @@ static long ixp4xx_wdt_ioctl(struct file *file, unsigned int cmd,
 
                heartbeat = time;
                wdt_enable();
-               /* Fall through */
+               fallthrough;
 
        case WDIOC_GETTIMEOUT:
                ret = put_user(heartbeat, (int *)arg);
index 60ed6252e5f4105b2466fbb9640bc7f793aedd66..f388a769dbd33dda522395702ac85efdefd26e90 100644 (file)
@@ -155,7 +155,7 @@ static long m54xx_wdt_ioctl(struct file *file, unsigned int cmd,
 
                heartbeat = time;
                wdt_enable();
-               /* Fall through */
+               fallthrough;
 
        case WDIOC_GETTIMEOUT:
                ret = put_user(heartbeat, (int *)arg);
index 80ff94688487358a6bd410fc7588becc9a109dd6..743377c5b173536903c2446bcca0c92442f48509 100644 (file)
@@ -171,7 +171,7 @@ static inline void zf_set_timer(unsigned short new, unsigned char n)
        switch (n) {
        case WD1:
                zf_writew(COUNTER_1, new);
-               /* fall through */
+               fallthrough;
        case WD2:
                zf_writeb(COUNTER_2, new > 0xff ? 0xff : new);
        default:
index 0bc72dd69b70371f8d90869df4e98e6df619c995..894aa63488d399f129e663698d1740894737ce18 100644 (file)
@@ -222,7 +222,7 @@ static long mv64x60_wdt_ioctl(struct file *file,
                if (get_user(timeout, (int __user *)argp))
                        return -EFAULT;
                mv64x60_wdt_set_timeout(timeout);
-               /* Fall through */
+               fallthrough;
 
        case WDIOC_GETTIMEOUT:
                if (put_user(mv64x60_wdt_timeout, (int __user *)argp))
index d7a560e348d5fe735da0185a4ded4739837b9ce3..d15ad8583a5921c2ac1e871be88f414c4413fbe0 100644 (file)
@@ -250,7 +250,7 @@ static long nv_tco_ioctl(struct file *file, unsigned int cmd,
                if (tco_timer_set_heartbeat(new_heartbeat))
                        return -EINVAL;
                tco_timer_keepalive();
-               /* Fall through */
+               fallthrough;
        case WDIOC_GETTIMEOUT:
                return put_user(heartbeat, p);
        default:
index 73fbfc99083ba80d64c1bef8f8cab195d893e264..2d4504302c9ea477fd351cd220e70eade239bd49 100644 (file)
@@ -433,7 +433,7 @@ static long pc87413_ioctl(struct file *file, unsigned int cmd,
                        return -EINVAL;
                timeout = new_timeout;
                pc87413_refresh();
-               /* fall through - and return the new timeout... */
+               fallthrough;    /* and return the new timeout */
        case WDIOC_GETTIMEOUT:
                new_timeout = timeout * 60;
                return put_user(new_timeout, uarg.i);
index 7a0587fdc52c3ae53383902ca489a5fe5a0b3068..e86fa7f8351d8fc44cce2e30a81e2cafebbe0738 100644 (file)
@@ -651,7 +651,7 @@ static long pcwd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                        return -EINVAL;
 
                pcwd_keepalive();
-               /* Fall through */
+               fallthrough;
 
        case WDIOC_GETTIMEOUT:
                return put_user(heartbeat, argp);
index 81508a42a90c25d934c2f541cd7d2e5e625068e9..54d86fcb1837f763313c778b7687fee7b40d3104 100644 (file)
@@ -542,7 +542,7 @@ static long pcipcwd_ioctl(struct file *file, unsigned int cmd,
 
                pcipcwd_keepalive();
        }
-               /* fall through */
+               fallthrough;
 
        case WDIOC_GETTIMEOUT:
                return put_user(heartbeat, p);
index 2f44af1831d00cd1bfc0f3e450011e5763c3fed4..79efca47cebb028471dbd07bc32a867bf01411d0 100644 (file)
@@ -452,7 +452,7 @@ static long usb_pcwd_ioctl(struct file *file, unsigned int cmd,
 
                usb_pcwd_keepalive(usb_pcwd_device);
        }
-               /* fall through */
+               fallthrough;
 
        case WDIOC_GETTIMEOUT:
                return put_user(heartbeat, p);
index aee3c2efd565e7fa46ecc13816551d0d9f4c8a80..e74802f3a32e88d3bc00b16995944083f0aa13e9 100644 (file)
@@ -230,7 +230,7 @@ static long rc32434_wdt_ioctl(struct file *file, unsigned int cmd,
                        return -EFAULT;
                if (rc32434_wdt_set(new_timeout))
                        return -EINVAL;
-               /* Fall through */
+               fallthrough;
        case WDIOC_GETTIMEOUT:
                return copy_to_user(argp, &timeout, sizeof(int)) ? -EFAULT : 0;
        default:
index 1b9a6dc8f9828089089ac4e534ea1be19c81b5b6..7008596a575f942b355c9cf972662c64f454c6c2 100644 (file)
@@ -134,7 +134,7 @@ static long riowd_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
                        return -EINVAL;
                riowd_timeout = (new_margin + 59) / 60;
                riowd_writereg(p, riowd_timeout, WDTO_INDEX);
-               /* Fall through */
+               fallthrough;
 
        case WDIOC_GETTIMEOUT:
                return put_user(riowd_timeout * 60, (int __user *)argp);
index 9b93be00109fe251e1a12d940bf3e4aa4fd3630a..27846c6bdfb00c4ae410e15527c73ff52dd5f6f3 100644 (file)
@@ -127,7 +127,7 @@ static long sa1100dog_ioctl(struct file *file, unsigned int cmd,
 
                pre_margin = oscr_freq * time;
                writel_relaxed(readl_relaxed(OSCR) + pre_margin, OSMR3);
-               /*fall through*/
+               fallthrough;
 
        case WDIOC_GETTIMEOUT:
                ret = put_user(pre_margin / oscr_freq, p);
index da2dad00d473c44101e9ffc88e1ab4b4672e9134..504be461f992a9d5da18641c33cdda55b2ed7106 100644 (file)
@@ -202,7 +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 */
+               fallthrough;
 
        case WDIOC_GETTIMEOUT:
                /*
index f2cbe6d880a8ab2ad019aaf38865adc9b48f7b85..a947a63fb44ae9c082c5f395d69811af1bc038be 100644 (file)
@@ -265,7 +265,7 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                timeout = new_timeout;
                wdt_keepalive();
        }
-               /* Fall through */
+               fallthrough;
        case WDIOC_GETTIMEOUT:
                return put_user(timeout, p);
        default:
index 520b8dd77ed4bbdc56ee497dc8f58037da921028..d640b26e18a669103ddb5e46468c6f570513870d 100644 (file)
@@ -195,7 +195,7 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                if (wdt_set_timeout(new_timeout))
                        return -EINVAL;
        }
-       /* Fall through */
+               fallthrough;
        case WDIOC_GETTIMEOUT:
                return put_user(timeout, (int __user *)arg);
        default:
index 1b20b33879c47952bbd7b08ad60d2974e5368476..04483d6453d6a147703e46fd18dcc2b2bf4a9843 100644 (file)
@@ -154,7 +154,7 @@ static long fitpc2_wdt_ioctl(struct file *file, unsigned int cmd,
 
                margin = time;
                wdt_enable();
-               /* Fall through */
+               fallthrough;
 
        case WDIOC_GETTIMEOUT:
                ret = put_user(margin, (int *)arg);
index fbe79bcc9297b4c985afff9416c52a4a37a05c01..e66e6b905964b9e809f3358d8f631e49e303582d 100644 (file)
@@ -321,7 +321,7 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
                wdt_keepalive();
        }
-               /* Fall through */
+               fallthrough;
        case WDIOC_GETTIMEOUT:
                return put_user(timeout, p);
        default:
index 83949a385f62d6398b3290b39d58af247dcc2f18..d8b77fe10ebab18697b4432eb87d59135cb5bb90 100644 (file)
@@ -295,7 +295,7 @@ static long sch311x_wdt_ioctl(struct file *file, unsigned int cmd,
                if (sch311x_wdt_set_heartbeat(new_timeout))
                        return -EINVAL;
                sch311x_wdt_keepalive();
-               /* Fall through */
+               fallthrough;
        case WDIOC_GETTIMEOUT:
                return put_user(timeout, p);
        default:
index 43de56acd767f26795d6adfba41a3f242baff7de..7463df479d1113d63b7d35245e886cfc3265e560 100644 (file)
@@ -474,7 +474,7 @@ static long wb_smsc_wdt_ioctl(struct file *file,
                        return -EINVAL;
                timeout = new_timeout;
                wb_smsc_wdt_set_timeout(timeout);
-               /* fall through - and return the new timeout... */
+               fallthrough;    /* and return the new timeout */
        case WDIOC_GETTIMEOUT:
                new_timeout = timeout;
                if (unit == UNIT_MINUTE)
index 6b3b667e6f23c8c3888e0e05390500c6135eb633..5772cc5d378041ac42c2f924b777990b0f4429d9 100644 (file)
@@ -289,7 +289,7 @@ static long fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                timeout = new_timeout;
                wdt_keepalive();
        }
-               /* Fall through */
+               fallthrough;
        case WDIOC_GETTIMEOUT:
                return put_user(timeout, p);
        default:
index 5212e68c6b016593a0b94180e7af4fc1f877c093..fd64ae77780a62b6c72fd69fa1b91c63ba1bce28 100644 (file)
@@ -422,7 +422,7 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                        return -EINVAL;
 
                wdt_keepalive();
-               /* Fall through */
+               fallthrough;
 
        case WDIOC_GETTIMEOUT:
                return put_user(timeout, uarg.i);
index a6925847f76f8a3cfa7838ae81747bb8fd576303..a8a1ed215e1e79b8b43e9dd65e38a12977fc4358 100644 (file)
@@ -174,7 +174,7 @@ static long wafwdt_ioctl(struct file *file, unsigned int cmd,
                timeout = new_timeout;
                wafwdt_stop();
                wafwdt_start();
-               /* Fall through */
+               fallthrough;
        case WDIOC_GETTIMEOUT:
                return put_user(timeout, p);
 
index de02d90a4878228a4eca72465f8a8c0b3d10f5c2..b277eebd377eef710ddc9d4f458607b949048bb7 100644 (file)
@@ -776,7 +776,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd,
                err = watchdog_ping(wdd);
                if (err < 0)
                        break;
-               /* fall through */
+               fallthrough;
        case WDIOC_GETTIMEOUT:
                /* timeout == 0 means that we don't know the timeout */
                if (wdd->timeout == 0) {
index f9054cb0f8e242553babfc0003fb9974171ea1cf..a9e40b5c633e19f9e703168933b4870c901282a3 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 through */
+               fallthrough;
        case WDIOC_GETTIMEOUT:
                return put_user(heartbeat, p);
        default:
index e60993d0767ef57a649b64c0443c1ef380f94e2e..110249e5f6428c213ddd3a7ed55b7667a1948e4d 100644 (file)
@@ -168,7 +168,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd,
                soft_margin = new_margin;
                reload = soft_margin * (mem_fclk_21285 / 256);
                watchdog_ping();
-               /* Fall through */
+               fallthrough;
        case WDIOC_GETTIMEOUT:
                ret = put_user(soft_margin, int_arg);
                break;
index 066a4fb4d75ba58a1e93183e5481a557e1266e27..c9b8e863f70fcf123c4e97335aad9161b35a41bb 100644 (file)
@@ -398,7 +398,7 @@ static long wdt977_ioctl(struct file *file, unsigned int cmd,
                        return -EINVAL;
 
                wdt977_keepalive();
-               /* Fall through */
+               fallthrough;
 
        case WDIOC_GETTIMEOUT:
                return put_user(timeout, uarg.i);
index e528024faa41d2cfadb33b0581f0b9d12c2086ec..c3254ba5ace6b9e4718cfe537d9bede39b010d20 100644 (file)
@@ -426,7 +426,7 @@ static long wdtpci_ioctl(struct file *file, unsigned int cmd,
                if (wdtpci_set_heartbeat(new_heartbeat))
                        return -EINVAL;
                wdtpci_ping();
-               /* fall through */
+               fallthrough;
        case WDIOC_GETTIMEOUT:
                return put_user(heartbeat, p);
        default: