From 09971adc33bf49a31b16c84e05f525769e08cc60 Mon Sep 17 00:00:00 2001 From: Bhaktipriya Shridhar Date: Thu, 10 Mar 2016 22:41:53 +0530 Subject: [PATCH] staging: iio: addac: Remove unnecessary else after return This patch fixes the checkpatch warning that else is not generally useful after a break or return. This was done using Coccinelle: @@ expression e2; statement s1; @@ if(e2) { ... return ...; } -else s1 Signed-off-by: Bhaktipriya Shridhar Signed-off-by: Greg Kroah-Hartman --- drivers/staging/iio/addac/adt7316.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/staging/iio/addac/adt7316.c b/drivers/staging/iio/addac/adt7316.c index 3adc4516918c..a10e7d8e6002 100644 --- a/drivers/staging/iio/addac/adt7316.c +++ b/drivers/staging/iio/addac/adt7316.c @@ -465,9 +465,8 @@ static ssize_t adt7316_show_all_ad_channels(struct device *dev, return sprintf(buf, "0 - VDD\n1 - Internal Temperature\n" "2 - External Temperature or AIN1\n" "3 - AIN2\n4 - AIN3\n5 - AIN4\n"); - else - return sprintf(buf, "0 - VDD\n1 - Internal Temperature\n" - "2 - External Temperature\n"); + return sprintf(buf, "0 - VDD\n1 - Internal Temperature\n" + "2 - External Temperature\n"); } static IIO_DEVICE_ATTR(all_ad_channels, S_IRUGO, @@ -637,7 +636,7 @@ static ssize_t adt7316_show_da_high_resolution(struct device *dev, if (chip->config3 & ADT7316_DA_HIGH_RESOLUTION) { if (chip->id == ID_ADT7316 || chip->id == ID_ADT7516) return sprintf(buf, "1 (12 bits)\n"); - else if (chip->id == ID_ADT7317 || chip->id == ID_ADT7517) + if (chip->id == ID_ADT7317 || chip->id == ID_ADT7517) return sprintf(buf, "1 (10 bits)\n"); } @@ -919,8 +918,7 @@ static ssize_t adt7316_show_all_DAC_update_modes(struct device *dev, "1 - auto at MSB DAC AB and CD writing\n" "2 - auto at MSB DAC ABCD writing\n" "3 - manual\n"); - else - return sprintf(buf, "manual\n"); + return sprintf(buf, "manual\n"); } static IIO_DEVICE_ATTR(all_DAC_update_modes, S_IRUGO, @@ -1068,9 +1066,8 @@ static ssize_t adt7316_show_DAC_internal_Vref(struct device *dev, return sprintf(buf, "0x%x\n", (chip->dac_config & ADT7516_DAC_IN_VREF_MASK) >> ADT7516_DAC_IN_VREF_OFFSET); - else - return sprintf(buf, "%d\n", - !!(chip->dac_config & ADT7316_DAC_IN_VREF)); + return sprintf(buf, "%d\n", + !!(chip->dac_config & ADT7316_DAC_IN_VREF)); } static ssize_t adt7316_store_DAC_internal_Vref(struct device *dev, -- 2.39.5