iio:chemical:sps30 Suppress some switch fallthrough warnings.
Subsystems (2)
Jonathan Cameron
maintainerPATCH 1/1 iio:chemical:sps30 Suppress some switch fallthrough warnings.
Fixes warnings reported on linux-next but marking one path and adding an explicit return in the other.
---
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(+)
drivers/iio/chemical/sps30.c +3 -0
@@ -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 ;
Signature · 1 line
2.20.1
Quoted 3 lines · Jonathan Cameron
Fixes warnings reported on linux-next but marking one path and adding an explicit return in the other.
Looks good.
Quoted 33 lines
Signed-off-by Jonathan Cameron <[email protected]>Cc Andreas Brauchli <[email protected]>---
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(+)drivers/iio/chemical/sps30.c +3
-1@@ -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
Quoted 8 lines · On Sat, 9 Feb 2019 21:12:10 +0100 Tomasz Duszynski <[email protected]> wrote:
Quoted 3 lines · Jonathan Cameron
Fixes warnings reported on linux-next but marking one path and adding an explicit return in the other.
Looks good.
Acked-by Tomasz Duszynski <[email protected]>
Thanks,
Applied to the togreg branch of iio.git.
Jonathan
Quoted 34 lines
Quoted 34 lines
Signed-off-by Jonathan Cameron <[email protected]>Cc Andreas Brauchli <[email protected]>---
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(+)drivers/iio/chemical/sps30.c +3
-1@@ -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