Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: cfi: Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple
warnings by explicitly adding multiple break statements and a return
instead of letting the code fall through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Acked-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210305081933.GA137147@embeddedor

authored by

Gustavo A. R. Silva and committed by
Miquel Raynal
c6f51f1f 620b90d3

+5
+1
drivers/mtd/chips/cfi_cmdset_0001.c
··· 2549 2549 anyway? The latter for now. */ 2550 2550 printk(KERN_NOTICE "Flash device refused suspend due to active operation (state %d)\n", chip->state); 2551 2551 ret = -EAGAIN; 2552 + break; 2552 2553 case FL_PM_SUSPENDED: 2553 2554 break; 2554 2555 }
+2
drivers/mtd/chips/cfi_cmdset_0002.c
··· 902 902 /* Someone else might have been playing with it. */ 903 903 goto retry; 904 904 } 905 + return 0; 905 906 906 907 case FL_READY: 907 908 case FL_CFI_QUERY: ··· 2995 2994 * as the whole point is that nobody can do anything 2996 2995 * with the chip now anyway. 2997 2996 */ 2997 + break; 2998 2998 case FL_PM_SUSPENDED: 2999 2999 break; 3000 3000
+2
drivers/mtd/chips/cfi_cmdset_0020.c
··· 1332 1332 * as the whole point is that nobody can do anything 1333 1333 * with the chip now anyway. 1334 1334 */ 1335 + break; 1336 + 1335 1337 case FL_PM_SUSPENDED: 1336 1338 break; 1337 1339