]> Pileus Git - ~andy/linux/commitdiff
staging: comedi: addi_apci_3xxx: tidy up v_APCI3XXX_Interrupt()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 12 Jun 2013 23:06:02 +0000 (16:06 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Jun 2013 21:33:38 +0000 (14:33 -0700)
Remove the extra comments and rename the CamelCase local variables.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c

index 48c3432d22d6b605dee4e09a028ad29a334e9387..d8aa4bd0371f3c9437a7abc53d73f6eacc64295f 100644 (file)
@@ -582,67 +582,33 @@ static int i_APCI3XXX_InsnReadAnalogInput(struct comedi_device *dev,
        return i_ReturnValue;
 }
 
-/*
-+----------------------------------------------------------------------------+
-| Function name     : void v_APCI3XXX_Interrupt (int            irq,         |
-|                                                void           *d)       |
-+----------------------------------------------------------------------------+
-| Task              :Interrupt handler for APCI3XXX                          |
-|                    When interrupt occurs this gets called.                 |
-|                    First it finds which interrupt has been generated and   |
-|                    handles  corresponding interrupt                        |
-+----------------------------------------------------------------------------+
-| Input Parameters  : -                                                      |
-+----------------------------------------------------------------------------+
-| Return Value      : -                                                      |
-+----------------------------------------------------------------------------+
-*/
-
 static void v_APCI3XXX_Interrupt(int irq, void *d)
 {
        struct comedi_device *dev = d;
        struct addi_private *devpriv = dev->private;
-       unsigned char b_CopyCpt = 0;
-       unsigned int dw_Status = 0;
+       unsigned int status;
+       int i;
 
-       /***************************/
        /* Test if interrupt occur */
-       /***************************/
-
-       dw_Status = readl(devpriv->dw_AiBase + 16);
-       if ( (dw_Status & 0x2UL) == 0x2UL) {
-          /***********************/
+       status = readl(devpriv->dw_AiBase + 16);
+       if ((status & 0x2) == 0x2) {
                /* Reset the interrupt */
-          /***********************/
+               writel(status, devpriv->dw_AiBase + 16);
 
-               writel(dw_Status, devpriv->dw_AiBase + 16);
-
-          /*****************************/
                /* Test if interrupt enabled */
-          /*****************************/
-
                if (devpriv->b_EocEosInterrupt == 1) {
-             /********************************/
                        /* Read all analog inputs value */
-             /********************************/
+                       for (i = 0; i < devpriv->ui_AiNbrofChannels; i++) {
+                               unsigned int val;
 
-                       for (b_CopyCpt = 0;
-                               b_CopyCpt < devpriv->ui_AiNbrofChannels;
-                               b_CopyCpt++) {
-                               devpriv->ui_AiReadData[b_CopyCpt] =
-                                       (unsigned int)readl(devpriv->dw_AiBase + 28);
+                               val = readl(devpriv->dw_AiBase + 28);
+                               devpriv->ui_AiReadData[i] = val;
                        }
 
-             /**************************/
                        /* Set the interrupt flag */
-             /**************************/
-
                        devpriv->b_EocEosInterrupt = 2;
 
-             /**********************************************/
                        /* Send a signal to from kernel to user space */
-             /**********************************************/
-
                        send_sig(SIGIO, devpriv->tsk_Current, 0);
                }
        }