Skip to contentSkip to conversation

UBI: mark expected switch fall-throughs

PATCH New Gustavo A. R. Silva 1 participant 1 message Oct 5, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 UBI: mark expected switch fall-throughs

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

Addresses-Coverity-ID: 1373884 ("Missing break in switch")
Addresses-Coverity-ID: 114869 ("Missing break in switch")
Addresses-Coverity-ID: 114870 ("Missing break in switch")

---
 drivers/mtd/ubi/attach.c | 1 +
 drivers/mtd/ubi/build.c  | 2 ++
 2 files changed, 3 insertions(+)
drivers/mtd/ubi/attach.c +1 -0
index 93ceea4..e294d39 100644
@@ -1072,6 +1072,7 @@ static int scan_peb(struct ubi_device *ubi, struct ubi_attach_info *ai,
 			 * be a result of power cut during erasure.
 			 */
 			ai->maybe_bad_peb_count += 1;
+		/* fall through */
 	case UBI_IO_BAD_HDR:
 			/*
 			 * If we're facing a bad VID header we have to drop *all*
drivers/mtd/ubi/build.c +2 -0
index d2a7266..a4e3454 100644
@@ -1334,8 +1334,10 @@ static int bytes_str_to_int(const char *str)
 	switch (*endp) {
 	case 'G':
 		result *= 1024;
+		/* fall through */
 	case 'M':
 		result *= 1024;
+		/* fall through */
 	case 'K':
 		result *= 1024;
 		if (endp[1] == 'i' && endp[2] == 'B')
Signature · 1 line
2.7.4