Skip to contentSkip to conversation

Input: adxl34x - avoid int-in-bool-context warning

PATCH In review Steven Joruk 2 participants 2 messages Sep 18, 2017 – Sep 20, 2017

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

PATCH 1/1 Input: adxl34x - avoid int-in-bool-context warning

The code is fine, but make it clear to the compiler.

drivers/input/misc/adxl34x.c:134:35: warning: ‘<<’ in boolean context

---
 drivers/input/misc/adxl34x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/misc/adxl34x.c +1 -1
index 2b2d02f408bb..e0caaa0de454 100644
@@ -796,7 +796,7 @@ struct adxl34x *adxl34x_probe(struct device *dev, int irq,
 
 	if (pdata->watermark) {
 		ac->int_mask |= WATERMARK;
-		if (!FIFO_MODE(pdata->fifo_mode))
+		if (FIFO_MODE(pdata->fifo_mode) == 0)
 			ac->pdata.fifo_mode |= FIFO_STREAM;
 	} else {
 		ac->int_mask |= DATA_READY;
Signature · 1 line
2.14.1
maintainer
#1 lore raw
Quoted 14 lines · Steven Joruk

The code is fine, but make it clear to the compiler.

drivers/input/misc/adxl34x.c:134:35: warning: ‘<<’ in boolean context

---
 drivers/input/misc/adxl34x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/misc/adxl34x.c +0 -0
index 2b2d02f408bb..e0caaa0de454 100644

drivers/input/misc/adxl34x.c struct adxl34x *adxl34x_probe(struct device *dev, int irq, · line 799

Quoted 5 lines
drivers/input/misc/adxl34x.c +1 -1
@@ -796,7 +796,7 @@ struct adxl34x *adxl34x_probe(struct device *dev, int irq,
 
 	if (pdata->watermark) {
 		ac->int_mask |= WATERMARK;
-		if (!FIFO_MODE(pdata->fifo_mode))
+		if (FIFO_MODE(pdata->fifo_mode) == 0)

This has been NAKed before:

https://www.spinics.net/lists/linux-ide/msg54485.html

I'll pick up the V2 from Arnd that is better.

Quoted 6 lines
drivers/input/misc/adxl34x.c +0 -0
 			ac->pdata.fifo_mode |= FIFO_STREAM;
 	} else {
 		ac->int_mask |= DATA_READY;
Signature · 1 line
2.14.1

Thanks.

Signature · 1 line
Dmitry