Staging: fix assorted typos all over the place
[safe/jmp/linux-2.6] / drivers / staging / comedi / drivers / addi-data / APCI1710_Tor.c
index 2feaef4..7e12544 100644 (file)
@@ -3,13 +3,13 @@
 
 Copyright (C) 2004,2005  ADDI-DATA GmbH for the source code of this module.
 
-        ADDI-DATA GmbH
-        Dieselstrasse 3
-        D-77833 Ottersweier
-        Tel: +19(0)7223/9493-0
-        Fax: +49(0)7223/9493-92
-        http://www.addi-data-com
-        info@addi-data.com
+       ADDI-DATA GmbH
+       Dieselstrasse 3
+       D-77833 Ottersweier
+       Tel: +19(0)7223/9493-0
+       Fax: +49(0)7223/9493-92
+       http://www.addi-data-com
+       info@addi-data.com
 
 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
 
@@ -130,19 +130,19 @@ You shoud also find the complete GPL in the COPYING file accompanying this sourc
 +----------------------------------------------------------------------------+
 */
 
-int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
-       struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data)
+int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device *dev,
+       struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data)
 {
        int i_ReturnValue = 0;
-       ULONG ul_TimerValue = 0;
-       DWORD dw_Command;
+       unsigned int ul_TimerValue = 0;
+       unsigned int dw_Command;
        double d_RealTimingInterval = 0;
        unsigned char b_ModulNbr;
        unsigned char b_TorCounter;
        unsigned char b_PCIInputClock;
        unsigned char b_TimingUnit;
-       ULONG ul_TimingInterval;
-       ULONG ul_RealTimingInterval = 0;
+       unsigned int ul_TimingInterval;
+       unsigned int ul_RealTimingInterval = 0;
 
        i_ReturnValue = insn->n;
        b_ModulNbr = (unsigned char) CR_AREF(insn->chanspec);
@@ -150,7 +150,7 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
        b_TorCounter = (unsigned char) data[0];
        b_PCIInputClock = (unsigned char) data[1];
        b_TimingUnit = (unsigned char) data[2];
-       ul_TimingInterval = (ULONG) data[3];
+       ul_TimingInterval = (unsigned int) data[3];
        printk("INPUT clock %d\n", b_PCIInputClock);
 
                /**************************/
@@ -225,7 +225,7 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
 
                                                                                        ul_TimerValue
                                                                                                =
-                                                                                               (ULONG)
+                                                                                               (unsigned int)
                                                                                                (ul_TimingInterval
                                                                                                *
                                                                                                (0.00025 * b_PCIInputClock));
@@ -248,7 +248,7 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
 
                                                                                        ul_RealTimingInterval
                                                                                                =
-                                                                                               (ULONG)
+                                                                                               (unsigned int)
                                                                                                (ul_TimerValue
                                                                                                /
                                                                                                (0.00025 * (double)b_PCIInputClock));
@@ -284,7 +284,7 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
                                                                                        if (b_PCIInputClock != APCI1710_40MHZ) {
                                                                                                ul_TimerValue
                                                                                                        =
-                                                                                                       (ULONG)
+                                                                                                       (unsigned int)
                                                                                                        (
                                                                                                        (double)
                                                                                                        (ul_TimerValue)
@@ -306,7 +306,7 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
 
                                                                                        ul_TimerValue
                                                                                                =
-                                                                                               (ULONG)
+                                                                                               (unsigned int)
                                                                                                (ul_TimingInterval
                                                                                                *
                                                                                                (0.25 * b_PCIInputClock));
@@ -329,7 +329,7 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
 
                                                                                        ul_RealTimingInterval
                                                                                                =
-                                                                                               (ULONG)
+                                                                                               (unsigned int)
                                                                                                (ul_TimerValue
                                                                                                /
                                                                                                (0.25 * (double)b_PCIInputClock));
@@ -367,7 +367,7 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
                                                                                        if (b_PCIInputClock != APCI1710_40MHZ) {
                                                                                                ul_TimerValue
                                                                                                        =
-                                                                                                       (ULONG)
+                                                                                                       (unsigned int)
                                                                                                        (
                                                                                                        (double)
                                                                                                        (ul_TimerValue)
@@ -413,7 +413,7 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
 
                                                                                        ul_RealTimingInterval
                                                                                                =
-                                                                                               (ULONG)
+                                                                                               (unsigned int)
                                                                                                (ul_TimerValue
                                                                                                /
                                                                                                (250.0 * (double)b_PCIInputClock));
@@ -449,7 +449,7 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
                                                                                        if (b_PCIInputClock != APCI1710_40MHZ) {
                                                                                                ul_TimerValue
                                                                                                        =
-                                                                                                       (ULONG)
+                                                                                                       (unsigned int)
                                                                                                        (
                                                                                                        (double)
                                                                                                        (ul_TimerValue)
@@ -471,7 +471,7 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
 
                                                                                        ul_TimerValue
                                                                                                =
-                                                                                               (ULONG)
+                                                                                               (unsigned int)
                                                                                                (ul_TimingInterval
                                                                                                *
                                                                                                (250000.0
@@ -496,7 +496,7 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
 
                                                                                        ul_RealTimingInterval
                                                                                                =
-                                                                                               (ULONG)
+                                                                                               (unsigned int)
                                                                                                (ul_TimerValue
                                                                                                /
                                                                                                (250000.0
@@ -535,7 +535,7 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
                                                                                        if (b_PCIInputClock != APCI1710_40MHZ) {
                                                                                                ul_TimerValue
                                                                                                        =
-                                                                                                       (ULONG)
+                                                                                                       (unsigned int)
                                                                                                        (
                                                                                                        (double)
                                                                                                        (ul_TimerValue)
@@ -557,7 +557,7 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
 
                                                                                        ul_TimerValue
                                                                                                =
-                                                                                               (ULONG)
+                                                                                               (unsigned int)
                                                                                                (
                                                                                                (ul_TimingInterval
                                                                                                        *
@@ -585,7 +585,7 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
 
                                                                                        ul_RealTimingInterval
                                                                                                =
-                                                                                               (ULONG)
+                                                                                               (unsigned int)
                                                                                                (ul_TimerValue
                                                                                                /
                                                                                                (250000.0
@@ -629,7 +629,7 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
                                                                                        if (b_PCIInputClock != APCI1710_40MHZ) {
                                                                                                ul_TimerValue
                                                                                                        =
-                                                                                                       (ULONG)
+                                                                                                       (unsigned int)
                                                                                                        (
                                                                                                        (double)
                                                                                                        (ul_TimerValue)
@@ -641,7 +641,7 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
                                                                                }
 
                                                                                fpu_end();
-                                                                       }       // if (b_PCIInputClock != APCI1710_GATE_INPUT)
+                                                                       }       /*  if (b_PCIInputClock != APCI1710_GATE_INPUT) */
                                                                        else {
                                   /*************************************************************/
                                                                                /* 2 Clock used for the overflow and the reload from counter */
@@ -652,7 +652,7 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
                                                                                        ul_TimingInterval
                                                                                        -
                                                                                        2;
-                                                                       }       // if (b_PCIInputClock != APCI1710_GATE_INPUT)
+                                                                       }       /*  if (b_PCIInputClock != APCI1710_GATE_INPUT) */
 
                                /****************************/
                                                                        /* Save the PCI input clock */
@@ -814,7 +814,7 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
                                                        DPRINTK("Base timing selection is wrong\n");
                                                        i_ReturnValue = -7;
                                                }
-                                       }       // if ((b_TimingUnit >= 0) && (b_TimingUnit <= 4))
+                                       }       /*  if ((b_TimingUnit >= 0) && (b_TimingUnit <= 4)) */
                                        else {
                       /**********************************/
                                                /* Timing unit selection is wrong */
@@ -822,8 +822,8 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
 
                                                DPRINTK("Timing unit selection is wrong\n");
                                                i_ReturnValue = -6;
-                                       }       // if ((b_TimingUnit >= 0) && (b_TimingUnit <= 4))
-                               }       // if ((b_PCIInputClock == APCI1710_30MHZ) || (b_PCIInputClock == APCI1710_33MHZ))
+                                       }       /*  if ((b_TimingUnit >= 0) && (b_TimingUnit <= 4)) */
+                               }       /*  if ((b_PCIInputClock == APCI1710_30MHZ) || (b_PCIInputClock == APCI1710_33MHZ)) */
                                else {
                    /*****************************************/
                                        /* The selected PCI input clock is wrong */
@@ -831,8 +831,8 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
 
                                        DPRINTK("The selected PCI input clock is wrong\n");
                                        i_ReturnValue = -5;
-                               }       // if ((b_PCIInputClock == APCI1710_30MHZ) || (b_PCIInputClock == APCI1710_33MHZ))
-                       }       // if (b_TorCounterMode >= 0 && b_TorCounterMode <= 7)
+                               }       /*  if ((b_PCIInputClock == APCI1710_30MHZ) || (b_PCIInputClock == APCI1710_33MHZ)) */
+                       }       /*  if (b_TorCounterMode >= 0 && b_TorCounterMode <= 7) */
                        else {
                 /**********************************/
                                /* Tor Counter selection is wrong */
@@ -840,7 +840,7 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
 
                                DPRINTK("Tor Counter selection is wrong\n");
                                i_ReturnValue = -4;
-                       }       // if (b_TorCounterMode >= 0 && b_TorCounterMode <= 7)
+                       }       /*  if (b_TorCounterMode >= 0 && b_TorCounterMode <= 7) */
                } else {
              /******************************************/
                        /* The module is not a tor counter module */
@@ -857,8 +857,8 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
                DPRINTK("Module number error\n");
                i_ReturnValue = -2;
        }
-       data[0] = (UINT) ul_RealTimingInterval;
-       return (i_ReturnValue);
+       data[0] = (unsigned int) ul_RealTimingInterval;
+       return i_ReturnValue;
 }
 
 /*
@@ -987,13 +987,13 @@ int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device * dev,
 +----------------------------------------------------------------------------+
 */
 
-int i_APCI1710_InsnWriteEnableDisableTorCounter(struct comedi_device * dev,
-       struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data)
+int i_APCI1710_InsnWriteEnableDisableTorCounter(struct comedi_device *dev,
+       struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data)
 {
        int i_ReturnValue = 0;
-       DWORD dw_Status;
-       DWORD dw_DummyRead;
-       DWORD dw_ConfigReg;
+       unsigned int dw_Status;
+       unsigned int dw_DummyRead;
+       unsigned int dw_ConfigReg;
        unsigned char b_ModulNbr, b_Action;
        unsigned char b_TorCounter;
        unsigned char b_InputMode;
@@ -1002,14 +1002,14 @@ int i_APCI1710_InsnWriteEnableDisableTorCounter(struct comedi_device * dev,
        unsigned char b_InterruptEnable;
 
        b_ModulNbr = (unsigned char) CR_AREF(insn->chanspec);
-       b_Action = (unsigned char) data[0];     // enable or disable
+       b_Action = (unsigned char) data[0];     /*  enable or disable */
        b_TorCounter = (unsigned char) data[1];
        b_InputMode = (unsigned char) data[2];
        b_ExternGate = (unsigned char) data[3];
        b_CycleMode = (unsigned char) data[4];
        b_InterruptEnable = (unsigned char) data[5];
        i_ReturnValue = insn->n;;
-       devpriv->tsk_Current = current; // Save the current process task structure
+       devpriv->tsk_Current = current; /*  Save the current process task structure */
        /**************************/
        /* Test the module number */
        /**************************/
@@ -1027,7 +1027,7 @@ int i_APCI1710_InsnWriteEnableDisableTorCounter(struct comedi_device * dev,
              /**********************************/
 
                        if (b_TorCounter <= 1) {
-                               switch (b_Action)       // Enable or Disable
+                               switch (b_Action)       /*  Enable or Disable */
                                {
                                case APCI1710_ENABLE:
                 /***********************************/
@@ -1149,7 +1149,7 @@ int i_APCI1710_InsnWriteEnableDisableTorCounter(struct comedi_device * dev,
                                                                                                        |
                                                                                                        0x780;
 
-                                                                                       }       // if (b_InputMode == APCI1710_TOR_SIMPLE_MODE)
+                                                                                       }       /*  if (b_InputMode == APCI1710_TOR_SIMPLE_MODE) */
 
                                      /***********************/
                                                                                        /* Test if double mode */
@@ -1166,12 +1166,12 @@ int i_APCI1710_InsnWriteEnableDisableTorCounter(struct comedi_device * dev,
                                                                                                        |
                                                                                                        0x180;
 
-                                                                                       }       // if (b_InputMode == APCI1710_TOR_DOUBLE_MODE)
+                                                                                       }       /*  if (b_InputMode == APCI1710_TOR_DOUBLE_MODE) */
 
                                                                                        b_InputMode
                                                                                                =
                                                                                                0;
-                                                                               }       // if (b_InputMode > 1)
+                                                                               }       /*  if (b_InputMode > 1) */
 
                                   /*******************/
                                                                                /* Set the command */
@@ -1237,7 +1237,7 @@ int i_APCI1710_InsnWriteEnableDisableTorCounter(struct comedi_device * dev,
 
                                                                                outl(1, devpriv->s_BoardInfos.ui_Address + 8 + (16 * b_TorCounter) + (64 * b_ModulNbr));
 
-                                                                       }       // if ((b_InterruptEnable == APCI1710_ENABLE) || (b_InterruptEnable == APCI1710_DISABLE))
+                                                                       }       /*  if ((b_InterruptEnable == APCI1710_ENABLE) || (b_InterruptEnable == APCI1710_DISABLE)) */
                                                                        else {
                                /********************************/
                                                                                /* Interrupt parameter is wrong */
@@ -1247,8 +1247,8 @@ int i_APCI1710_InsnWriteEnableDisableTorCounter(struct comedi_device * dev,
                                                                                i_ReturnValue
                                                                                        =
                                                                                        -9;
-                                                                       }       // if ((b_InterruptEnable == APCI1710_ENABLE) || (b_InterruptEnable == APCI1710_DISABLE))
-                                                               }       // if ((b_CycleMode == APCI1710_SINGLE) || (b_CycleMode == APCI1710_CONTINUOUS))
+                                                                       }       /*  if ((b_InterruptEnable == APCI1710_ENABLE) || (b_InterruptEnable == APCI1710_DISABLE)) */
+                                                               }       /*  if ((b_CycleMode == APCI1710_SINGLE) || (b_CycleMode == APCI1710_CONTINUOUS)) */
                                                                else {
                             /***********************************************/
                                                                        /* Tor counter acquisition mode cycle is wrong */
@@ -1258,8 +1258,8 @@ int i_APCI1710_InsnWriteEnableDisableTorCounter(struct comedi_device * dev,
                                                                        i_ReturnValue
                                                                                =
                                                                                -8;
-                                                               }       // if ((b_CycleMode == APCI1710_SINGLE) || (b_CycleMode == APCI1710_CONTINUOUS))
-                                                       }       // if (b_ExternGate >= 0 && b_ExternGate <= 1)
+                                                               }       /*  if ((b_CycleMode == APCI1710_SINGLE) || (b_CycleMode == APCI1710_CONTINUOUS)) */
+                                                       }       /*  if (b_ExternGate >= 0 && b_ExternGate <= 1) */
                                                        else {
                          /***********************************/
                                                                /* Extern gate input mode is wrong */
@@ -1268,8 +1268,8 @@ int i_APCI1710_InsnWriteEnableDisableTorCounter(struct comedi_device * dev,
                                                                DPRINTK("Extern gate input mode is wrong\n");
                                                                i_ReturnValue =
                                                                        -7;
-                                                       }       // if (b_ExternGate >= 0 && b_ExternGate <= 1)
-                                               }       // if (b_InputMode >= 0 && b_InputMode <= 1)
+                                                       }       /*  if (b_ExternGate >= 0 && b_ExternGate <= 1) */
+                                               }       /*  if (b_InputMode >= 0 && b_InputMode <= 1) */
                                                else {
                       /***************************************/
                                                        /* Tor input signal selection is wrong */
@@ -1329,7 +1329,7 @@ int i_APCI1710_InsnWriteEnableDisableTorCounter(struct comedi_device * dev,
                                                                s_BoardInfos.
                                                                ui_Address + 8 +
                                                                (16 * b_TorCounter) + (64 * b_ModulNbr));
-                                               }       // if (dw_Status & 0x1)
+                                               }       /*  if (dw_Status & 0x1) */
                                                else {
                       /***************************/
                                                        /* Tor counter not enabled */
@@ -1337,8 +1337,8 @@ int i_APCI1710_InsnWriteEnableDisableTorCounter(struct comedi_device * dev,
 
                                                        DPRINTK("Tor counter not enabled \n");
                                                        i_ReturnValue = -6;
-                                               }       // if (dw_Status & 0x1)
-                                       }       // if (dw_Status & 0x10)
+                                               }       /*  if (dw_Status & 0x1) */
+                                       }       /*  if (dw_Status & 0x10) */
                                        else {
                    /*******************************/
                                                /* Tor counter not initialised */
@@ -1346,10 +1346,10 @@ int i_APCI1710_InsnWriteEnableDisableTorCounter(struct comedi_device * dev,
 
                                                DPRINTK("Tor counter not initialised\n");
                                                i_ReturnValue = -5;
-                                       }       // // if (dw_Status & 0x10)
+                                       }       /*  // if (dw_Status & 0x10) */
 
-                               }       // switch
-                       }       // if (b_TorCounter <= 1)
+                               }       /*  switch */
+                       }       /*  if (b_TorCounter <= 1) */
                        else {
                 /**********************************/
                                /* Tor counter selection is wrong */
@@ -1357,7 +1357,7 @@ int i_APCI1710_InsnWriteEnableDisableTorCounter(struct comedi_device * dev,
 
                                DPRINTK("Tor counter selection is wrong\n");
                                i_ReturnValue = -4;
-                       }       // if (b_TorCounter <= 1)
+                       }       /*  if (b_TorCounter <= 1) */
                } else {
              /******************************************/
                        /* The module is not a tor counter module */
@@ -1375,7 +1375,7 @@ int i_APCI1710_InsnWriteEnableDisableTorCounter(struct comedi_device * dev,
                i_ReturnValue = -2;
        }
 
-       return (i_ReturnValue);
+       return i_ReturnValue;
 }
 
 /*
@@ -1442,7 +1442,7 @@ int i_APCI1710_InsnWriteEnableDisableTorCounter(struct comedi_device * dev,
 |                                                 Disable the tor counter    |
 |                                                 interrupt
        pb_TimingUnit           =       (unsigned char *) &data[0];
-       pul_TimingInterval      =  (PULONG) &data[1];
+       pul_TimingInterval      =  (unsigned int *) &data[1];
        pb_InputMode            =       (unsigned char *) &data[2];
        pb_ExternGate           =       (unsigned char *) &data[3];
        pb_CycleMode            =       (unsigned char *) &data[4];
@@ -1460,32 +1460,32 @@ int i_APCI1710_InsnWriteEnableDisableTorCounter(struct comedi_device * dev,
 +----------------------------------------------------------------------------+
 */
 
-int i_APCI1710_InsnReadGetTorCounterInitialisation(struct comedi_device * dev,
-       struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data)
+int i_APCI1710_InsnReadGetTorCounterInitialisation(struct comedi_device *dev,
+       struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data)
 {
        int i_ReturnValue = 0;
-       DWORD dw_Status;
+       unsigned int dw_Status;
        unsigned char b_ModulNbr;
        unsigned char b_TorCounter;
-       unsigned char * pb_TimingUnit;
-       PULONG pul_TimingInterval;
-       unsigned char * pb_InputMode;
-       unsigned char * pb_ExternGate;
-       unsigned char * pb_CycleMode;
-       unsigned char * pb_Enable;
-       unsigned char * pb_InterruptEnable;
+       unsigned char *pb_TimingUnit;
+       unsigned int *pul_TimingInterval;
+       unsigned char *pb_InputMode;
+       unsigned char *pb_ExternGate;
+       unsigned char *pb_CycleMode;
+       unsigned char *pb_Enable;
+       unsigned char *pb_InterruptEnable;
 
        i_ReturnValue = insn->n;
        b_ModulNbr = CR_AREF(insn->chanspec);
        b_TorCounter = CR_CHAN(insn->chanspec);
 
-       pb_TimingUnit = (unsigned char *) & data[0];
-       pul_TimingInterval = (PULONG) & data[1];
-       pb_InputMode = (unsigned char *) & data[2];
-       pb_ExternGate = (unsigned char *) & data[3];
-       pb_CycleMode = (unsigned char *) & data[4];
-       pb_Enable = (unsigned char *) & data[5];
-       pb_InterruptEnable = (unsigned char *) & data[6];
+       pb_TimingUnit = (unsigned char *) &data[0];
+       pul_TimingInterval = (unsigned int *) &data[1];
+       pb_InputMode = (unsigned char *) &data[2];
+       pb_ExternGate = (unsigned char *) &data[3];
+       pb_CycleMode = (unsigned char *) &data[4];
+       pb_Enable = (unsigned char *) &data[5];
+       pb_InterruptEnable = (unsigned char *) &data[6];
 
        /**************************/
        /* Test the module number */
@@ -1569,17 +1569,17 @@ int i_APCI1710_InsnReadGetTorCounterInitialisation(struct comedi_device * dev,
                                                                *pb_InputMode =
                                                                        APCI1710_TOR_QUADRUPLE_MODE;
                                                        }
-                                               }       // if (dw_Status & 0x400)
+                                               }       /*  if (dw_Status & 0x400) */
                                                else {
                                                        *pb_InputMode = 1;
-                                               }       // // if (dw_Status & 0x400)
+                                               }       /*  // if (dw_Status & 0x400) */
 
                       /************************/
                                                /* Extern gate not used */
                       /************************/
 
                                                *pb_ExternGate = 0;
-                                       }       // if (dw_Status & 0x600)
+                                       }       /*  if (dw_Status & 0x600) */
                                        else {
                                                *pb_InputMode =
                                                        (unsigned char) ((dw_Status >> 6)
@@ -1587,7 +1587,7 @@ int i_APCI1710_InsnReadGetTorCounterInitialisation(struct comedi_device * dev,
                                                *pb_ExternGate =
                                                        (unsigned char) ((dw_Status >> 7)
                                                        & 1);
-                                       }       // if (dw_Status & 0x600)
+                                       }       /*  if (dw_Status & 0x600) */
 
                                        *pb_TimingUnit =
                                                devpriv->
@@ -1611,7 +1611,7 @@ int i_APCI1710_InsnReadGetTorCounterInitialisation(struct comedi_device * dev,
                                        i_ReturnValue = -5;
                                }
 
-                       }       // if (b_TorCounter <= 1)
+                       }       /*  if (b_TorCounter <= 1) */
                        else {
                 /**********************************/
                                /* Tor counter selection is wrong */
@@ -1619,7 +1619,7 @@ int i_APCI1710_InsnReadGetTorCounterInitialisation(struct comedi_device * dev,
 
                                DPRINTK("Tor counter selection is wrong \n");
                                i_ReturnValue = -4;
-                       }       // if (b_TorCounter <= 1)
+                       }       /*  if (b_TorCounter <= 1) */
                } else {
              /******************************************/
                        /* The module is not a tor counter module */
@@ -1637,7 +1637,7 @@ int i_APCI1710_InsnReadGetTorCounterInitialisation(struct comedi_device * dev,
                i_ReturnValue = -2;
        }
 
-       return (i_ReturnValue);
+       return i_ReturnValue;
 }
 
 /*
@@ -1646,7 +1646,7 @@ int i_APCI1710_InsnReadGetTorCounterInitialisation(struct comedi_device * dev,
 |                               (unsigned char_     b_BoardHandle,                    |
 |                                unsigned char_     b_ModulNbr,                       |
 |                               unsigned char_     b_TorCounter,                     |
-|                                UINT_    ui_TimeOut,                        |
+|                                unsigned int_    ui_TimeOut,                        |
 |                                unsigned char *_   pb_TorCounterStatus,               |
 |                                PULONG_ pul_TorCounterValue)                |
 +----------------------------------------------------------------------------+
@@ -1666,7 +1666,7 @@ int i_APCI1710_InsnReadGetTorCounterInitialisation(struct comedi_device * dev,
        b_ModulNbr    = CR_AREF(insn->chanspec);
        b_ReadType    = (unsigned char) data[0];
        b_TorCounter  = (unsigned char) data[1];
-       ui_TimeOut        = (UINT) data[2]; |
+       ui_TimeOut        = (unsigned int) data[2]; |
 +----------------------------------------------------------------------------+
 | Output Parameters : unsigned char *_  pb_TorCounterStatus : Return the tor counter   |
 |                                                    status.                 |
@@ -1683,9 +1683,9 @@ int i_APCI1710_InsnReadGetTorCounterInitialisation(struct comedi_device * dev,
 |                                                   function                 |
 |                                                 "i_APCI1710_InitTorCounter"|
 |                                              4 : Timeeout occur           |
-|                     PULONG  pul_TorCounterValue  : Tor counter value.
+|                     unsigned int *  pul_TorCounterValue  : Tor counter value.
        pb_TorCounterStatus=(unsigned char *) &data[0];
-       pul_TorCounterValue=(PULONG) &data[1];    |
+       pul_TorCounterValue=(unsigned int *) &data[1];    |
 +----------------------------------------------------------------------------+
 | Return Value      :  0: No error                                           |
 |                     -1: The handle parameter of the board is wrong         |
@@ -1700,27 +1700,27 @@ int i_APCI1710_InsnReadGetTorCounterInitialisation(struct comedi_device * dev,
 +----------------------------------------------------------------------------+
 */
 
-int i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue(struct comedi_device * dev,
-       struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data)
+int i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue(struct comedi_device *dev,
+       struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data)
 {
        int i_ReturnValue = 0;
-       DWORD dw_Status;
-       DWORD dw_TimeOut = 0;
+       unsigned int dw_Status;
+       unsigned int dw_TimeOut = 0;
 
        unsigned char b_ModulNbr;
        unsigned char b_TorCounter;
        unsigned char b_ReadType;
-       UINT ui_TimeOut;
-       unsigned char * pb_TorCounterStatus;
-       PULONG pul_TorCounterValue;
+       unsigned int ui_TimeOut;
+       unsigned char *pb_TorCounterStatus;
+       unsigned int *pul_TorCounterValue;
 
        i_ReturnValue = insn->n;
        b_ModulNbr = CR_AREF(insn->chanspec);
        b_ReadType = (unsigned char) data[0];
        b_TorCounter = (unsigned char) data[1];
-       ui_TimeOut = (UINT) data[2];
-       pb_TorCounterStatus = (unsigned char *) & data[0];
-       pul_TorCounterValue = (PULONG) & data[1];
+       ui_TimeOut = (unsigned int) data[2];
+       pb_TorCounterStatus = (unsigned char *) &data[0];
+       pul_TorCounterValue = (unsigned int *) &data[1];
 
        /**************************/
        /* Test the module number */
@@ -1808,7 +1808,7 @@ int i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue(struct comedi_device
                                                                        2) {
                                                                        if (dw_Status & 4) {
                                /************************/
-                                                                               /* Tor counter owerflow */
+                                                                               /* Tor counter overflow */
                                /************************/
 
                                                                                *pb_TorCounterStatus
@@ -1896,7 +1896,7 @@ int i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue(struct comedi_device
                                                                                        +
                                                                                        (16 * b_TorCounter) + (64 * b_ModulNbr));
                                                                                break;
-                                                                       }       // if ((dw_Status & 4) == 4)
+                                                                       }       /*  if ((dw_Status & 4) == 4) */
                                                                        else {
                                /*******************************/
                                                                                /* Test if measurement stopped */
@@ -1927,7 +1927,7 @@ int i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue(struct comedi_device
                                                                                                (16 * b_TorCounter) + (64 * b_ModulNbr));
 
                                                                                        break;
-                                                                               }       // if ((dw_Status & 2) == 2)
+                                                                               }       /*  if ((dw_Status & 2) == 2) */
                                                                                else {
                                   /*******************************/
                                                                                        /* Test if measurement started */
@@ -1941,7 +1941,7 @@ int i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue(struct comedi_device
                                                                                                *pb_TorCounterStatus
                                                                                                        =
                                                                                                        1;
-                                                                                       }       // if ((dw_Status & 1) == 1)
+                                                                                       }       /*  if ((dw_Status & 1) == 1) */
                                                                                        else {
                                      /***************************/
                                                                                                /* Measurement not started */
@@ -1950,9 +1950,9 @@ int i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue(struct comedi_device
                                                                                                *pb_TorCounterStatus
                                                                                                        =
                                                                                                        0;
-                                                                                       }       // if ((dw_Status & 1) == 1)
-                                                                               }       // if ((dw_Status & 2) == 2)
-                                                                       }       // if ((dw_Status & 8) == 8)
+                                                                                       }       /*  if ((dw_Status & 1) == 1) */
+                                                                               }       /*  if ((dw_Status & 2) == 2) */
+                                                                       }       /*  if ((dw_Status & 8) == 8) */
 
                                                                        if (dw_TimeOut == ui_TimeOut) {
                                /*****************/
@@ -1973,7 +1973,7 @@ int i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue(struct comedi_device
 
                                                                                mdelay(1000);
                                                                        }
-                                                               }       // for (;;)
+                                                               }       /*  for (;;) */
 
                          /*************************/
                                                                /* Test if timeout occur */
@@ -2001,8 +2001,8 @@ int i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue(struct comedi_device
 
                                                default:
                                                        printk("Inputs wrong\n");
-                                               }       // switch end
-                                       }       // if (dw_Status & 0x1)
+                                               }       /*  switch end */
+                                       }       /*  if (dw_Status & 0x1) */
                                        else {
                       /***************************/
                                                /* Tor counter not enabled */
@@ -2010,7 +2010,7 @@ int i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue(struct comedi_device
 
                                                DPRINTK("Tor counter not enabled\n");
                                                i_ReturnValue = -6;
-                                       }       // if (dw_Status & 0x1)
+                                       }       /*  if (dw_Status & 0x1) */
                                } else {
                    /*******************************/
                                        /* Tor counter not initialised */
@@ -2019,7 +2019,7 @@ int i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue(struct comedi_device
                                        DPRINTK("Tor counter not initialised\n");
                                        i_ReturnValue = -5;
                                }
-                       }       // if (b_TorCounter <= 1)
+                       }       /*  if (b_TorCounter <= 1) */
                        else {
                 /**********************************/
                                /* Tor counter selection is wrong */
@@ -2027,7 +2027,7 @@ int i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue(struct comedi_device
 
                                DPRINTK("Tor counter selection is wrong\n");
                                i_ReturnValue = -4;
-                       }       // if (b_TorCounter <= 1)
+                       }       /*  if (b_TorCounter <= 1) */
                } else {
              /******************************************/
                        /* The module is not a tor counter module */
@@ -2045,5 +2045,5 @@ int i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue(struct comedi_device
                i_ReturnValue = -2;
        }
 
-       return (i_ReturnValue);
+       return i_ReturnValue;
 }