* [PATCH] iio:chemical:sps30 Suppress some switch fallthrough warnings.
@ 2019-02-09 19:39 Jonathan Cameron
2019-02-09 20:12 ` Tomasz Duszynski
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2019-02-09 19:39 UTC (permalink / raw)
To: linux-iio, Andreas Brauchli
Fixes warnings reported on linux-next but marking one path
and adding an explicit return in the other.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Andreas Brauchli <a.brauchli@elementarea.net>
---
I'd like to get this one into linux-next fairly quick so it anyone
has time to do a quick sanity check it would be much appreciated!
drivers/iio/chemical/sps30.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/iio/chemical/sps30.c b/drivers/iio/chemical/sps30.c
index 375df5060ed5..edbb956e81e8 100644
--- a/drivers/iio/chemical/sps30.c
+++ b/drivers/iio/chemical/sps30.c
@@ -118,6 +118,7 @@ static int sps30_do_cmd(struct sps30_state *state, u16 cmd, u8 *data, int size)
case SPS30_READ_AUTO_CLEANING_PERIOD:
buf[0] = SPS30_AUTO_CLEANING_PERIOD >> 8;
buf[1] = (u8)SPS30_AUTO_CLEANING_PERIOD;
+ /* fall through */
case SPS30_READ_DATA_READY_FLAG:
case SPS30_READ_DATA:
case SPS30_READ_SERIAL:
@@ -295,6 +296,8 @@ static int sps30_read_raw(struct iio_dev *indio_dev,
*val2 = 10000;
return IIO_VAL_INT_PLUS_MICRO;
+ default:
+ return -EINVAL;
}
default:
return -EINVAL;
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] iio:chemical:sps30 Suppress some switch fallthrough warnings.
2019-02-09 19:39 [PATCH] iio:chemical:sps30 Suppress some switch fallthrough warnings Jonathan Cameron
@ 2019-02-09 20:12 ` Tomasz Duszynski
2019-02-11 20:08 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Tomasz Duszynski @ 2019-02-09 20:12 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: linux-iio, Andreas Brauchli
On Sat, Feb 09, 2019 at 07:39:34PM +0000, Jonathan Cameron wrote:
> Fixes warnings reported on linux-next but marking one path
> and adding an explicit return in the other.
>
Looks good.
Acked-by: Tomasz Duszynski <tduszyns@gmail.com>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Andreas Brauchli <a.brauchli@elementarea.net>
> ---
> I'd like to get this one into linux-next fairly quick so it anyone
> has time to do a quick sanity check it would be much appreciated!
>
> drivers/iio/chemical/sps30.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/iio/chemical/sps30.c b/drivers/iio/chemical/sps30.c
> index 375df5060ed5..edbb956e81e8 100644
> --- a/drivers/iio/chemical/sps30.c
> +++ b/drivers/iio/chemical/sps30.c
> @@ -118,6 +118,7 @@ static int sps30_do_cmd(struct sps30_state *state, u16 cmd, u8 *data, int size)
> case SPS30_READ_AUTO_CLEANING_PERIOD:
> buf[0] = SPS30_AUTO_CLEANING_PERIOD >> 8;
> buf[1] = (u8)SPS30_AUTO_CLEANING_PERIOD;
> + /* fall through */
> case SPS30_READ_DATA_READY_FLAG:
> case SPS30_READ_DATA:
> case SPS30_READ_SERIAL:
> @@ -295,6 +296,8 @@ static int sps30_read_raw(struct iio_dev *indio_dev,
> *val2 = 10000;
>
> return IIO_VAL_INT_PLUS_MICRO;
> + default:
> + return -EINVAL;
> }
> default:
> return -EINVAL;
> --
> 2.20.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iio:chemical:sps30 Suppress some switch fallthrough warnings.
2019-02-09 20:12 ` Tomasz Duszynski
@ 2019-02-11 20:08 ` Jonathan Cameron
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2019-02-11 20:08 UTC (permalink / raw)
To: Tomasz Duszynski; +Cc: linux-iio, Andreas Brauchli
On Sat, 9 Feb 2019 21:12:10 +0100
Tomasz Duszynski <tduszyns@gmail.com> wrote:
> On Sat, Feb 09, 2019 at 07:39:34PM +0000, Jonathan Cameron wrote:
> > Fixes warnings reported on linux-next but marking one path
> > and adding an explicit return in the other.
> >
>
> Looks good.
>
> Acked-by: Tomasz Duszynski <tduszyns@gmail.com>
Thanks,
Applied to the togreg branch of iio.git.
Jonathan
>
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Cc: Andreas Brauchli <a.brauchli@elementarea.net>
> > ---
> > I'd like to get this one into linux-next fairly quick so it anyone
> > has time to do a quick sanity check it would be much appreciated!
> >
> > drivers/iio/chemical/sps30.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/iio/chemical/sps30.c b/drivers/iio/chemical/sps30.c
> > index 375df5060ed5..edbb956e81e8 100644
> > --- a/drivers/iio/chemical/sps30.c
> > +++ b/drivers/iio/chemical/sps30.c
> > @@ -118,6 +118,7 @@ static int sps30_do_cmd(struct sps30_state *state, u16 cmd, u8 *data, int size)
> > case SPS30_READ_AUTO_CLEANING_PERIOD:
> > buf[0] = SPS30_AUTO_CLEANING_PERIOD >> 8;
> > buf[1] = (u8)SPS30_AUTO_CLEANING_PERIOD;
> > + /* fall through */
> > case SPS30_READ_DATA_READY_FLAG:
> > case SPS30_READ_DATA:
> > case SPS30_READ_SERIAL:
> > @@ -295,6 +296,8 @@ static int sps30_read_raw(struct iio_dev *indio_dev,
> > *val2 = 10000;
> >
> > return IIO_VAL_INT_PLUS_MICRO;
> > + default:
> > + return -EINVAL;
> > }
> > default:
> > return -EINVAL;
> > --
> > 2.20.1
> >
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-02-11 20:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-09 19:39 [PATCH] iio:chemical:sps30 Suppress some switch fallthrough warnings Jonathan Cameron
2019-02-09 20:12 ` Tomasz Duszynski
2019-02-11 20:08 ` 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).