From: Dan Carpenter Date: Tue, 26 Aug 2014 07:55:51 +0000 (+0300) Subject: staging: comedi: amplc_pci230: fix a precedence bug X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=94254d1baec765b22cc5df3a9a16a8cc9a79d406;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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,