Skip to contentSkip to conversation

Staging: iio: accel: Fixed else after return or break warning

PATCH New Yeliz Taneroglu 1 participant 1 message Feb 22, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: iio: accel: Fixed else after return or break warning

The following patch fixes the checkpatch.pl warning:
drivers/staging/iio/accel/adis16220_core.c warning: else is not generally useful after a break or return

---
 drivers/staging/iio/accel/adis16220_core.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/staging/iio/accel/adis16220_core.c +8 -8
index d9a1a14..5673edb 100644
@@ -323,17 +323,17 @@ static int adis16220_read_raw(struct iio_dev *indio_dev,
 		sval = (s16)(sval << (16 - bits)) >> (16 - bits);
 		*val = sval;
 		return IIO_VAL_INT;
-	} else {
-		ret = adis_read_reg_16(&st->adis, addr->addr, &uval);
-		if (ret)
-			return ret;
-		bits = addr->bits;
-		uval &= (1 << bits) - 1;
-		*val = uval;
-		return IIO_VAL_INT;
 	}
+	ret = adis_read_reg_16(&st->adis, addr->addr, &uval);
+	if (ret)
+		return ret;
+	bits = addr->bits;
+	uval &= (1 << bits) - 1;
+	*val = uval;
+	return IIO_VAL_INT;
 }
 
+
 static const struct iio_chan_spec adis16220_channels[] = {
 	{
 		.type = IIO_VOLTAGE,
Signature · 1 line
1.8.3.2