Skip to contentSkip to conversation

eeprom: at25: mark expected switch fall-throughs

PATCH New Gustavo A. R. Silva 1 participant 1 message Jul 3, 2018 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eeprom: at25: mark expected switch fall-throughs

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

---
 drivers/misc/eeprom/at25.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/misc/eeprom/at25.c +4 -0
index 6a7d4a2..840afb3 100644
@@ -94,8 +94,10 @@ static int at25_ee_read(void *priv, unsigned int offset,
 	switch (at25->addrlen) {
 	default:	/* case 3 */
 		*cp++ = offset >> 16;
+		/* fall through */
 	case 2:
 		*cp++ = offset >> 8;
+		/* fall through */
 	case 1:
 	case 0:	/* can't happen: for better codegen */
 		*cp++ = offset >> 0;
@@ -180,8 +182,10 @@ static int at25_ee_write(void *priv, unsigned int off, void *val, size_t count)
 		switch (at25->addrlen) {
 		default:	/* case 3 */
 			*cp++ = offset >> 16;
+			/* fall through */
 		case 2:
 			*cp++ = offset >> 8;
+			/* fall through */
 		case 1:
 		case 0:	/* can't happen: for better codegen */
 			*cp++ = offset >> 0;
Signature · 1 line
2.7.4