* [patch] Staging: comedi: logical || vs bitwise |
@ 2012-01-17 7:31 Dan Carpenter
2012-01-17 10:41 ` Ian Abbott
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-01-17 7:31 UTC (permalink / raw)
To: kernel-janitors
These are bitfields and the intend was to OR them together. A logical
OR here is simply 1.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/staging/comedi/drivers/dt9812.c b/drivers/staging/comedi/drivers/dt9812.c
index 32d9c42..e86ab58 100644
--- a/drivers/staging/comedi/drivers/dt9812.c
+++ b/drivers/staging/comedi/drivers/dt9812.c
@@ -527,7 +527,7 @@ static void dt9812_configure_gain(struct usb_dt9812 *dev,
* 11x -> Gain = 0.5
*/
case DT9812_GAIN_0PT5:
- rmw->or_value = F020_MASK_ADC0CF_AMP0GN2 ||
+ rmw->or_value = F020_MASK_ADC0CF_AMP0GN2 |
F020_MASK_ADC0CF_AMP0GN1;
break;
case DT9812_GAIN_1:
@@ -540,7 +540,7 @@ static void dt9812_configure_gain(struct usb_dt9812 *dev,
rmw->or_value = F020_MASK_ADC0CF_AMP0GN1;
break;
case DT9812_GAIN_8:
- rmw->or_value = F020_MASK_ADC0CF_AMP0GN1 ||
+ rmw->or_value = F020_MASK_ADC0CF_AMP0GN1 |
F020_MASK_ADC0CF_AMP0GN0;
break;
case DT9812_GAIN_16:
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] Staging: comedi: logical || vs bitwise |
2012-01-17 7:31 [patch] Staging: comedi: logical || vs bitwise | Dan Carpenter
@ 2012-01-17 10:41 ` Ian Abbott
0 siblings, 0 replies; 2+ messages in thread
From: Ian Abbott @ 2012-01-17 10:41 UTC (permalink / raw)
To: kernel-janitors
On 2012-01-17 07:31, Dan Carpenter wrote:
> These are bitfields and the intend was to OR them together. A logical
> OR here is simply 1.
>
> Signed-off-by: Dan Carpenter<dan.carpenter@oracle.com>
You have my ack. I'll just add that since the driver is incomplete, the
buggy code is not currently reached. (In fact, as the AI and AO
subdevices have neither a range_table nor a range_table_list, the comedi
core's COMEDI_INSN/COMEDI_INSNLIST ioctl handlers will return an error
for these subdevices before it even calls the driver's insn handlers for
these subdevices!)
Acked-by: Ian Abbott <abbotti@mev.co.uk>
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-01-17 10:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-17 7:31 [patch] Staging: comedi: logical || vs bitwise | Dan Carpenter
2012-01-17 10:41 ` Ian Abbott
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.