From a73f630e45cad6cfe02181ca9fb34423d18b9806 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Tue, 17 Jan 2012 10:13:59 +0000 Subject: [PATCH] dt9812: Fix logical || vs bitwise |. Fix bug discovered by Dan Carpenter in the "staging" sources. In dt9212_configure_gain(), some bitmask constants were OR'ed together logically (giving the value 1) when they should have been OR'ed together bitwise. The effect of this bug is that the analog gain would be set incorrectly on the AI subdevice for certain ranges. As it happens, the driver is incomplete regarding range settings anyway, so the bug fix currently has no effect. Signed-off-by: Ian Abbott --- comedi/drivers/dt9812.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/comedi/drivers/dt9812.c b/comedi/drivers/dt9812.c index 226619e1..d91d33ba 100644 --- a/comedi/drivers/dt9812.c +++ b/comedi/drivers/dt9812.c @@ -305,7 +305,7 @@ static void dt9812_configure_gain(usb_dt9812_t * dev, // 11x -> Gain = 0.5 case DT9812_GAIN_0PT5:{ rmw->or_value = F020_MASK_ADC0CF_AMP0GN2 - || F020_MASK_ADC0CF_AMP0GN1; + | F020_MASK_ADC0CF_AMP0GN1; } break; case DT9812_GAIN_1:{ @@ -322,7 +322,7 @@ static void dt9812_configure_gain(usb_dt9812_t * dev, break; case DT9812_GAIN_8:{ rmw->or_value = F020_MASK_ADC0CF_AMP0GN1 - || F020_MASK_ADC0CF_AMP0GN0; + | F020_MASK_ADC0CF_AMP0GN0; } break; case DT9812_GAIN_16:{ -- 2.26.2