aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/backport-4.19/505-v5.1-iio-chemical-sps30-Supress-some-switch-fallthrough-w.patch
diff options
context:
space:
mode:
authorPetr Štetiar <ynezz@true.cz>2020-02-23 22:50:22 +0100
committerPetr Štetiar <ynezz@true.cz>2020-03-08 15:10:55 +0100
commitaae4d85647f27ca64d2012501636e41d5a8ab42a (patch)
treee49c8d7e536d23d510bd121e532e57eb4a4116ef /target/linux/generic/backport-4.19/505-v5.1-iio-chemical-sps30-Supress-some-switch-fallthrough-w.patch
parentea1823a8673a3f10aca418ca64b765f5c5a6e58f (diff)
downloadupstream-aae4d85647f27ca64d2012501636e41d5a8ab42a.tar.gz
upstream-aae4d85647f27ca64d2012501636e41d5a8ab42a.tar.bz2
upstream-aae4d85647f27ca64d2012501636e41d5a8ab42a.zip
kernel: add kernel module for Sensirion SPS30 PMS
Adds into 4.19 backported kernel module from 5.1 for Sensirion SPS30 particulate matter sensor, for kernel 5.4 backported dependency fix. Signed-off-by: Petr Štetiar <ynezz@true.cz>
Diffstat (limited to 'target/linux/generic/backport-4.19/505-v5.1-iio-chemical-sps30-Supress-some-switch-fallthrough-w.patch')
-rw-r--r--target/linux/generic/backport-4.19/505-v5.1-iio-chemical-sps30-Supress-some-switch-fallthrough-w.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/target/linux/generic/backport-4.19/505-v5.1-iio-chemical-sps30-Supress-some-switch-fallthrough-w.patch b/target/linux/generic/backport-4.19/505-v5.1-iio-chemical-sps30-Supress-some-switch-fallthrough-w.patch
new file mode 100644
index 0000000000..a1c0b3ddca
--- /dev/null
+++ b/target/linux/generic/backport-4.19/505-v5.1-iio-chemical-sps30-Supress-some-switch-fallthrough-w.patch
@@ -0,0 +1,36 @@
+From 59b9bb0abca9efe47207301dbaf0d1beee2bd0f7 Mon Sep 17 00:00:00 2001
+From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Date: Sat, 9 Feb 2019 19:32:58 +0000
+Subject: [PATCH] iio:chemical:sps30 Supress some switch fallthrough warnings.
+
+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>
+Acked-by: Tomasz Duszynski <tduszyns@gmail.com>
+---
+ 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;