Skip to contentSkip to conversation

staging: iio: frequency: ad9834: Remove unnecessary parentheses

PATCH In review Melissa Wen 2 participants 2 messages Apr 2, 2019 – Apr 7, 2019

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

PATCH 1/1 staging: iio: frequency: ad9834: Remove unnecessary parentheses

Remove unneeded parentheses around the arguments of ||. This reduces clutter and code behave in the same way. Change suggested by checkpatch.pl.

CHECK: Unnecessary parentheses around 'st->devid == ID_AD9833'
CHECK: Unnecessary parentheses around 'st->devid == ID_AD9837'

---
 drivers/staging/iio/frequency/ad9834.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/iio/frequency/ad9834.c +1 -1
index 0b0287503fb4..9cc6e751b479 100644
@@ -286,7 +286,7 @@ ssize_t ad9834_show_out0_wavetype_available(struct device *dev,
 	struct ad9834_state *st = iio_priv(indio_dev);
 	char *str;
 
-	if ((st->devid == ID_AD9833) || (st->devid == ID_AD9837))
+	if (st->devid == ID_AD9833 || st->devid == ID_AD9837)
 		str = "sine triangle square";
 	else if (st->control & AD9834_OPBITEN)
 		str = "sine";
Signature · 1 line
2.20.1
maintainer
#1 lore raw
Quoted 8 lines · On Tue, 2 Apr 2019 17:18:54 -0300 Melissa Wen <[email protected]> wrote:

Remove unneeded parentheses around the arguments of ||. This reduces clutter and code behave in the same way. Change suggested by checkpatch.pl.

CHECK: Unnecessary parentheses around 'st->devid == ID_AD9833'
CHECK: Unnecessary parentheses around 'st->devid == ID_AD9837'

This isn't one I feel strongly about, but it'll get rid of the warning so is useful in the sense of cleaning up what we have to look at there!

Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it.

Thanks,

Jonathan

Quoted 17 lines
---
 drivers/staging/iio/frequency/ad9834.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/iio/frequency/ad9834.c +1 -1
index 0b0287503fb4..9cc6e751b479 100644
@@ -286,7 +286,7 @@ ssize_t ad9834_show_out0_wavetype_available(struct device *dev,
 	struct ad9834_state *st = iio_priv(indio_dev);
 	char *str;
 
-	if ((st->devid == ID_AD9833) || (st->devid == ID_AD9837))
+	if (st->devid == ID_AD9833 || st->devid == ID_AD9837)
 		str = "sine triangle square";
 	else if (st->control & AD9834_OPBITEN)
 		str = "sine";