diff mbox

iio: sca3000: Mark expected switch fall-through

Message ID 20180703193934.GA13572@embeddedor.com (mailing list archive)
State New, archived
Headers show

Commit Message

Gustavo A. R. Silva July 3, 2018, 7:39 p.m. UTC
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(+)

Comments

Jonathan Cameron July 7, 2018, 5:03 p.m. UTC | #1
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;
>  	}

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Gustavo A. R. Silva July 7, 2018, 5:22 p.m. UTC | #2
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
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;
 	}