Skip to contentSkip to conversation

staging: comedi: amplc_pci230: fix a precedence bug

PATCH New Dan Carpenter 1 participant 1 message Aug 26, 2014

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

PATCH 1/1 staging: comedi: amplc_pci230: fix a precedence bug

The addition operation has higher precedence than ?: so this would write to PCI230_DACOUT1 instead of devpriv->daqio + PCI230_DACOUT1.

Fixes 4f9c63fe5333 ('staging: comedi: amplc_pci230: refactor iobase addresses')
drivers/staging/comedi/drivers/amplc_pci230.c +1 -1
index 0fd212f..60d21e0 100644
@@ -628,7 +628,7 @@ static inline void pci230_ao_write_nofifo(struct comedi_device *dev,
 
 	/* Write mangled datum to appropriate DACOUT register. */
 	outw(pci230_ao_mangle_datum(dev, datum),
-	     devpriv->daqio + ((chan) = 0) ? PCI230_DACOUT1 : PCI230_DACOUT2);
+	     devpriv->daqio + ((chan = 0) ? PCI230_DACOUT1 : PCI230_DACOUT2));
 }
 
 static inline void pci230_ao_write_fifo(struct comedi_device *dev,