mtd: lpddr_cmds: Mark expected switch fall-through
PATCH 1/1 mtd: lpddr_cmds: Mark expected switch fall-through
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
This patch fixes the following warning:
drivers/mtd/lpddr/lpddr_cmds.c: In function ‘chip_ready’:drivers/mtd/lpddr/lpddr_cmds.c:319:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (mode == FL_READY && chip->oldstate == FL_READY)
^
drivers/mtd/lpddr/lpddr_cmds.c:322:2: note: here
default:
^~~~~~~
Warning level 3 was used: -Wimplicit-fallthrough=3
This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.
--- drivers/mtd/lpddr/lpddr_cmds.c | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/lpddr/lpddr_cmds.c +1 -0
@@ -318,6 +318,7 @@ static int chip_ready(struct map_info *map, struct flchip *chip, int mode)/* Only if there's no operation suspended... */ if (mode ==FL_READY && chip->oldstate ==FL_READY )return 0 ; +/* fall through */ default : sleep:
Signature · 1 line
2.20.1
Quoted 9 lines · On Tue, 12 Feb 2019 09:31:31 -0600 "Gustavo A. R. Silva"…
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
This patch fixes the following warning:
drivers/mtd/lpddr/lpddr_cmds.c: In function ‘chip_ready’:drivers/mtd/lpddr/lpddr_cmds.c:319:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (mode ==FL_READY&&chip->oldstate==FL_READY)^
Quoted 9 lines
drivers/mtd/lpddr/lpddr_cmds.c:322:2: note: here
default:
^~~~~~~Warning level 3 was used: -Wimplicit-fallthrough=3
This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.
You sent me that one twice, is that expected? Is this a new version, and in that case, what has changed?
Quoted 17 lines
Signed-off-by Gustavo A. R. Silva <[email protected]>--- drivers/mtd/lpddr/lpddr_cmds.c | 1 + 1 file changed, 1 insertion(+)drivers/mtd/lpddr/lpddr_cmds.c +1
-0@@ -318,6 +318,7 @@ static int chip_ready(struct map_info *map, struct flchip *chip, int mode)/* Only if there's no operation suspended... */ if (mode ==FL_READY && chip->oldstate ==FL_READY )return 0 ; +/* fall through */ default : sleep:
Quoted 16 lines · Boris Brezillon
Quoted 13 lines · On Tue, 12 Feb 2019 09:31:31 -0600 "Gustavo A. R. Silva"…
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
This patch fixes the following warning:
drivers/mtd/lpddr/lpddr_cmds.c: In function ‘chip_ready’:drivers/mtd/lpddr/lpddr_cmds.c:319:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (mode ==FL_READY&&chip->oldstate==FL_READY)^
drivers/mtd/lpddr/lpddr_cmds.c:322:2: note: here
default:
^~~~~~~
Quoted 9 lines
Quoted 5 lines
Warning level 3 was used: -Wimplicit-fallthrough=3
This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.
You sent me that one twice, is that expected? Is this a new version, and in that case, what has changed?
Oh, it wasn't intentional. Both are exactly the same patch.
Sorry about that.
--
Gustavo