aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2019-02-08 13:02:02 -0500
committerRichard Weinberger <richard@nod.at>2019-05-06 15:57:04 -0400
commit660e171675282d82be044fc5e7fe1e444b7aaccc (patch)
treeac3751c797bbab84967bf44e606bc6b4404b861d /drivers
parent553f0459b8082fef847863aa8afcc6ca37fbce05 (diff)
mtd: cfi_util: mark expected switch fall-throughs
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. This patch fixes the following warnings: drivers/mtd/chips/cfi_util.c: In function ‘cfi_build_cmd’: drivers/mtd/chips/cfi_util.c:110:10: warning: this statement may fall through [-Wimplicit-fallthrough=] onecmd |= (onecmd << (chip_mode * 32)); ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mtd/chips/cfi_util.c:112:2: note: here case 4: ^~~~ drivers/mtd/chips/cfi_util.c:113:10: warning: this statement may fall through [-Wimplicit-fallthrough=] onecmd |= (onecmd << (chip_mode * 16)); ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mtd/chips/cfi_util.c:114:2: note: here case 2: ^~~~ drivers/mtd/chips/cfi_util.c: In function ‘cfi_merge_status’: drivers/mtd/chips/cfi_util.c:163:7: warning: this statement may fall through [-Wimplicit-fallthrough=] res |= (onestat >> (chip_mode * 32)); ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mtd/chips/cfi_util.c:165:2: note: here case 4: ^~~~ drivers/mtd/chips/cfi_util.c:166:7: warning: this statement may fall through [-Wimplicit-fallthrough=] res |= (onestat >> (chip_mode * 16)); ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mtd/chips/cfi_util.c:167:2: note: here case 2: ^~~~ Warning level 3 was used: -Wimplicit-fallthrough=3 This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/chips/cfi_util.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mtd/chips/cfi_util.c b/drivers/mtd/chips/cfi_util.c
index 6f16552cd59f..e3b266ee06af 100644
--- a/drivers/mtd/chips/cfi_util.c
+++ b/drivers/mtd/chips/cfi_util.c
@@ -109,10 +109,13 @@ map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cfi_private *cfi
109 case 8: 109 case 8:
110 onecmd |= (onecmd << (chip_mode * 32)); 110 onecmd |= (onecmd << (chip_mode * 32));
111#endif 111#endif
112 /* fall through */
112 case 4: 113 case 4:
113 onecmd |= (onecmd << (chip_mode * 16)); 114 onecmd |= (onecmd << (chip_mode * 16));
115 /* fall through */
114 case 2: 116 case 2:
115 onecmd |= (onecmd << (chip_mode * 8)); 117 onecmd |= (onecmd << (chip_mode * 8));
118 /* fall through */
116 case 1: 119 case 1:
117 ; 120 ;
118 } 121 }
@@ -162,10 +165,13 @@ unsigned long cfi_merge_status(map_word val, struct map_info *map,
162 case 8: 165 case 8:
163 res |= (onestat >> (chip_mode * 32)); 166 res |= (onestat >> (chip_mode * 32));
164#endif 167#endif
168 /* fall through */
165 case 4: 169 case 4:
166 res |= (onestat >> (chip_mode * 16)); 170 res |= (onestat >> (chip_mode * 16));
171 /* fall through */
167 case 2: 172 case 2:
168 res |= (onestat >> (chip_mode * 8)); 173 res |= (onestat >> (chip_mode * 8));
174 /* fall through */
169 case 1: 175 case 1:
170 ; 176 ;
171 } 177 }