mtd: cfi: Fix fall-through warnings for Clang
PATCH RESEND 1/1 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.
--- drivers/mtd/chips/cfi_cmdset_0001.c | 1 + drivers/mtd/chips/cfi_cmdset_0002.c | 2 ++ drivers/mtd/chips/cfi_cmdset_0020.c | 2 ++ 3 files changed, 5 insertions(+)
drivers/mtd/chips/cfi_cmdset_0001.c +1 -0
@@ -2549,6 +2549,7 @@ static int cfi_intelext_suspend(struct mtd_info *mtd)anyway? The latter for now. */ printk (KERN_NOTICE "Flash device refused suspend due to active operation (state %d)\n" , chip->state); ret = -EAGAIN ; +break ;case FL_PM_SUSPENDED :break ; }
drivers/mtd/chips/cfi_cmdset_0002.c +2 -0
@@ -902,6 +902,7 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr/* Someone else might have been playing with it. */ goto retry; } +return 0 ;case FL_READY :case FL_CFI_QUERY :
@@ -2994,6 +2995,7 @@ static int cfi_amdstd_suspend(struct mtd_info *mtd)* as the whole point is that nobody can do anything * with the chip now anyway. */ +break ;case FL_PM_SUSPENDED :break ;
drivers/mtd/chips/cfi_cmdset_0020.c +2 -0
@@ -1332,6 +1332,8 @@ static int cfi_staa_suspend(struct mtd_info *mtd)* as the whole point is that nobody can do anything * with the chip now anyway. */ +break ; +case FL_PM_SUSPENDED :break ;
Signature · 1 line
2.27.0
Quoted 7 lines · Gustavo A. R. Silva
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.
---
Miquel,
Feel free to queue this via mtd/next
Regards
Vignesh
[...]
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
Quoted 7 lines · Gustavo A. R. Silva
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.
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.
Miquel