From: H Hartley Sweeten Date: Mon, 9 Dec 2013 22:31:05 +0000 (-0700) Subject: staging: comedi: pcmmio: remove unnecessary for () loop and sanity check X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=1786bd7503cfe5dfdb57b6b965cfb9a092b04df0;p=openwrt%2Fstaging%2Fblogic.git staging: comedi: pcmmio: remove unnecessary for () loop and sanity check There is only one asic on the board so the for () loop in the interrupt handler to check multiple asics is not needed. The sanity check of the 'irq' in the interrupt handler is also not needed. If it _is_ wrong we have bigger problems in the kernel. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/pcmmio.c b/drivers/staging/comedi/drivers/pcmmio.c index 7026ebcc2c7c..c5f8bb26acdb 100644 --- a/drivers/staging/comedi/drivers/pcmmio.c +++ b/drivers/staging/comedi/drivers/pcmmio.c @@ -402,10 +402,8 @@ static irqreturn_t interrupt_pcmmio(int irq, void *d) struct pcmmio_private *devpriv = dev->private; struct comedi_subdevice *s = dev->read_subdev; struct pcmmio_subdev_private *subpriv = s->private; - int asic, got1 = 0; + int got1 = 0; - for (asic = 0; asic < MAX_ASICS; ++asic) { - if (irq == dev->irq) { unsigned long flags; unsigned triggered = 0; /* it is an interrupt for ASIC #asic */ @@ -456,7 +454,7 @@ static irqreturn_t interrupt_pcmmio(int irq, void *d) * this is an interrupt subdev, * and it matches this asic! */ - if (subpriv->dio.intr.asic == asic) { + if (subpriv->dio.intr.asic == 0) { unsigned long flags; unsigned oldevents; @@ -539,8 +537,6 @@ static irqreturn_t interrupt_pcmmio(int irq, void *d) } - } - } if (!got1) return IRQ_NONE; /* interrupt from other source */ return IRQ_HANDLED;