Staging: comedi: Remove C99 comments
[pandora-kernel.git] / drivers / staging / comedi / drivers / jr3_pci.c
index a3c887f..ec5d918 100644 (file)
@@ -194,7 +194,7 @@ static void set_transforms(volatile struct jr3_channel *channel,
 {
        int i;
 
-       num &= 0x000f;          // Make sure that 0 <= num <= 15
+       num &= 0x000f;          /*  Make sure that 0 <= num <= 15 */
        for (i = 0; i < 8; i++) {
 
                set_u16(&channel->transforms[num].link[i].link_type,
@@ -410,10 +410,10 @@ int read_idm_word(const u8 * data, size_t size, int *pos, unsigned int *val)
 {
        int result = 0;
        if (pos != 0 && val != 0) {
-               // Skip over non hex
+               /*  Skip over non hex */
                for (; *pos < size && !isxdigit(data[*pos]); (*pos)++) {
                }
-               // Collect value
+               /*  Collect value */
                *val = 0;
                for (; *pos < size && isxdigit(data[*pos]); (*pos)++) {
                        char ch = tolower(data[*pos]);
@@ -485,17 +485,17 @@ static int jr3_download_firmware(struct comedi_device * dev, const u8 * data,
                                        count, addr);
                                while (more && count > 0) {
                                        if (addr & 0x4000) {
-                                               // 16 bit data, never seen in real life!!
+                                               /*  16 bit data, never seen in real life!! */
                                                unsigned int data1;
 
                                                more = more
                                                        && read_idm_word(data,
                                                        size, &pos, &data1);
                                                count--;
-                                               // printk("jr3_data, not tested\n");
-                                               //        jr3[addr + 0x20000 * pnum] = data1;
+                                               /* printk("jr3_data, not tested\n"); */
+                                               /* jr3[addr + 0x20000 * pnum] = data1; */
                                        } else {
-                                               //  Download 24 bit program
+                                               /*   Download 24 bit program */
                                                unsigned int data1, data2;
 
                                                more = more
@@ -541,7 +541,7 @@ static struct poll_delay_t jr3_pci_poll_subdevice(struct comedi_subdevice * s)
                        p->errors = errors;
                }
                if (errors & (watch_dog | watch_dog2 | sensor_change)) {
-                       // Sensor communication lost, force poll mode
+                       /*  Sensor communication lost, force poll mode */
                        p->state = state_jr3_poll;
 
                }
@@ -551,9 +551,10 @@ static struct poll_delay_t jr3_pci_poll_subdevice(struct comedi_subdevice * s)
                                u16 serial_no = get_u16(&channel->serial_no);
                                if ((errors & (watch_dog | watch_dog2)) ||
                                        model_no == 0 || serial_no == 0) {
-                                       // Still no sensor, keep on polling. Since it takes up to
-                                       // 10 seconds for offsets to stabilize, polling each
-                                       // second should suffice.
+/*
+ * Still no sensor, keep on polling. Since it takes up to 10 seconds
+ * for offsets to stabilize, polling each second should suffice.
+ */
                                        result = poll_delay_min_max(1000, 2000);
                                } else {
                                        p->retries = 0;
@@ -566,7 +567,7 @@ static struct poll_delay_t jr3_pci_poll_subdevice(struct comedi_subdevice * s)
                case state_jr3_init_wait_for_offset:{
                                p->retries++;
                                if (p->retries < 10) {
-                                       // Wait for offeset to stabilize (< 10 s according to manual)
+                                       /*  Wait for offeset to stabilize (< 10 s according to manual) */
                                        result = poll_delay_min_max(1000, 2000);
                                } else {
                                        struct transform_t transf;
@@ -582,7 +583,7 @@ static struct poll_delay_t jr3_pci_poll_subdevice(struct comedi_subdevice * s)
                                        printk("Sensor Serial    = %i\n",
                                                p->serial_no);
 
-                                       // Transformation all zeros
+                                       /*  Transformation all zeros */
                                        transf.link[0].link_type =
                                                (enum link_types)0;
                                        transf.link[0].link_amount = 0;
@@ -600,7 +601,7 @@ static struct poll_delay_t jr3_pci_poll_subdevice(struct comedi_subdevice * s)
                                        use_transform(channel, 0);
                                        p->state =
                                                state_jr3_init_transform_complete;
-                                       result = poll_delay_min_max(20, 100);   // Allow 20 ms for completion
+                                       result = poll_delay_min_max(20, 100);   /*  Allow 20 ms for completion */
                                }
                        } break;
                case state_jr3_init_transform_complete:{
@@ -608,7 +609,7 @@ static struct poll_delay_t jr3_pci_poll_subdevice(struct comedi_subdevice * s)
                                        printk("state_jr3_init_transform_complete complete = %d\n", is_complete(channel));
                                        result = poll_delay_min_max(20, 100);
                                } else {
-                                       // Set full scale
+                                       /*  Set full scale */
                                        struct six_axis_t min_full_scale;
                                        struct six_axis_t max_full_scale;
 
@@ -639,7 +640,7 @@ static struct poll_delay_t jr3_pci_poll_subdevice(struct comedi_subdevice * s)
 
                                        p->state =
                                                state_jr3_init_set_full_scale_complete;
-                                       result = poll_delay_min_max(20, 100);   // Allow 20 ms for completion
+                                       result = poll_delay_min_max(20, 100);   /*  Allow 20 ms for completion */
                                }
                        }
                        break;
@@ -650,7 +651,7 @@ static struct poll_delay_t jr3_pci_poll_subdevice(struct comedi_subdevice * s)
                                } else {
                                        volatile struct force_array *full_scale;
 
-                                       // Use ranges in kN or we will overflow arount 2000N!
+                                       /*  Use ranges in kN or we will overflow arount 2000N! */
                                        full_scale = &channel->full_scale;
                                        p->range[0].range.min =
                                                -get_s16(&full_scale->fx) *
@@ -679,10 +680,10 @@ static struct poll_delay_t jr3_pci_poll_subdevice(struct comedi_subdevice * s)
                                                -get_s16(&full_scale->mz) * 100;
                                        p->range[5].range.max =
                                                get_s16(&full_scale->mz) * 100;
-                                       p->range[6].range.min = -get_s16(&full_scale->v1) * 100;        // ??
-                                       p->range[6].range.max = get_s16(&full_scale->v1) * 100; // ??
-                                       p->range[7].range.min = -get_s16(&full_scale->v2) * 100;        // ??
-                                       p->range[7].range.max = get_s16(&full_scale->v2) * 100; // ??
+                                       p->range[6].range.min = -get_s16(&full_scale->v1) * 100;        /*  ?? */
+                                       p->range[6].range.max = get_s16(&full_scale->v1) * 100; /*  ?? */
+                                       p->range[7].range.min = -get_s16(&full_scale->v2) * 100;        /*  ?? */
+                                       p->range[7].range.max = get_s16(&full_scale->v2) * 100; /*  ?? */
                                        p->range[8].range.min = 0;
                                        p->range[8].range.max = 65535;
 
@@ -701,7 +702,7 @@ static struct poll_delay_t jr3_pci_poll_subdevice(struct comedi_subdevice * s)
                                        use_offset(channel, 0);
                                        p->state =
                                                state_jr3_init_use_offset_complete;
-                                       result = poll_delay_min_max(40, 100);   // Allow 40 ms for completion
+                                       result = poll_delay_min_max(40, 100);   /*  Allow 40 ms for completion */
                                }
                        }
                        break;
@@ -750,7 +751,7 @@ static void jr3_pci_poll_dev(unsigned long data)
        comedi_spin_lock_irqsave(&dev->spinlock, flags);
        delay = 1000;
        now = jiffies;
-       // Poll all channels that are ready to be polled
+       /*  Poll all channels that are ready to be polled */
        for (i = 0; i < devpriv->n_channels; i++) {
                struct jr3_pci_subdev_private *subdevpriv = dev->subdevices[i].private;
                if (now > subdevpriv->next_time_min) {
@@ -762,8 +763,10 @@ static void jr3_pci_poll_dev(unsigned long data)
                        subdevpriv->next_time_max =
                                jiffies + msecs_to_jiffies(sub_delay.max);
                        if (sub_delay.max && sub_delay.max < delay) {
-                               // Wake up as late as possible -> poll as many channels as
-                               // possible at once
+/*
+* Wake up as late as possible -> poll as many channels as possible
+* at once
+*/
                                delay = sub_delay.max;
                        }
                }
@@ -895,7 +898,7 @@ static int jr3_pci_attach(struct comedi_device * dev, struct comedi_devconfig *
                                (struct comedi_lrange *) & p->range[8];
                        p->maxdata_list[56] = 0xffff;
                        p->maxdata_list[57] = 0xffff;
-                       // Channel specific range and maxdata
+                       /*  Channel specific range and maxdata */
                        dev->subdevices[i].range_table = 0;
                        dev->subdevices[i].range_table_list =
                                p->range_table_list;
@@ -904,7 +907,7 @@ static int jr3_pci_attach(struct comedi_device * dev, struct comedi_devconfig *
                }
        }
 
-       // Reset DSP card
+       /*  Reset DSP card */
        devpriv->iobase->channel[0].reset = 0;
 
        result = comedi_load_firmware(dev, "jr3pci.idm", jr3_download_firmware);
@@ -913,13 +916,18 @@ static int jr3_pci_attach(struct comedi_device * dev, struct comedi_devconfig *
        if (result < 0) {
                goto out;
        }
-       // TODO: use firmware to load preferred offset tables. Suggested format:
-       // model serial Fx Fy Fz Mx My Mz\n
-       //
-       // comedi_load_firmware(dev, "jr3_offsets_table", jr3_download_firmware);
+/*
+ * TODO: use firmware to load preferred offset tables. Suggested
+ * format:
+ *     model serial Fx Fy Fz Mx My Mz\n
+ *
+ *     comedi_load_firmware(dev, "jr3_offsets_table", jr3_download_firmware);
+ */
 
-       // It takes a few milliseconds for software to settle
-       // as much as we can read firmware version
+/*
+ * It takes a few milliseconds for software to settle as much as we
+ * can read firmware version
+ */
        msleep_interruptible(25);
        for (i = 0; i < 0x18; i++) {
                printk("%c",
@@ -927,7 +935,7 @@ static int jr3_pci_attach(struct comedi_device * dev, struct comedi_devconfig *
                                copyright[i]) >> 8);
        }
 
-       // Start card timer
+       /*  Start card timer */
        for (i = 0; i < devpriv->n_channels; i++) {
                struct jr3_pci_subdev_private *p = dev->subdevices[i].private;