Skip to content

Commit 025a06c

Browse files
committed
mtd: Convert fallthrough comments into statements
Use Joe Perches cvt_fallthrough.pl script to convert /* fallthrough */ comments (and its derivatives) into a fallthrough; statement. This automatically drops useless ones. Do it MTD-wide. Signed-off-by: Miquel Raynal <[email protected]> Acked-by: Vignesh Raghavendra <[email protected]> Acked-by: Tudor Ambarus <[email protected]> Acked-by: Richard Weinberger <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 699274b commit 025a06c

22 files changed

+45
-60
lines changed

drivers/mtd/chips/cfi_cmdset_0001.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long
834834
/* Someone else might have been playing with it. */
835835
return -EAGAIN;
836836
}
837-
/* Fall through */
837+
fallthrough;
838838
case FL_READY:
839839
case FL_CFI_QUERY:
840840
case FL_JEDEC_QUERY:
@@ -907,7 +907,7 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long
907907
/* Only if there's no operation suspended... */
908908
if (mode == FL_READY && chip->oldstate == FL_READY)
909909
return 0;
910-
/* Fall through */
910+
fallthrough;
911911
default:
912912
sleep:
913913
set_current_state(TASK_UNINTERRUPTIBLE);

drivers/mtd/chips/cfi_cmdset_0002.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -966,8 +966,7 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr
966966
/* Only if there's no operation suspended... */
967967
if (mode == FL_READY && chip->oldstate == FL_READY)
968968
return 0;
969-
/* fall through */
970-
969+
fallthrough;
971970
default:
972971
sleep:
973972
set_current_state(TASK_UNINTERRUPTIBLE);
@@ -2935,7 +2934,7 @@ static void cfi_amdstd_sync (struct mtd_info *mtd)
29352934
* as the whole point is that nobody can do anything
29362935
* with the chip now anyway.
29372936
*/
2938-
/* fall through */
2937+
fallthrough;
29392938
case FL_SYNCING:
29402939
mutex_unlock(&chip->mutex);
29412940
break;

drivers/mtd/chips/cfi_cmdset_0020.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,7 @@ static inline int do_read_onechip(struct map_info *map, struct flchip *chip, lof
324324
case FL_JEDEC_QUERY:
325325
map_write(map, CMD(0x70), cmd_addr);
326326
chip->state = FL_STATUS;
327-
/* Fall through */
328-
327+
fallthrough;
329328
case FL_STATUS:
330329
status = map_read(map, cmd_addr);
331330
if (map_word_andequal(map, status, status_OK, status_OK)) {
@@ -462,8 +461,7 @@ static int do_write_buffer(struct map_info *map, struct flchip *chip,
462461
#ifdef DEBUG_CFI_FEATURES
463462
printk("%s: 1 status[%x]\n", __func__, map_read(map, cmd_adr));
464463
#endif
465-
/* Fall through */
466-
464+
fallthrough;
467465
case FL_STATUS:
468466
status = map_read(map, cmd_adr);
469467
if (map_word_andequal(map, status, status_OK, status_OK))
@@ -756,8 +754,7 @@ static inline int do_erase_oneblock(struct map_info *map, struct flchip *chip, u
756754
case FL_READY:
757755
map_write(map, CMD(0x70), adr);
758756
chip->state = FL_STATUS;
759-
/* Fall through */
760-
757+
fallthrough;
761758
case FL_STATUS:
762759
status = map_read(map, adr);
763760
if (map_word_andequal(map, status, status_OK, status_OK))
@@ -998,7 +995,7 @@ static void cfi_staa_sync (struct mtd_info *mtd)
998995
* as the whole point is that nobody can do anything
999996
* with the chip now anyway.
1000997
*/
1001-
/* Fall through */
998+
fallthrough;
1002999
case FL_SYNCING:
10031000
mutex_unlock(&chip->mutex);
10041001
break;
@@ -1054,8 +1051,7 @@ static inline int do_lock_oneblock(struct map_info *map, struct flchip *chip, un
10541051
case FL_READY:
10551052
map_write(map, CMD(0x70), adr);
10561053
chip->state = FL_STATUS;
1057-
/* Fall through */
1058-
1054+
fallthrough;
10591055
case FL_STATUS:
10601056
status = map_read(map, adr);
10611057
if (map_word_andequal(map, status, status_OK, status_OK))
@@ -1201,8 +1197,7 @@ static inline int do_unlock_oneblock(struct map_info *map, struct flchip *chip,
12011197
case FL_READY:
12021198
map_write(map, CMD(0x70), adr);
12031199
chip->state = FL_STATUS;
1204-
/* Fall through */
1205-
1200+
fallthrough;
12061201
case FL_STATUS:
12071202
status = map_read(map, adr);
12081203
if (map_word_andequal(map, status, status_OK, status_OK))

drivers/mtd/chips/cfi_util.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@ map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cfi_private *cfi
109109
case 8:
110110
onecmd |= (onecmd << (chip_mode * 32));
111111
#endif
112-
/* fall through */
112+
fallthrough;
113113
case 4:
114114
onecmd |= (onecmd << (chip_mode * 16));
115-
/* fall through */
115+
fallthrough;
116116
case 2:
117117
onecmd |= (onecmd << (chip_mode * 8));
118-
/* fall through */
118+
fallthrough;
119119
case 1:
120120
;
121121
}
@@ -165,13 +165,13 @@ unsigned long cfi_merge_status(map_word val, struct map_info *map,
165165
case 8:
166166
res |= (onestat >> (chip_mode * 32));
167167
#endif
168-
/* fall through */
168+
fallthrough;
169169
case 4:
170170
res |= (onestat >> (chip_mode * 16));
171-
/* fall through */
171+
fallthrough;
172172
case 2:
173173
res |= (onestat >> (chip_mode * 8));
174-
/* fall through */
174+
fallthrough;
175175
case 1:
176176
;
177177
}

drivers/mtd/devices/block2mtd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,10 @@ static int ustrtoul(const char *cp, char **endp, unsigned int base)
329329
switch (**endp) {
330330
case 'G' :
331331
result *= 1024;
332-
/* fall through */
332+
fallthrough;
333333
case 'M':
334334
result *= 1024;
335-
/* fall through */
335+
fallthrough;
336336
case 'K':
337337
case 'k':
338338
result *= 1024;

drivers/mtd/devices/phram.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ static int parse_num64(uint64_t *num64, char *token)
148148
switch (token[len - 2]) {
149149
case 'G':
150150
shift += 10;
151-
/* fall through */
151+
fallthrough;
152152
case 'M':
153153
shift += 10;
154-
/* fall through */
154+
fallthrough;
155155
case 'k':
156156
shift += 10;
157157
token[len - 2] = 0;

drivers/mtd/lpddr/lpddr_cmds.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,7 @@ static int chip_ready(struct map_info *map, struct flchip *chip, int mode)
304304
/* Only if there's no operation suspended... */
305305
if (mode == FL_READY && chip->oldstate == FL_READY)
306306
return 0;
307-
/* fall through */
308-
307+
fallthrough;
309308
default:
310309
sleep:
311310
set_current_state(TASK_UNINTERRUPTIBLE);

drivers/mtd/maps/sa1100-flash.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ static int sa1100_probe_subdev(struct sa_subdev_info *subdev, struct resource *r
8181
default:
8282
printk(KERN_WARNING "SA1100 flash: unknown base address "
8383
"0x%08lx, assuming CS0\n", phys);
84-
/* Fall through */
85-
84+
fallthrough;
8685
case SA1100_CS0_PHYS:
8786
subdev->map.bankwidth = (MSC0 & MSC_RBW) ? 2 : 4;
8887
break;

drivers/mtd/nand/onenand/onenand_base.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3259,7 +3259,7 @@ static void onenand_check_features(struct mtd_info *mtd)
32593259
switch (density) {
32603260
case ONENAND_DEVICE_DENSITY_8Gb:
32613261
this->options |= ONENAND_HAS_NOP_1;
3262-
/* fall through */
3262+
fallthrough;
32633263
case ONENAND_DEVICE_DENSITY_4Gb:
32643264
if (ONENAND_IS_DDP(this))
32653265
this->options |= ONENAND_HAS_2PLANE;

drivers/mtd/nand/raw/diskonchip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1482,7 +1482,7 @@ static int __init doc_probe(unsigned long physadr)
14821482
break;
14831483
case DOC_ChipID_DocMilPlus32:
14841484
pr_err("DiskOnChip Millennium Plus 32MB is not supported, ignoring.\n");
1485-
/* fall through */
1485+
fallthrough;
14861486
default:
14871487
ret = -ENODEV;
14881488
goto notfound;

0 commit comments

Comments
 (0)