From 94254d1baec765b22cc5df3a9a16a8cc9a79d406 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 26 Aug 2014 10:55:51 +0300 Subject: [PATCH] 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') Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/amplc_pci230.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/amplc_pci230.c b/drivers/staging/comedi/drivers/amplc_pci230.c index 0da5a4a47961..cd63706ea941 100644 --- a/drivers/staging/comedi/drivers/amplc_pci230.c +++ b/drivers/staging/comedi/drivers/amplc_pci230.c @@ -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, -- 2.30.2