Skip to contentSkip to conversation

staging/comedi: Use && instead of & for logical comparision

PATCH New Peter Huewe 1 participant 1 message Feb 14, 2013 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging/comedi: Use && instead of & for logical comparision

sparse complains that:
drivers/staging/comedi/drivers/adl_pci9118.c:813 pci9118_calc_divisors()
warn: maybe use && instead of &

usessh is used as a boolean flag (0 and 1) and is compared to a boolean value so we should use && here.

---
 drivers/staging/comedi/drivers/adl_pci9118.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/comedi/drivers/adl_pci9118.c +1 -1
index ef4dbe5..4dbac74 100644
@@ -810,7 +810,7 @@ static void pci9118_calc_divisors(char mode, struct comedi_device *dev,
 		*tim2 = *div1 * devpriv->i8254_osc_base;
 							/* real convert timer */
 
-		if (usessh & (chnsshfront == 0))	/* use BSSH signal */
+		if (usessh && (chnsshfront == 0))	/* use BSSH signal */
 			if (*div2 < (chans + 2))
 				*div2 = chans + 2;
 
Signature · 1 line
1.7.8.6