Skip to contentSkip to conversation

drivers: iio: adc: xilinx-xadc-events: Fixed a coding style warning.

PATCH In review Rakhi Sharma 2 participants 2 messages Feb 6, 2016

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

PATCH 2/2 drivers: iio: adc: xilinx-xadc-events: Fixed a coding style warning.

Fixed a warning.
WARNING: else is not generally useful after a break or return

---
 drivers/iio/adc/xilinx-xadc-events.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/xilinx-xadc-events.c +1 -1
index edcf3aa..61309b3 100644
@@ -92,7 +92,7 @@ static unsigned int xadc_get_alarm_mask(const struct iio_chan_spec *chan)
 {
 	if (chan->type == IIO_TEMP) {
 		return XADC_ALARM_OT_MASK;
-	} else {
+	}
 		switch (chan->channel) {
 		case 0:
 			return XADC_ALARM_VCCINT_MASK;
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 4 lines · Rakhi Sharma

Fixed a warning.
WARNING: else is not generally useful after a break or return

A worthwhile aim, though sometimes such an else statement can reflect a 'balance' in the code acting as a simple two element case statement.

However...
Please think through the results of your patches. You've just removed and open bracket without finding and removing the close bracket. Also an open bracket removal means that the code indentation of the next block is now wrong.

So, please revisit this patch, but next time make sure to at compile test it before posting the patch - you would have had both errors and warnings about the indenting from the result of this patch.

Jonathan

Quoted 18 lines
---
 drivers/iio/adc/xilinx-xadc-events.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/xilinx-xadc-events.c +1 -1
index edcf3aa..61309b3 100644
@@ -92,7 +92,7 @@ static unsigned int xadc_get_alarm_mask(const struct iio_chan_spec *chan)
 {
 	if (chan->type == IIO_TEMP) {
 		return XADC_ALARM_OT_MASK;
-	} else {
+	}
 		switch (chan->channel) {
 		case 0:
 			return XADC_ALARM_VCCINT_MASK;