staging: comedi: amplc_pci230: fix a precedence bug
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 26 Aug 2014 07:55:51 +0000 (10:55 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 30 Aug 2014 20:28:15 +0000 (13:28 -0700)
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')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/amplc_pci230.c

index 0da5a4a47961ce1657e88ee99a98555522c2105c..cd63706ea941721a660dfacaf88b8f2459e752ba 100644 (file)
@@ -624,7 +624,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,