Commit 025a06c1 authored by Miquel Raynal's avatar Miquel Raynal
Browse files

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: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Acked-by: default avatarVignesh Raghavendra <vigneshr@ti.com>
Acked-by: default avatarTudor Ambarus <tudor.ambarus@microchip.com>
Acked-by: default avatarRichard Weinberger <richard@nod.at>
Link: https://lore.kernel.org/linux-mtd/20200325212115.14170-1-miquel.raynal@bootlin.com
parent 699274b1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -834,7 +834,7 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long
			/* Someone else might have been playing with it. */
			return -EAGAIN;
		}
		/* Fall through */
		fallthrough;
	case FL_READY:
	case FL_CFI_QUERY:
	case FL_JEDEC_QUERY:
@@ -907,7 +907,7 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long
		/* Only if there's no operation suspended... */
		if (mode == FL_READY && chip->oldstate == FL_READY)
			return 0;
		/* Fall through */
		fallthrough;
	default:
	sleep:
		set_current_state(TASK_UNINTERRUPTIBLE);
+2 −3
Original line number Diff line number Diff line
@@ -966,8 +966,7 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr
		/* Only if there's no operation suspended... */
		if (mode == FL_READY && chip->oldstate == FL_READY)
			return 0;
		/* fall through */

		fallthrough;
	default:
	sleep:
		set_current_state(TASK_UNINTERRUPTIBLE);
@@ -2935,7 +2934,7 @@ static void cfi_amdstd_sync (struct mtd_info *mtd)
			 * as the whole point is that nobody can do anything
			 * with the chip now anyway.
			 */
			/* fall through */
			fallthrough;
		case FL_SYNCING:
			mutex_unlock(&chip->mutex);
			break;
+6 −11
Original line number Diff line number Diff line
@@ -324,8 +324,7 @@ static inline int do_read_onechip(struct map_info *map, struct flchip *chip, lof
	case FL_JEDEC_QUERY:
		map_write(map, CMD(0x70), cmd_addr);
		chip->state = FL_STATUS;
		/* Fall through */

		fallthrough;
	case FL_STATUS:
		status = map_read(map, cmd_addr);
		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,
#ifdef DEBUG_CFI_FEATURES
	printk("%s: 1 status[%x]\n", __func__, map_read(map, cmd_adr));
#endif
		/* Fall through */

		fallthrough;
	case FL_STATUS:
		status = map_read(map, cmd_adr);
		if (map_word_andequal(map, status, status_OK, status_OK))
@@ -756,8 +754,7 @@ retry:
	case FL_READY:
		map_write(map, CMD(0x70), adr);
		chip->state = FL_STATUS;
		/* Fall through */

		fallthrough;
	case FL_STATUS:
		status = map_read(map, adr);
		if (map_word_andequal(map, status, status_OK, status_OK))
@@ -998,7 +995,7 @@ static void cfi_staa_sync (struct mtd_info *mtd)
			 * as the whole point is that nobody can do anything
			 * with the chip now anyway.
			 */
			/* Fall through */
			fallthrough;
		case FL_SYNCING:
			mutex_unlock(&chip->mutex);
			break;
@@ -1054,8 +1051,7 @@ retry:
	case FL_READY:
		map_write(map, CMD(0x70), adr);
		chip->state = FL_STATUS;
		/* Fall through */

		fallthrough;
	case FL_STATUS:
		status = map_read(map, adr);
		if (map_word_andequal(map, status, status_OK, status_OK))
@@ -1201,8 +1197,7 @@ retry:
	case FL_READY:
		map_write(map, CMD(0x70), adr);
		chip->state = FL_STATUS;
		/* Fall through */

		fallthrough;
	case FL_STATUS:
		status = map_read(map, adr);
		if (map_word_andequal(map, status, status_OK, status_OK))
+6 −6
Original line number Diff line number Diff line
@@ -109,13 +109,13 @@ map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cfi_private *cfi
	case 8:
		onecmd |= (onecmd << (chip_mode * 32));
#endif
		/* fall through */
		fallthrough;
	case 4:
		onecmd |= (onecmd << (chip_mode * 16));
		/* fall through */
		fallthrough;
	case 2:
		onecmd |= (onecmd << (chip_mode * 8));
		/* fall through */
		fallthrough;
	case 1:
		;
	}
@@ -165,13 +165,13 @@ unsigned long cfi_merge_status(map_word val, struct map_info *map,
	case 8:
		res |= (onestat >> (chip_mode * 32));
#endif
		/* fall through */
		fallthrough;
	case 4:
		res |= (onestat >> (chip_mode * 16));
		/* fall through */
		fallthrough;
	case 2:
		res |= (onestat >> (chip_mode * 8));
		/* fall through */
		fallthrough;
	case 1:
		;
	}
+2 −2
Original line number Diff line number Diff line
@@ -329,10 +329,10 @@ static int ustrtoul(const char *cp, char **endp, unsigned int base)
	switch (**endp) {
	case 'G' :
		result *= 1024;
		/* fall through */
		fallthrough;
	case 'M':
		result *= 1024;
		/* fall through */
		fallthrough;
	case 'K':
	case 'k':
		result *= 1024;
Loading