Staging: comedi: Remove parentheses around right side assignment
authorHaneen Mohammed <hamohammed.sa@gmail.com>
Fri, 13 Mar 2015 11:29:30 +0000 (14:29 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 15 Mar 2015 17:41:15 +0000 (18:41 +0100)
Parentheses are not needed around the right hand side of an assignment.
This patch remove parenthese of such occurences. Issue was detected and
solved using the following coccinelle script:

@rule1@
identifier x, y, z;
expression E1, E2;
@@

(
x = (y == z);
|
x = (E1 == E2);
|
 x =
-(
...
-)
 ;
)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/addi_apci_3501.c
drivers/staging/comedi/drivers/ni_mio_common.c
drivers/staging/comedi/drivers/serial2002.c

index b8f336681788463daf3d6372c529f0b5012de1d0..babbdffefa882ebf09a0fe1b993468b7ff20ad18 100644 (file)
@@ -270,7 +270,7 @@ static irqreturn_t apci3501_interrupt(int irq, void *d)
 
        /*  Disable Interrupt */
        ul_Command1 = inl(dev->iobase + APCI3501_TIMER_CTRL_REG);
-       ul_Command1 = (ul_Command1 & 0xFFFFF9FDul);
+       ul_Command1 = ul_Command1 & 0xFFFFF9FDul;
        outl(ul_Command1, dev->iobase + APCI3501_TIMER_CTRL_REG);
 
        ui_Timer_AOWatchdog = inl(dev->iobase + APCI3501_TIMER_IRQ_REG) & 0x1;
@@ -282,7 +282,7 @@ static irqreturn_t apci3501_interrupt(int irq, void *d)
        /* Enable Interrupt Send a signal to from kernel to user space */
        send_sig(SIGIO, devpriv->tsk_Current, 0);
        ul_Command1 = inl(dev->iobase + APCI3501_TIMER_CTRL_REG);
-       ul_Command1 = ((ul_Command1 & 0xFFFFF9FDul) | 1 << 1);
+       ul_Command1 = (ul_Command1 & 0xFFFFF9FDul) | 1 << 1;
        outl(ul_Command1, dev->iobase + APCI3501_TIMER_CTRL_REG);
        inl(dev->iobase + APCI3501_TIMER_STATUS_REG);
 
index 42fdedd6943cd76f325bcdf0efb6409cc42f2066..ecfd0544cf4086a5c7be14e64761b3e9af930689 100644 (file)
@@ -1360,7 +1360,7 @@ static void get_last_sample_611x(struct comedi_device *dev)
        /* Check if there's a single sample stuck in the FIFO */
        if (ni_readb(dev, XXX_Status) & 0x80) {
                dl = ni_readl(dev, ADC_FIFO_Data_611x);
-               data = (dl & 0xffff);
+               data = dl & 0xffff;
                comedi_buf_write_samples(s, &data, 1);
        }
 }
@@ -1871,7 +1871,7 @@ static void ni_m_series_load_channelgain_list(struct comedi_device *dev,
                chan = CR_CHAN(list[0]);
                range = CR_RANGE(list[0]);
                range_code = ni_gainlkup[board->gainlkup][range];
-               dither = ((list[0] & CR_ALT_FILTER) != 0);
+               dither = (list[0] & CR_ALT_FILTER) != 0;
                bypass_bits = MSeries_AI_Bypass_Config_FIFO_Bit;
                bypass_bits |= chan;
                bypass_bits |=
@@ -1895,7 +1895,7 @@ static void ni_m_series_load_channelgain_list(struct comedi_device *dev,
                chan = CR_CHAN(list[i]);
                aref = CR_AREF(list[i]);
                range = CR_RANGE(list[i]);
-               dither = ((list[i] & CR_ALT_FILTER) != 0);
+               dither = (list[i] & CR_ALT_FILTER) != 0;
 
                range_code = ni_gainlkup[board->gainlkup][range];
                devpriv->ai_offset[i] = 0;
@@ -2021,7 +2021,7 @@ static void ni_load_channelgain_list(struct comedi_device *dev,
                        chan = CR_CHAN(list[i]);
                aref = CR_AREF(list[i]);
                range = CR_RANGE(list[i]);
-               dither = ((list[i] & CR_ALT_FILTER) != 0);
+               dither = (list[i] & CR_ALT_FILTER) != 0;
 
                /* fix the external/internal range differences */
                range = ni_gainlkup[board->gainlkup][range];
index 482a2a8a4a570e4a9d3c814c1c5a9d8e510c2d28..ad35ed6e93f0a26554348922ee02f04e758f6f04 100644 (file)
@@ -143,8 +143,8 @@ static void serial2002_tty_read_poll_wait(struct file *f, int timeout)
                        break;
                }
                do_gettimeofday(&now);
-               elapsed = (1000000 * (now.tv_sec - start.tv_sec) +
-                         now.tv_usec - start.tv_usec);
+               elapsed = 1000000 * (now.tv_sec - start.tv_sec) +
+                         now.tv_usec - start.tv_usec;
                if (elapsed > timeout)
                        break;
                set_current_state(TASK_INTERRUPTIBLE);