Skip to content

Commit

Permalink
staging: comedi: pcmuio: remove unnecessary mask of triggered channels
Browse files Browse the repository at this point in the history
The 'triggered' value is read directly from the three trigger id
registers and does not have any extra data that needs masked off.
Remove the 'mytrig' local variable and just use 'triggered' directly.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
bigguiness authored and gregkh committed Dec 6, 2013
1 parent beecd01 commit d3d2d75
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions drivers/staging/comedi/drivers/pcmuio.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,24 +297,20 @@ static void pcmuio_handle_intr_subdev(struct comedi_device *dev,
unsigned oldevents = s->async->events;
unsigned int val = 0;
unsigned long flags;
unsigned mytrig;
unsigned int i;

spin_lock_irqsave(&chip->spinlock, flags);

if (!chip->active)
goto done;

mytrig = triggered;
mytrig &= ((0x1 << s->n_chan) - 1);

if (!(mytrig & chip->enabled_mask))
if (!(triggered & chip->enabled_mask))
goto done;

for (i = 0; i < len; i++) {
unsigned int chan = CR_CHAN(s->async->cmd.chanlist[i]);
if (mytrig & (1U << chan))
val |= (1U << i);
if (triggered & (1 << chan))
val |= (1 << i);
}

/* Write the scan to the buffer. */
Expand Down

0 comments on commit d3d2d75

Please sign in to comment.