Staging: comedi: pcl730: fix some bitwise vs logical AND bugs
These conditions are never true because they use bitwise AND instead of
logical ands.
Fixes: b3ff824a81
('staging: comedi: drivers: use comedi_dio_update_state() for complex cases')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c16975a06c
commit
9382c06e2d
|
@ -173,11 +173,11 @@ static int pcl730_do_insn_bits(struct comedi_device *dev,
|
|||
if (mask) {
|
||||
if (mask & 0x00ff)
|
||||
outb(s->state & 0xff, dev->iobase + reg);
|
||||
if ((mask & 0xff00) & (s->n_chan > 8))
|
||||
if ((mask & 0xff00) && (s->n_chan > 8))
|
||||
outb((s->state >> 8) & 0xff, dev->iobase + reg + 1);
|
||||
if ((mask & 0xff0000) & (s->n_chan > 16))
|
||||
if ((mask & 0xff0000) && (s->n_chan > 16))
|
||||
outb((s->state >> 16) & 0xff, dev->iobase + reg + 2);
|
||||
if ((mask & 0xff000000) & (s->n_chan > 24))
|
||||
if ((mask & 0xff000000) && (s->n_chan > 24))
|
||||
outb((s->state >> 24) & 0xff, dev->iobase + reg + 3);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue