All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: sca3000: Mark expected switch fall-through
@ 2018-07-03 19:39 Gustavo A. R. Silva
  2018-07-07 17:03 ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2018-07-03 19:39 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	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/accel/sca3000.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c
index 4dceb75..209b52a 100644
--- a/drivers/iio/accel/sca3000.c
+++ b/drivers/iio/accel/sca3000.c
@@ -797,6 +797,7 @@ static int sca3000_write_raw(struct iio_dev *indio_dev,
 		mutex_lock(&st->lock);
 		ret = sca3000_write_3db_freq(st, val);
 		mutex_unlock(&st->lock);
+		/* fall through */
 	default:
 		return -EINVAL;
 	}
-- 
2.7.4

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

* Re: [PATCH] iio: sca3000: Mark expected switch fall-through
  2018-07-03 19:39 [PATCH] iio: sca3000: Mark expected switch fall-through Gustavo A. R. Silva
@ 2018-07-07 17:03 ` Jonathan Cameron
  2018-07-07 17:22   ` Gustavo A. R. Silva
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2018-07-07 17:03 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, linux-kernel

On Tue, 3 Jul 2018 14:39:34 -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>

Looks like a bug to me not an unmarked fall through.

Should be return ret;

Do you want to do the patch?

Thanks,

Jonathan

> ---
>  drivers/iio/accel/sca3000.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c
> index 4dceb75..209b52a 100644
> --- a/drivers/iio/accel/sca3000.c
> +++ b/drivers/iio/accel/sca3000.c
> @@ -797,6 +797,7 @@ static int sca3000_write_raw(struct iio_dev *indio_dev,
>  		mutex_lock(&st->lock);
>  		ret = sca3000_write_3db_freq(st, val);
>  		mutex_unlock(&st->lock);
> +		/* fall through */
>  	default:
>  		return -EINVAL;
>  	}


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

* Re: [PATCH] iio: sca3000: Mark expected switch fall-through
  2018-07-07 17:03 ` Jonathan Cameron
@ 2018-07-07 17:22   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2018-07-07 17:22 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, linux-kernel

Hi Jonathan,

On 07/07/2018 12:03 PM, Jonathan Cameron wrote:
> On Tue, 3 Jul 2018 14:39:34 -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>
> 
> Looks like a bug to me not an unmarked fall through.
> 
> Should be return ret;
>

I see.

> Do you want to do the patch?
> 

Sure thing. I'll send a patch shortly.

Thanks for the feedback.
--
Gustavo

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

end of thread, other threads:[~2018-07-07 17:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-03 19:39 [PATCH] iio: sca3000: Mark expected switch fall-through Gustavo A. R. Silva
2018-07-07 17:03 ` Jonathan Cameron
2018-07-07 17:22   ` Gustavo A. R. Silva

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.