Skip to content

Commit

Permalink
Staging: comedi: pcl730: fix some bitwise vs logical AND bugs
Browse files Browse the repository at this point in the history
These conditions are never true because they use bitwise AND instead of
logical ands.

Fixes: b3ff824 ('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>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Nov 25, 2013
1 parent c16975a commit 9382c06
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/staging/comedi/drivers/pcl730.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 9382c06

Please sign in to comment.