* [PATCH] iio:imu:adis: Mark expected switch fall-throughs
@ 2018-07-03 19:35 Gustavo A. R. Silva
2018-07-07 17:01 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2018-07-03 19:35 UTC (permalink / raw)
To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
Hartmut Knaack, Peter Meerwald-Stadler
Cc: linux-iio, linux-kernel, Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
drivers/iio/imu/adis.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/iio/imu/adis.c b/drivers/iio/imu/adis.c
index ad6f91d..c771ae6 100644
--- a/drivers/iio/imu/adis.c
+++ b/drivers/iio/imu/adis.c
@@ -81,9 +81,11 @@ int adis_write_reg(struct adis *adis, unsigned int reg,
adis->tx[9] = (value >> 24) & 0xff;
adis->tx[6] = ADIS_WRITE_REG(reg + 2);
adis->tx[7] = (value >> 16) & 0xff;
+ /* fall through */
case 2:
adis->tx[4] = ADIS_WRITE_REG(reg + 1);
adis->tx[5] = (value >> 8) & 0xff;
+ /* fall through */
case 1:
adis->tx[2] = ADIS_WRITE_REG(reg);
adis->tx[3] = value & 0xff;
@@ -167,6 +169,7 @@ int adis_read_reg(struct adis *adis, unsigned int reg,
adis->tx[2] = ADIS_READ_REG(reg + 2);
adis->tx[3] = 0;
spi_message_add_tail(&xfers[1], &msg);
+ /* fall through */
case 2:
adis->tx[4] = ADIS_READ_REG(reg);
adis->tx[5] = 0;
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iio:imu:adis: Mark expected switch fall-throughs
2018-07-03 19:35 [PATCH] iio:imu:adis: Mark expected switch fall-throughs Gustavo A. R. Silva
@ 2018-07-07 17:01 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2018-07-07 17:01 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack,
Peter Meerwald-Stadler, linux-iio, linux-kernel
On Tue, 3 Jul 2018 14:35:50 -0500
"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Applied to the togreg branch of iio.git and pushed out as
testing for the autobuilders to hopefully ignore!
Thanks,
Jonathan
> ---
> drivers/iio/imu/adis.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/iio/imu/adis.c b/drivers/iio/imu/adis.c
> index ad6f91d..c771ae6 100644
> --- a/drivers/iio/imu/adis.c
> +++ b/drivers/iio/imu/adis.c
> @@ -81,9 +81,11 @@ int adis_write_reg(struct adis *adis, unsigned int reg,
> adis->tx[9] = (value >> 24) & 0xff;
> adis->tx[6] = ADIS_WRITE_REG(reg + 2);
> adis->tx[7] = (value >> 16) & 0xff;
> + /* fall through */
> case 2:
> adis->tx[4] = ADIS_WRITE_REG(reg + 1);
> adis->tx[5] = (value >> 8) & 0xff;
> + /* fall through */
> case 1:
> adis->tx[2] = ADIS_WRITE_REG(reg);
> adis->tx[3] = value & 0xff;
> @@ -167,6 +169,7 @@ int adis_read_reg(struct adis *adis, unsigned int reg,
> adis->tx[2] = ADIS_READ_REG(reg + 2);
> adis->tx[3] = 0;
> spi_message_add_tail(&xfers[1], &msg);
> + /* fall through */
> case 2:
> adis->tx[4] = ADIS_READ_REG(reg);
> adis->tx[5] = 0;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-07-07 17:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-03 19:35 [PATCH] iio:imu:adis: Mark expected switch fall-throughs Gustavo A. R. Silva
2018-07-07 17:01 ` Jonathan Cameron
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).