Commit 9382c06e authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

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: b3ff824a ('staging: comedi: drivers: use comedi_dio_update_state() for complex cases')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c16975a0
...@@ -173,11 +173,11 @@ static int pcl730_do_insn_bits(struct comedi_device *dev, ...@@ -173,11 +173,11 @@ static int pcl730_do_insn_bits(struct comedi_device *dev,
if (mask) { if (mask) {
if (mask & 0x00ff) if (mask & 0x00ff)
outb(s->state & 0xff, dev->iobase + reg); 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); 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); 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); outb((s->state >> 24) & 0xff, dev->iobase + reg + 3);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment