linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: cfi_cmdset_0020: Mark expected switch fall-throughs
@ 2018-08-15 17:02 Gustavo A. R. Silva
  2018-11-09 19:40 ` Boris Brezillon
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2018-08-15 17:02 UTC (permalink / raw)
  To: David Woodhouse, Brian Norris, Boris Brezillon, Marek Vasut,
	Richard Weinberger
  Cc: linux-mtd, linux-kernel, Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 114857 ("Missing break in switch")
Addresses-Coverity-ID: 114858 ("Missing break in switch")
Addresses-Coverity-ID: 114859 ("Missing break in switch")
Addresses-Coverity-ID: 114860 ("Missing break in switch")
Addresses-Coverity-ID: 114861 ("Missing break in switch")
Addresses-Coverity-ID: 114862 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/mtd/chips/cfi_cmdset_0020.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c
index 35aa72b..e752067 100644
--- a/drivers/mtd/chips/cfi_cmdset_0020.c
+++ b/drivers/mtd/chips/cfi_cmdset_0020.c
@@ -324,6 +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 */
 
 	case FL_STATUS:
 		status = map_read(map, cmd_addr);
@@ -461,6 +462,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 */
 
 	case FL_STATUS:
 		status = map_read(map, cmd_adr);
@@ -754,6 +756,7 @@ static inline int do_erase_oneblock(struct map_info *map, struct flchip *chip, u
 	case FL_READY:
 		map_write(map, CMD(0x70), adr);
 		chip->state = FL_STATUS;
+		/* Fall through */
 
 	case FL_STATUS:
 		status = map_read(map, adr);
@@ -995,6 +998,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 */
 		case FL_SYNCING:
 			mutex_unlock(&chip->mutex);
 			break;
@@ -1050,6 +1054,7 @@ static inline int do_lock_oneblock(struct map_info *map, struct flchip *chip, un
 	case FL_READY:
 		map_write(map, CMD(0x70), adr);
 		chip->state = FL_STATUS;
+		/* Fall through */
 
 	case FL_STATUS:
 		status = map_read(map, adr);
@@ -1196,6 +1201,7 @@ static inline int do_unlock_oneblock(struct map_info *map, struct flchip *chip,
 	case FL_READY:
 		map_write(map, CMD(0x70), adr);
 		chip->state = FL_STATUS;
+		/* Fall through */
 
 	case FL_STATUS:
 		status = map_read(map, adr);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: mtd: cfi_cmdset_0020: Mark expected switch fall-throughs
  2018-08-15 17:02 [PATCH] mtd: cfi_cmdset_0020: Mark expected switch fall-throughs Gustavo A. R. Silva
@ 2018-11-09 19:40 ` Boris Brezillon
  2018-11-09 20:31   ` Gustavo A. R. Silva
  0 siblings, 1 reply; 3+ messages in thread
From: Boris Brezillon @ 2018-11-09 19:40 UTC (permalink / raw)
  To: Gustavo A. R. Silva, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger
  Cc: Boris Brezillon, linux-mtd, linux-kernel

On Wed, 2018-08-15 at 17:02:26 UTC, "Gustavo A. R. Silva" wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
> 
> Addresses-Coverity-ID: 114857 ("Missing break in switch")
> Addresses-Coverity-ID: 114858 ("Missing break in switch")
> Addresses-Coverity-ID: 114859 ("Missing break in switch")
> Addresses-Coverity-ID: 114860 ("Missing break in switch")
> Addresses-Coverity-ID: 114861 ("Missing break in switch")
> Addresses-Coverity-ID: 114862 ("Missing break in switch")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Applied to http://git.infradead.org/linux-mtd.git mtd/next, thanks.

Boris

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mtd: cfi_cmdset_0020: Mark expected switch fall-throughs
  2018-11-09 19:40 ` Boris Brezillon
@ 2018-11-09 20:31   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2018-11-09 20:31 UTC (permalink / raw)
  To: Boris Brezillon, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger
  Cc: linux-mtd, linux-kernel



On 11/9/18 1:40 PM, Boris Brezillon wrote:
> 
> Applied to http://git.infradead.org/linux-mtd.git mtd/next, thanks.
> 

Thanks, Boris.
--
Gustavo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-09 20:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-15 17:02 [PATCH] mtd: cfi_cmdset_0020: Mark expected switch fall-throughs Gustavo A. R. Silva
2018-11-09 19:40 ` Boris Brezillon
2018-11-09 20:31   ` Gustavo A. R. Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).