mtd: cfi_cmdset_0002: Mark expected switch fall-throughs
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Fri, 8 Feb 2019 18:06:15 +0000 (12:06 -0600)
committerRichard Weinberger <richard@nod.at>
Mon, 6 May 2019 19:57:05 +0000 (21:57 +0200)
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_cmdset_0002.c: In function ‘get_chip’:
drivers/mtd/chips/cfi_cmdset_0002.c:870:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (mode == FL_READY && chip->oldstate == FL_READY)
      ^
drivers/mtd/chips/cfi_cmdset_0002.c:873:2: note: here
  default:
  ^~~~~~~
drivers/mtd/chips/cfi_cmdset_0002.c: In function ‘cfi_amdstd_sync’:
drivers/mtd/chips/cfi_cmdset_0002.c:2745:16: warning: this statement may fall through [-Wimplicit-fallthrough=]
    chip->state = FL_SYNCING;
    ~~~~~~~~~~~~^~~~~~~~~~~~
drivers/mtd/chips/cfi_cmdset_0002.c:2750:3: note: here
   case FL_SYNCING:
   ^~~~

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: Tokunori Ikegami <ikegami.t@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
drivers/mtd/chips/cfi_cmdset_0002.c

index 7b7286b4d81ef660d22a9ca93e5f0f2870ea5666..c8fa5906bdf9a2a3b9fb356032e59a7617cce165 100644 (file)
@@ -869,6 +869,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 */
 
        default:
        sleep:
@@ -2751,6 +2752,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 */
                case FL_SYNCING:
                        mutex_unlock(&chip->mutex);
                        break;