a1c0b3ddca87a9e2ec96790b4a77e46fdcdddc90
[oweals/openwrt.git] /
1 From 59b9bb0abca9efe47207301dbaf0d1beee2bd0f7 Mon Sep 17 00:00:00 2001
2 From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
3 Date: Sat, 9 Feb 2019 19:32:58 +0000
4 Subject: [PATCH] iio:chemical:sps30 Supress some switch fallthrough warnings.
5
6 Fixes warnings reported on linux-next but marking one path
7 and adding an explicit return in the other.
8
9 Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
10 Cc: Andreas Brauchli <a.brauchli@elementarea.net>
11 Acked-by: Tomasz Duszynski <tduszyns@gmail.com>
12 ---
13  drivers/iio/chemical/sps30.c | 3 +++
14  1 file changed, 3 insertions(+)
15
16 diff --git a/drivers/iio/chemical/sps30.c b/drivers/iio/chemical/sps30.c
17 index 375df5060ed5..edbb956e81e8 100644
18 --- a/drivers/iio/chemical/sps30.c
19 +++ b/drivers/iio/chemical/sps30.c
20 @@ -118,6 +118,7 @@ static int sps30_do_cmd(struct sps30_state *state, u16 cmd, u8 *data, int size)
21         case SPS30_READ_AUTO_CLEANING_PERIOD:
22                 buf[0] = SPS30_AUTO_CLEANING_PERIOD >> 8;
23                 buf[1] = (u8)SPS30_AUTO_CLEANING_PERIOD;
24 +               /* fall through */
25         case SPS30_READ_DATA_READY_FLAG:
26         case SPS30_READ_DATA:
27         case SPS30_READ_SERIAL:
28 @@ -295,6 +296,8 @@ static int sps30_read_raw(struct iio_dev *indio_dev,
29                                 *val2 = 10000;
30  
31                                 return IIO_VAL_INT_PLUS_MICRO;
32 +                       default:
33 +                               return -EINVAL;
34                         }
35                 default:
36                         return -EINVAL;