From ebe168069324b0a182f74bef593240840e4da97e Mon Sep 17 00:00:00 2001 From: Slawomir Stepien Date: Thu, 14 Apr 2016 21:36:33 +0200 Subject: iio: light apds9960: fix wrong use of brace This fixes the error reported by checkpatch.pl: ERROR: that open brace { should be on the previous line Signed-off-by: Slawomir Stepien Signed-off-by: Jonathan Cameron --- drivers/iio/light/apds9960.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'drivers/iio/light/apds9960.c') diff --git a/drivers/iio/light/apds9960.c b/drivers/iio/light/apds9960.c index f6a07dc32ae4..47fcd5ad4ff2 100644 --- a/drivers/iio/light/apds9960.c +++ b/drivers/iio/light/apds9960.c @@ -321,8 +321,12 @@ static const struct iio_chan_spec apds9960_channels[] = { }; /* integration time in us */ -static const int apds9960_int_time[][2] = - { {28000, 246}, {100000, 219}, {200000, 182}, {700000, 0} }; +static const int apds9960_int_time[][2] = { + { 28000, 246}, + {100000, 219}, + {200000, 182}, + {700000, 0} +}; /* gain mapping */ static const int apds9960_pxs_gain_map[] = {1, 2, 4, 8}; -- cgit v1.2.3 From f21122593d99c7e051891da1b148c771b7d56e07 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 22 Apr 2016 13:04:14 +0300 Subject: iio: light: apds9960: silence uninitialized variable warning It causes a static checker warning if we use "buf" on the failure path so move that inside the if statement. Signed-off-by: Dan Carpenter Signed-off-by: Jonathan Cameron --- drivers/iio/light/apds9960.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/iio/light/apds9960.c') diff --git a/drivers/iio/light/apds9960.c b/drivers/iio/light/apds9960.c index 47fcd5ad4ff2..35928fb1b66a 100644 --- a/drivers/iio/light/apds9960.c +++ b/drivers/iio/light/apds9960.c @@ -495,9 +495,10 @@ static int apds9960_read_raw(struct iio_dev *indio_dev, case IIO_INTENSITY: ret = regmap_bulk_read(data->regmap, chan->address, &buf, 2); - if (!ret) + if (!ret) { ret = IIO_VAL_INT; - *val = le16_to_cpu(buf); + *val = le16_to_cpu(buf); + } break; default: ret = -EINVAL; -- cgit v1.2.3