Skip to contentSkip to conversation

iio: mma8452: Mark expected switch fall-through

PATCH In review Gustavo A. R. Silva 2 participants 2 messages Jul 3, 2018 – Jul 7, 2018 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: mma8452: Mark expected switch fall-through

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

Warning level 2 was used in this case: -Wimplicit-fallthrough=2

---
 drivers/iio/accel/mma8452.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/accel/mma8452.c +1 -0
index c149c9c..421a0a8 100644
@@ -1547,6 +1547,7 @@ static int mma8452_probe(struct i2c_client *client,
 	case FXLS8471_DEVICE_ID:
 		if (ret == data->chip_info->chip_id)
 			break;
+		/* else: fall through */
 	default:
 		return -ENODEV;
 	}
Signature · 1 line
2.7.4
maintainer
#1 lore raw
Quoted 6 lines · On Tue, 3 Jul 2018 14:44:36 -0500 "Gustavo A. R. Silva"…

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

Warning level 2 was used in this case: -Wimplicit-fallthrough=2

Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to ignore.

Thanks,

Jonathan

Quoted 16 lines
---
 drivers/iio/accel/mma8452.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/accel/mma8452.c +1 -0
index c149c9c..421a0a8 100644
@@ -1547,6 +1547,7 @@ static int mma8452_probe(struct i2c_client *client,
 	case FXLS8471_DEVICE_ID:
 		if (ret == data->chip_info->chip_id)
 			break;
+		/* else: fall through */
 	default:
 		return -ENODEV;
 	}