Skip to contentSkip to conversation

iio:chemical:sps30 Suppress some switch fallthrough warnings.

PATCH In review Jonathan Cameron 2 participants 3 messages Feb 9, 2019 – Feb 11, 2019

Subsystems (2)
lore
Share & tools
lore

Jonathan Cameron

author maintainer
#0 lore raw

PATCH 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
index 375df5060ed5..edbb956e81e8 100644
@@ -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
maintainer Acked-by on v1 1/1
#1 lore raw
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

---
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
index 375df5060ed5..edbb956e81e8 100644
@@ -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

author maintainer Applied
#2 lore raw
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.

Thanks,

Applied to the togreg branch of iio.git.

Jonathan

Quoted 34 lines
Quoted 34 lines

---
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
index 375df5060ed5..edbb956e81e8 100644
@@ -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