]> Pileus Git - ~andy/linux/commitdiff
Staging: comedi: remove assignment in conditionals
authorBill Pemberton <wfp5p@virginia.edu>
Thu, 23 Apr 2009 01:11:47 +0000 (21:11 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 19 Jun 2009 18:00:32 +0000 (11:00 -0700)
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
57 files changed:
drivers/staging/comedi/drivers/8255.c
drivers/staging/comedi/drivers/addi-data/addi_common.c
drivers/staging/comedi/drivers/addi-data/amcc_s5933_58.h
drivers/staging/comedi/drivers/addi-data/hwdrv_APCI1710.c
drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c
drivers/staging/comedi/drivers/adl_pci9111.c
drivers/staging/comedi/drivers/adl_pci9118.c
drivers/staging/comedi/drivers/adv_pci1710.c
drivers/staging/comedi/drivers/adv_pci1723.c
drivers/staging/comedi/drivers/adv_pci_dio.c
drivers/staging/comedi/drivers/amplc_dio200.c
drivers/staging/comedi/drivers/amplc_pc236.c
drivers/staging/comedi/drivers/amplc_pc263.c
drivers/staging/comedi/drivers/amplc_pci224.c
drivers/staging/comedi/drivers/cb_das16_cs.c
drivers/staging/comedi/drivers/cb_pcimdda.c
drivers/staging/comedi/drivers/comedi_rt_timer.c
drivers/staging/comedi/drivers/daqboard2000.c
drivers/staging/comedi/drivers/das08.c
drivers/staging/comedi/drivers/das08_cs.c
drivers/staging/comedi/drivers/das16.c
drivers/staging/comedi/drivers/das16m1.c
drivers/staging/comedi/drivers/das6402.c
drivers/staging/comedi/drivers/dt2801.c
drivers/staging/comedi/drivers/dt2811.c
drivers/staging/comedi/drivers/dt2814.c
drivers/staging/comedi/drivers/dt2817.c
drivers/staging/comedi/drivers/dt282x.c
drivers/staging/comedi/drivers/dt3000.c
drivers/staging/comedi/drivers/ii_pci20kc.c
drivers/staging/comedi/drivers/jr3_pci.c
drivers/staging/comedi/drivers/ke_counter.c
drivers/staging/comedi/drivers/ni_6527.c
drivers/staging/comedi/drivers/ni_65xx.c
drivers/staging/comedi/drivers/ni_660x.c
drivers/staging/comedi/drivers/ni_670x.c
drivers/staging/comedi/drivers/ni_atmio.c
drivers/staging/comedi/drivers/ni_atmio16d.c
drivers/staging/comedi/drivers/ni_daq_700.c
drivers/staging/comedi/drivers/ni_daq_dio24.c
drivers/staging/comedi/drivers/ni_labpc_cs.c
drivers/staging/comedi/drivers/ni_mio_cs.c
drivers/staging/comedi/drivers/ni_pcimio.c
drivers/staging/comedi/drivers/pcl711.c
drivers/staging/comedi/drivers/pcl724.c
drivers/staging/comedi/drivers/pcl726.c
drivers/staging/comedi/drivers/pcl812.c
drivers/staging/comedi/drivers/pcl816.c
drivers/staging/comedi/drivers/pcl818.c
drivers/staging/comedi/drivers/pcm3724.c
drivers/staging/comedi/drivers/pcmad.c
drivers/staging/comedi/drivers/pcmmio.c
drivers/staging/comedi/drivers/pcmuio.c
drivers/staging/comedi/drivers/quatech_daqp_cs.c
drivers/staging/comedi/drivers/rti800.c
drivers/staging/comedi/drivers/unioxx5.c

index 63fc08a3ad7be37c6dcd95a4739338bc115e513a..e8206a18dee97ced79c2b281e2db18e409a386e7 100644 (file)
@@ -394,7 +394,8 @@ static int dev_8255_attach(struct comedi_device *dev, struct comedi_devconfig *
                return -EINVAL;
        }
 
-       if ((ret = alloc_subdevices(dev, i)) < 0)
+       ret = alloc_subdevices(dev, i);
+       if (ret < 0)
                return ret;
 
        for (i = 0; i < dev->n_subdevices; i++) {
index 198ef1cd40e97faee616cf4e64eee3cf7f6f9d45..a6c3530674dfad368f88c49565c70aa2e3b4c4d2 100644 (file)
@@ -2575,9 +2575,9 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
        sprintf(c_Identifier, "Addi-Data GmbH Comedi %s",
                this_board->pc_DriverName);
 
-       if ((ret = alloc_private(dev, sizeof(struct addi_private))) < 0) {
+       ret = alloc_private(dev, sizeof(struct addi_private));
+       if (ret < 0)
                return -ENOMEM;
-       }
 
        if (!pci_list_builded) {
                v_pci_card_list_init(this_board->i_VendorId, 1);        /* 1 for displaying the list.. */
@@ -2589,12 +2589,14 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
                i_Dma = 1;
        }
 
-       if ((card = ptr_select_and_alloc_pci_card(this_board->i_VendorId,
-                               this_board->i_DeviceId,
-                               it->options[0],
-                               it->options[1], i_Dma)) == NULL) {
+       card = ptr_select_and_alloc_pci_card(this_board->i_VendorId,
+                                            this_board->i_DeviceId,
+                                            it->options[0],
+                                            it->options[1], i_Dma);
+
+       if (card == NULL)
                return -EIO;
-       }
+
        devpriv->allocated = 1;
 
        if ((i_pci_card_data(card, &pci_bus, &pci_slot, &pci_func, &io_addr[0],
@@ -2698,12 +2700,11 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
                        devpriv->b_DmaDoubleBuffer = 0;
                        for (i = 0; i < 2; i++) {
                                for (pages = 4; pages >= 0; pages--) {
-                                       if ((devpriv->ul_DmaBufferVirtual[i] =
-                                                       (void *)
-                                                       __get_free_pages
-                                                       (GFP_KERNEL, pages))) {
+                                       devpriv->ul_DmaBufferVirtual[i] =
+                                               (void *) __get_free_pages(GFP_KERNEL, pages);
+
+                                       if (devpriv->ul_DmaBufferVirtual[i])
                                                break;
-                                       }
                                }
                                if (devpriv->ul_DmaBufferVirtual[i]) {
                                        devpriv->ui_DmaBufferPages[i] = pages;
@@ -2745,7 +2746,8 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
        } else {
                /* Update-0.7.57->0.7.68dev->n_subdevices = 7; */
                n_subdevices = 7;
-               if ((ret = alloc_subdevices(dev, n_subdevices)) < 0)
+               ret = alloc_subdevices(dev, n_subdevices);
+               if (ret < 0)
                        return ret;
 
                /*  Allocate and Initialise AI Subdevice Structures */
index bee6101d2e8728dcc991d91104cf13f007883940..ba89ff93a4e19f26078051129d3c8c9e64bf8772 100644 (file)
@@ -423,9 +423,8 @@ struct pcilst_struct *ptr_select_and_alloc_pci_card(unsigned short vendor_id,
        struct pcilst_struct *card;
 
        if ((pci_bus < 1) & (pci_slot < 1)) {   /*  use autodetection */
-               if ((card = ptr_find_free_pci_card_by_device(vendor_id,
-                                                            device_id)) ==
-                   NULL) {
+               card = ptr_find_free_pci_card_by_device(vendor_id, device_id);
+               if (card == NULL) {
                        rt_printk(" - Unused card not found in system!\n");
                        return NULL;
                }
index 355a0c8ab41eddb2f51eb30fc5d6e4b330b2c379..508e19e9e0dcf4ea5ab63d992cd0e3145fd5a1d0 100644 (file)
@@ -1,4 +1,4 @@
-/**
+//**
 @verbatim
 
 Copyright (C) 2004,2005  ADDI-DATA GmbH for the source code of this module.
@@ -63,7 +63,8 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
        int n_subdevices = 9;
 
        /* Update-0.7.57->0.7.68dev->n_subdevices = 9; */
-       if ((ret = alloc_subdevices(dev, n_subdevices)) < 0)
+       ret = alloc_subdevices(dev, n_subdevices);
+       if (ret < 0)
                return;
 
        /*  Allocate and Initialise Timer Subdevice Structures */
index 871ed763fe2d0e774c95fdf86220c01b6b770b6f..3a47c303422903cffbfd318b768ad833b49d373d 100644 (file)
@@ -975,96 +975,117 @@ static void v_APCI1564_Interrupt(int irq, void *d)
 
        }                       /*  if  (ui_DO) */
 
-       if ((ui_Timer == 1) && (devpriv->b_TimerSelectMode = ADDIDATA_TIMER)) {
-               /*  Disable Timer Interrupt */
-               ul_Command2 =
-                       inl(devpriv->i_IobaseAmcc + APCI1564_TIMER +
-                       APCI1564_TCW_PROG);
-               outl(0x0,
-                       devpriv->i_IobaseAmcc + APCI1564_TIMER +
-                       APCI1564_TCW_PROG);
+       if (ui_Timer == 1) {
+               devpriv->b_TimerSelectMode = ADDIDATA_TIMER;
+               if (devpriv->b_TimerSelectMode) {
 
-               /* Send a signal to from kernel to user space */
-               send_sig(SIGIO, devpriv->tsk_Current, 0);
+                       /*  Disable Timer Interrupt */
+                       ul_Command2 =
+                               inl(devpriv->i_IobaseAmcc + APCI1564_TIMER +
+                                   APCI1564_TCW_PROG);
+                       outl(0x0,
+                            devpriv->i_IobaseAmcc + APCI1564_TIMER +
+                            APCI1564_TCW_PROG);
 
-               /*  Enable Timer Interrupt */
+                       /* Send a signal to from kernel to user space */
+                       send_sig(SIGIO, devpriv->tsk_Current, 0);
 
-               outl(ul_Command2,
-                       devpriv->i_IobaseAmcc + APCI1564_TIMER +
-                       APCI1564_TCW_PROG);
-       }                       /*  if  ((ui_Timer == 1) && (devpriv->b_TimerSelectMode =ADDIDATA_TIMER)) */
+                       /*  Enable Timer Interrupt */
 
-       if ((ui_C1 == 1) && (devpriv->b_TimerSelectMode = ADDIDATA_COUNTER)) {
-               /*  Disable Counter Interrupt */
-               ul_Command2 =
-                       inl(devpriv->iobase + APCI1564_COUNTER1 +
-                       APCI1564_TCW_PROG);
-               outl(0x0,
-                       devpriv->iobase + APCI1564_COUNTER1 +
-                       APCI1564_TCW_PROG);
+                       outl(ul_Command2,
+                            devpriv->i_IobaseAmcc + APCI1564_TIMER +
+                            APCI1564_TCW_PROG);
+               }
+       }/* if  (ui_Timer == 1) */
 
-               /* Send a signal to from kernel to user space */
-               send_sig(SIGIO, devpriv->tsk_Current, 0);
 
-               /*  Enable Counter Interrupt */
-               outl(ul_Command2,
-                       devpriv->iobase + APCI1564_COUNTER1 +
-                       APCI1564_TCW_PROG);
-       }                       /*  if  ((ui_C1 == 1) && (devpriv->b_TimerSelectMode = ADDIDATA_COUNTER)) */
+       if (ui_C1 == 1) {
+               devpriv->b_TimerSelectMode = ADDIDATA_COUNTER;
+               if (devpriv->b_TimerSelectMode) {
 
-       if ((ui_C2 == 1) && (devpriv->b_TimerSelectMode = ADDIDATA_COUNTER)) {
-               /*  Disable Counter Interrupt */
-               ul_Command2 =
-                       inl(devpriv->iobase + APCI1564_COUNTER2 +
-                       APCI1564_TCW_PROG);
-               outl(0x0,
-                       devpriv->iobase + APCI1564_COUNTER2 +
-                       APCI1564_TCW_PROG);
+                       /*  Disable Counter Interrupt */
+                       ul_Command2 =
+                               inl(devpriv->iobase + APCI1564_COUNTER1 +
+                                   APCI1564_TCW_PROG);
+                       outl(0x0,
+                            devpriv->iobase + APCI1564_COUNTER1 +
+                            APCI1564_TCW_PROG);
 
-               /* Send a signal to from kernel to user space */
-               send_sig(SIGIO, devpriv->tsk_Current, 0);
+                       /* Send a signal to from kernel to user space */
+                       send_sig(SIGIO, devpriv->tsk_Current, 0);
 
-               /*  Enable Counter Interrupt */
-               outl(ul_Command2,
-                       devpriv->iobase + APCI1564_COUNTER2 +
-                       APCI1564_TCW_PROG);
-       }                       /*  if  ((ui_C2 == 1) && (devpriv->b_TimerSelectMode =ADDIDATA_COUNTER)) */
+                       /*  Enable Counter Interrupt */
+                       outl(ul_Command2,
+                            devpriv->iobase + APCI1564_COUNTER1 +
+                            APCI1564_TCW_PROG);
+               }
+       } /* if  (ui_C1 == 1) */
 
-       if ((ui_C3 == 1) && (devpriv->b_TimerSelectMode = ADDIDATA_COUNTER)) {
-               /*  Disable Counter Interrupt */
-               ul_Command2 =
-                       inl(devpriv->iobase + APCI1564_COUNTER3 +
-                       APCI1564_TCW_PROG);
-               outl(0x0,
-                       devpriv->iobase + APCI1564_COUNTER3 +
-                       APCI1564_TCW_PROG);
+       if (ui_C2 == 1) {
+               devpriv->b_TimerSelectMode = ADDIDATA_COUNTER;
+               if (devpriv->b_TimerSelectMode) {
 
-               /* Send a signal to from kernel to user space */
-               send_sig(SIGIO, devpriv->tsk_Current, 0);
+                       /*  Disable Counter Interrupt */
+                       ul_Command2 =
+                               inl(devpriv->iobase + APCI1564_COUNTER2 +
+                                   APCI1564_TCW_PROG);
+                       outl(0x0,
+                            devpriv->iobase + APCI1564_COUNTER2 +
+                            APCI1564_TCW_PROG);
 
-               /*  Enable Counter Interrupt */
-               outl(ul_Command2,
-                       devpriv->iobase + APCI1564_COUNTER3 +
-                       APCI1564_TCW_PROG);
-       }                       /*  if ((ui_C3 == 1) && (devpriv->b_TimerSelectMode =ADDIDATA_COUNTER)) */
+                       /* Send a signal to from kernel to user space */
+                       send_sig(SIGIO, devpriv->tsk_Current, 0);
 
-       if ((ui_C4 == 1) && (devpriv->b_TimerSelectMode = ADDIDATA_COUNTER)) {
-               /*  Disable Counter Interrupt */
-               ul_Command2 =
-                       inl(devpriv->iobase + APCI1564_COUNTER4 +
-                       APCI1564_TCW_PROG);
-               outl(0x0,
-                       devpriv->iobase + APCI1564_COUNTER4 +
-                       APCI1564_TCW_PROG);
+                       /*  Enable Counter Interrupt */
+                       outl(ul_Command2,
+                            devpriv->iobase + APCI1564_COUNTER2 +
+                            APCI1564_TCW_PROG);
+               }
+       } /*  if  ((ui_C2 == 1) */
 
-               /* Send a signal to from kernel to user space */
-               send_sig(SIGIO, devpriv->tsk_Current, 0);
+       if (ui_C3 == 1) {
+               devpriv->b_TimerSelectMode = ADDIDATA_COUNTER;
+               if (devpriv->b_TimerSelectMode) {
 
-               /*  Enable Counter Interrupt */
-               outl(ul_Command2,
-                       devpriv->iobase + APCI1564_COUNTER4 +
-                       APCI1564_TCW_PROG);
-       }                       /*  if ((ui_C4 == 1) && (devpriv->b_TimerSelectMode =ADDIDATA_COUNTER)) */
+                       /*  Disable Counter Interrupt */
+                       ul_Command2 =
+                               inl(devpriv->iobase + APCI1564_COUNTER3 +
+                                   APCI1564_TCW_PROG);
+                       outl(0x0,
+                            devpriv->iobase + APCI1564_COUNTER3 +
+                            APCI1564_TCW_PROG);
+
+                       /* Send a signal to from kernel to user space */
+                       send_sig(SIGIO, devpriv->tsk_Current, 0);
+
+                       /*  Enable Counter Interrupt */
+                       outl(ul_Command2,
+                            devpriv->iobase + APCI1564_COUNTER3 +
+                            APCI1564_TCW_PROG);
+               }
+       }       /*  if ((ui_C3 == 1) */
+
+       if (ui_C4 == 1) {
+               devpriv->b_TimerSelectMode = ADDIDATA_COUNTER;
+               if (devpriv->b_TimerSelectMode) {
+
+                       /*  Disable Counter Interrupt */
+                       ul_Command2 =
+                               inl(devpriv->iobase + APCI1564_COUNTER4 +
+                                   APCI1564_TCW_PROG);
+                       outl(0x0,
+                            devpriv->iobase + APCI1564_COUNTER4 +
+                            APCI1564_TCW_PROG);
+
+                       /* Send a signal to from kernel to user space */
+                       send_sig(SIGIO, devpriv->tsk_Current, 0);
+
+                       /*  Enable Counter Interrupt */
+                       outl(ul_Command2,
+                            devpriv->iobase + APCI1564_COUNTER4 +
+                            APCI1564_TCW_PROG);
+               }
+       }       /*  if (ui_C4 == 1) */
        return;
 }
 
index cac233e83a506af3c714cee53c3179f18cc943be..fd74c409b8460c2ab7d44dc5cad00a569aaee944 100644 (file)
@@ -614,8 +614,8 @@ void v_APCI3XXX_Interrupt(int irq, void *d)
        /* Test if interrupt occur */
        /***************************/
 
-       if (((dw_Status = readl((void *)(devpriv->dw_AiBase + 16))) & 0x2UL) ==
-               0x2UL) {
+       dw_Status = readl((void *)(devpriv->dw_AiBase + 16));
+       if ( (dw_Status & 0x2UL) == 0x2UL) {
           /***********************/
                /* Reset the interrupt */
           /***********************/
index aed4a47a7988a1c8e5b624e43bee99d05800bc08..6dc9435997ca9946d71a2b1db7d8da49e684d8a8 100644 (file)
@@ -1310,7 +1310,8 @@ static int pci9111_attach(struct comedi_device *dev, struct comedi_devconfig *it
 
        /*  TODO: Add external multiplexer setup (according to option[2]). */
 
-       if ((error = alloc_subdevices(dev, 4)) < 0)
+       error = alloc_subdevices(dev, 4);
+       if (error < 0)
                return error;
 
        subdevice = dev->subdevices + 0;
index 20f7bf0c2b42c2414758ee31068e6ac93c3cedba..a1e669cf4cc6c4b1e191f8eac1f641bc7b35c412 100644 (file)
@@ -1474,11 +1474,10 @@ static int pci9118_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
        s->async->cur_chan = 0;
        devpriv->ai_buf_ptr = 0;
 
-       if (devpriv->usedma) {
+       if (devpriv->usedma)
                ret = pci9118_ai_docmd_dma(dev, s);
-       } else {
+       else
                ret = pci9118_ai_docmd_sampl(dev, s);
-       }
 
        DPRINTK("adl_pci9118 EDBG: END: pci9118_ai_cmd()\n");
        return ret;
@@ -1860,7 +1859,8 @@ static int pci9118_attach(struct comedi_device *dev, struct comedi_devconfig *it
                master = 1;
        }
 
-       if ((ret = alloc_private(dev, sizeof(struct pci9118_private))) < 0) {
+       ret = alloc_private(dev, sizeof(struct pci9118_private));
+       if (ret < 0) {
                rt_printk(" - Allocation failed!\n");
                return -ENOMEM;
        }
@@ -1940,11 +1940,13 @@ static int pci9118_attach(struct comedi_device *dev, struct comedi_devconfig *it
        if (master) {           /*  alloc DMA buffers */
                devpriv->dma_doublebuf = 0;
                for (i = 0; i < 2; i++) {
-                       for (pages = 4; pages >= 0; pages--)
-                               if ((devpriv->dmabuf_virt[i] = (short *)
-                                               __get_free_pages(GFP_KERNEL,
-                                                       pages)))
+                       for (pages = 4; pages >= 0; pages--) {
+                               devpriv->dmabuf_virt[i] =
+                                       (short *) __get_free_pages(GFP_KERNEL,
+                                                                  pages);
+                               if (devpriv->dmabuf_virt[i])
                                        break;
+                       }
                        if (devpriv->dmabuf_virt[i]) {
                                devpriv->dmabuf_pages[i] = pages;
                                devpriv->dmabuf_size[i] = PAGE_SIZE * pages;
@@ -1965,11 +1967,11 @@ static int pci9118_attach(struct comedi_device *dev, struct comedi_devconfig *it
 
        }
 
-       if ((devpriv->master = master)) {
+       devpriv->master = master;
+       if (devpriv->master)
                rt_printk(", bus master");
-       } else {
+       else
                rt_printk(", no bus master");
-       }
 
        devpriv->usemux = 0;
        if (it->options[2] > 0) {
@@ -1998,7 +2000,8 @@ static int pci9118_attach(struct comedi_device *dev, struct comedi_devconfig *it
        pci_read_config_word(devpriv->pcidev, PCI_COMMAND, &u16w);
        pci_write_config_word(devpriv->pcidev, PCI_COMMAND, u16w | 64); /*  Enable parity check for parity error */
 
-       if ((ret = alloc_subdevices(dev, 4)) < 0)
+       ret = alloc_subdevices(dev, 4);
+       if (ret < 0)
                return ret;
 
        s = dev->subdevices + 0;
index 37f1459d152c668c7380ff8cca40aa2d07610332..f0aa576dc9e87bf0ea58de802484df279189a2cf 100644 (file)
@@ -1336,7 +1336,8 @@ static int pci1710_attach(struct comedi_device *dev, struct comedi_devconfig *it
        opt_bus = it->options[0];
        opt_slot = it->options[1];
 
-       if ((ret = alloc_private(dev, sizeof(struct pci1710_private))) < 0) {
+       ret = alloc_private(dev, sizeof(struct pci1710_private));
+       if (ret < 0) {
                rt_printk(" - Allocation failed!\n");
                return -ENOMEM;
        }
@@ -1419,7 +1420,8 @@ static int pci1710_attach(struct comedi_device *dev, struct comedi_devconfig *it
        if (this_board->n_counter)
                n_subdevices++;
 
-       if ((ret = alloc_subdevices(dev, n_subdevices)) < 0) {
+       ret = alloc_subdevices(dev, n_subdevices);
+       if (ret < 0) {
                rt_printk(" - Allocation failed!\n");
                return ret;
        }
index e45ce552dd02cfd5c308bec55bbf1d73b1f7b3f9..38be3f8be07888e49228ededc21b24d9c42df102 100644 (file)
@@ -310,7 +310,8 @@ static int pci1723_attach(struct comedi_device *dev, struct comedi_devconfig *it
        opt_bus = it->options[0];
        opt_slot = it->options[1];
 
-       if ((ret = alloc_private(dev, sizeof(struct pci1723_private))) < 0) {
+       ret = alloc_private(dev, sizeof(struct pci1723_private));
+       if (ret < 0) {
                rt_printk(" - Allocation failed!\n");
                return -ENOMEM;
        }
@@ -369,7 +370,8 @@ static int pci1723_attach(struct comedi_device *dev, struct comedi_devconfig *it
        if (this_board->n_diochan)
                n_subdevices++;
 
-       if ((ret = alloc_subdevices(dev, n_subdevices)) < 0) {
+       ret = alloc_subdevices(dev, n_subdevices);
+       if (ret < 0) {
                rt_printk(" - Allocation failed!\n");
                return ret;
        }
index 21fd9aa8decc893dcab2c7ef57de1ebf070a15af..afa2a4d3816d4d756ee607e29350203faceac8e7 100644 (file)
@@ -443,7 +443,8 @@ static int pci1760_unchecked_mbxrequest(struct comedi_device *dev,
                outb(omb[2], dev->iobase + OMB2);
                outb(omb[3], dev->iobase + OMB3);
                for (tout = 0; tout < 251; tout++) {
-                       if ((imb[2] = inb(dev->iobase + IMB2)) == omb[2]) {
+                       imb[2] = inb(dev->iobase + IMB2);
+                       if (imb[2] == omb[2]) {
                                imb[0] = inb(dev->iobase + IMB0);
                                imb[1] = inb(dev->iobase + IMB1);
                                imb[3] = inb(dev->iobase + IMB3);
@@ -517,7 +518,8 @@ static int pci1760_insn_bits_do(struct comedi_device *dev, struct comedi_subdevi
                s->state &= ~data[0];
                s->state |= (data[0] & data[1]);
                omb[0] = s->state;
-               if (!(ret = pci1760_mbxrequest(dev, omb, imb)))
+               ret = pci1760_mbxrequest(dev, omb, imb);
+               if (!ret)
                        return ret;
        }
        data[1] = s->state;
@@ -541,7 +543,8 @@ static int pci1760_insn_cnt_read(struct comedi_device *dev, struct comedi_subdev
        unsigned char imb[4];
 
        for (n = 0; n < insn->n; n++) {
-               if (!(ret = pci1760_mbxrequest(dev, omb, imb)))
+               ret = pci1760_mbxrequest(dev, omb, imb);
+               if (!ret)
                        return ret;
                data[n] = (imb[1] << 8) + imb[0];
        }
@@ -567,20 +570,23 @@ static int pci1760_insn_cnt_write(struct comedi_device *dev, struct comedi_subde
        unsigned char imb[4];
 
        if (devpriv->CntResValue[chan] != (data[0] & 0xffff)) { /*  Set reset value if different */
-               if (!(ret = pci1760_mbxrequest(dev, omb, imb)))
+               ret =  pci1760_mbxrequest(dev, omb, imb);
+               if (!ret)
                        return ret;
                devpriv->CntResValue[chan] = data[0] & 0xffff;
        }
 
        omb[0] = bitmask;       /*  reset counter to it reset value */
        omb[2] = CMD_ResetIDICounters;
-       if (!(ret = pci1760_mbxrequest(dev, omb, imb)))
+       ret = pci1760_mbxrequest(dev, omb, imb);
+       if (!ret)
                return ret;
 
        if (!(bitmask & devpriv->IDICntEnable)) {       /*  start counter if it don't run */
                omb[0] = bitmask;
                omb[2] = CMD_EnableIDICounters;
-               if (!(ret = pci1760_mbxrequest(dev, omb, imb)))
+               ret = pci1760_mbxrequest(dev, omb, imb);
+               if (!ret)
                        return ret;
                devpriv->IDICntEnable |= bitmask;
        }
@@ -892,7 +898,8 @@ static int pci_dio_attach(struct comedi_device *dev, struct comedi_devconfig *it
 
        rt_printk("comedi%d: adv_pci_dio: ", dev->minor);
 
-       if ((ret = alloc_private(dev, sizeof(struct pci_dio_private))) < 0) {
+       ret = alloc_private(dev, sizeof(struct pci_dio_private));
+       if (ret < 0) {
                rt_printk(", Error: Cann't allocate private memory!\n");
                return -ENOMEM;
        }
@@ -959,7 +966,8 @@ static int pci_dio_attach(struct comedi_device *dev, struct comedi_devconfig *it
                        n_subdevices++;
        }
 
-       if ((ret = alloc_subdevices(dev, n_subdevices)) < 0) {
+       ret = alloc_subdevices(dev, n_subdevices);
+       if (ret < 0) {
                rt_printk(", Error: Cann't allocate subdevice memory!\n");
                return ret;
        }
index 563fb0ba06e84537356e441469b60455e16b6f15..7c323e242835fb38cdc465007671864eb10bda77 100644 (file)
@@ -1282,7 +1282,8 @@ static int dio200_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        printk(KERN_DEBUG "comedi%d: %s: attach\n", dev->minor,
                DIO200_DRIVER_NAME);
 
-       if ((ret = alloc_private(dev, sizeof(struct dio200_private))) < 0) {
+       ret = alloc_private(dev, sizeof(struct dio200_private));
+       if (ret < 0) {
                printk(KERN_ERR "comedi%d: error! out of memory!\n",
                        dev->minor);
                return ret;
@@ -1301,7 +1302,8 @@ static int dio200_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                slot = it->options[1];
                share_irq = 1;
 
-               if ((ret = dio200_find_pci(dev, bus, slot, &pci_dev)) < 0)
+               ret = dio200_find_pci(dev, bus, slot, &pci_dev);
+               if (ret < 0)
                        return ret;
                devpriv->pci_dev = pci_dev;
                break;
@@ -1339,7 +1341,9 @@ static int dio200_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        dev->iobase = iobase;
 
        layout = thislayout;
-       if ((ret = alloc_subdevices(dev, layout->n_subdevs)) < 0) {
+
+       ret = alloc_subdevices(dev, layout->n_subdevs);
+       if (ret < 0) {
                printk(KERN_ERR "comedi%d: error! out of memory!\n",
                        dev->minor);
                return ret;
index 4efdd12596369109faed318e5cd6c11d2c68beae..8454f6d6517e443ff085e90bfda3f1714e72b426 100644 (file)
@@ -284,7 +284,8 @@ static int pc236_attach(struct comedi_device *dev, struct comedi_devconfig *it)
  * Allocate the private structure area.  alloc_private() is a
  * convenient macro defined in comedidev.h.
  */
-       if ((ret = alloc_private(dev, sizeof(struct pc236_private))) < 0) {
+       ret = alloc_private(dev, sizeof(struct pc236_private));
+       if (ret < 0) {
                printk(KERN_ERR "comedi%d: error! out of memory!\n",
                        dev->minor);
                return ret;
@@ -302,7 +303,8 @@ static int pc236_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                slot = it->options[1];
                share_irq = 1;
 
-               if ((ret = pc236_find_pci(dev, bus, slot, &pci_dev)) < 0)
+               ret = pc236_find_pci(dev, bus, slot, &pci_dev);
+               if (ret < 0)
                        return ret;
                devpriv->pci_dev = pci_dev;
                break;
@@ -323,7 +325,9 @@ static int pc236_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        /* Enable device and reserve I/O spaces. */
 #ifdef CONFIG_COMEDI_PCI
        if (pci_dev) {
-               if ((ret = comedi_pci_enable(pci_dev, PC236_DRIVER_NAME)) < 0) {
+
+               ret = comedi_pci_enable(pci_dev, PC236_DRIVER_NAME);
+               if (ret < 0) {
                        printk(KERN_ERR
                                "comedi%d: error! cannot enable PCI device and request regions!\n",
                                dev->minor);
@@ -346,7 +350,8 @@ static int pc236_attach(struct comedi_device *dev, struct comedi_devconfig *it)
  * Allocate the subdevice structures.  alloc_subdevice() is a
  * convenient macro defined in comedidev.h.
  */
-       if ((ret = alloc_subdevices(dev, 2)) < 0) {
+       ret = alloc_subdevices(dev, 2);
+       if (ret < 0) {
                printk(KERN_ERR "comedi%d: error! out of memory!\n",
                        dev->minor);
                return ret;
@@ -354,7 +359,8 @@ static int pc236_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
        s = dev->subdevices + 0;
        /* digital i/o subdevice (8255) */
-       if ((ret = subdev_8255_init(dev, s, NULL, iobase)) < 0) {
+       ret = subdev_8255_init(dev, s, NULL, iobase);
+       if (ret < 0) {
                printk(KERN_ERR "comedi%d: error! out of memory!\n",
                        dev->minor);
                return ret;
index 1ca704760067ee92a286f0ccbe8a7235f67158bf..8a94360fe2db46700425fb316cfa464e1b4bdfa7 100644 (file)
@@ -236,7 +236,8 @@ static int pc263_attach(struct comedi_device *dev, struct comedi_devconfig *it)
  * convenient macro defined in comedidev.h.
  */
 #ifdef CONFIG_COMEDI_PCI
-       if ((ret = alloc_private(dev, sizeof(struct pc263_private))) < 0) {
+       ret = alloc_private(dev, sizeof(struct pc263_private));
+       if (ret < 0) {
                printk(KERN_ERR "comedi%d: error! out of memory!\n",
                        dev->minor);
                return ret;
@@ -252,7 +253,8 @@ static int pc263_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                bus = it->options[0];
                slot = it->options[1];
 
-               if ((ret = pc263_find_pci(dev, bus, slot, &pci_dev)) < 0)
+               ret = pc263_find_pci(dev, bus, slot, &pci_dev);
+               if (ret < 0)
                        return ret;
                devpriv->pci_dev = pci_dev;
                break;
@@ -273,7 +275,8 @@ static int pc263_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        /* Enable device and reserve I/O spaces. */
 #ifdef CONFIG_COMEDI_PCI
        if (pci_dev) {
-               if ((ret = comedi_pci_enable(pci_dev, PC263_DRIVER_NAME)) < 0) {
+               ret = comedi_pci_enable(pci_dev, PC263_DRIVER_NAME);
+               if (ret < 0) {
                        printk(KERN_ERR
                                "comedi%d: error! cannot enable PCI device and request regions!\n",
                                dev->minor);
@@ -294,7 +297,8 @@ static int pc263_attach(struct comedi_device *dev, struct comedi_devconfig *it)
  * Allocate the subdevice structures.  alloc_subdevice() is a
  * convenient macro defined in comedidev.h.
  */
-       if ((ret = alloc_subdevices(dev, 1)) < 0) {
+       ret = alloc_subdevices(dev, 1);
+       if (ret < 0) {
                printk(KERN_ERR "comedi%d: error! out of memory!\n",
                        dev->minor);
                return ret;
index 9037ff4bf0e6096b1167262856e72a8cdf829049..7cc594b380704e3504bb72dfeacf78128dbc4fe1 100644 (file)
@@ -1338,16 +1338,20 @@ static int pci224_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
        bus = it->options[0];
        slot = it->options[1];
-       if ((ret = alloc_private(dev, sizeof(struct pci224_private))) < 0) {
+       ret = alloc_private(dev, sizeof(struct pci224_private));
+       if (ret < 0) {
                printk(KERN_ERR "comedi%d: error! out of memory!\n",
                        dev->minor);
                return ret;
        }
-       if ((ret = pci224_find_pci(dev, bus, slot, &pci_dev)) < 0)
+
+       ret = pci224_find_pci(dev, bus, slot, &pci_dev);
+       if (ret < 0)
                return ret;
-       devpriv->pci_dev = pci_dev;
 
-       if ((ret = comedi_pci_enable(pci_dev, DRIVER_NAME)) < 0) {
+       devpriv->pci_dev = pci_dev;
+       ret = comedi_pci_enable(pci_dev, DRIVER_NAME);
+       if (ret < 0) {
                printk(KERN_ERR
                        "comedi%d: error! cannot enable PCI device "
                        "and request regions!\n", dev->minor);
@@ -1394,7 +1398,8 @@ static int pci224_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                dev->iobase + PCI224_DACCON);
 
        /* Allocate subdevices.  There is only one!  */
-       if ((ret = alloc_subdevices(dev, 1)) < 0) {
+       ret = alloc_subdevices(dev, 1);
+       if (ret < 0) {
                printk(KERN_ERR "comedi%d: error! out of memory!\n",
                        dev->minor);
                return ret;
index 8e07a52e4d13cdf86231ba375c32adab956ff535..e476baf7c1d9b9e41c7e2cf0b3d1967f16701c16 100644 (file)
@@ -766,15 +766,22 @@ static void das16cs_pcmcia_config(struct pcmcia_device *link)
        tuple.TupleData = buf;
        tuple.TupleDataMax = sizeof(buf);
        tuple.TupleOffset = 0;
+
        last_fn = GetFirstTuple;
-       if ((last_ret = pcmcia_get_first_tuple(link, &tuple)) != 0)
+       last_ret = pcmcia_get_first_tuple(link, &tuple);
+       if (last_ret != 0)
                goto cs_failed;
+
        last_fn = GetTupleData;
-       if ((last_ret = pcmcia_get_tuple_data(link, &tuple)) != 0)
+       last_ret = pcmcia_get_tuple_data(link, &tuple);
+       if (last_ret != 0)
                goto cs_failed;
+
        last_fn = ParseTuple;
-       if ((last_ret = pcmcia_parse_tuple(&tuple, &parse)) != 0)
+       last_ret = pcmcia_parse_tuple(&tuple, &parse);
+       if (last_ret != 0)
                goto cs_failed;
+
        link->conf.ConfigBase = parse.config.base;
        link->conf.Present = parse.config.rmask[0];
 
@@ -792,8 +799,11 @@ static void das16cs_pcmcia_config(struct pcmcia_device *link)
         */
        tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
        last_fn = GetFirstTuple;
-       if ((last_ret = pcmcia_get_first_tuple(link, &tuple)) != 0)
+
+       last_ret = pcmcia_get_first_tuple(link, &tuple);
+       if (last_ret)
                goto cs_failed;
+
        while (1) {
                cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
                if (pcmcia_get_tuple_data(link, &tuple))
@@ -844,7 +854,9 @@ static void das16cs_pcmcia_config(struct pcmcia_device *link)
 
              next_entry:
                last_fn = GetNextTuple;
-               if ((last_ret = pcmcia_get_next_tuple(link, &tuple)) != 0)
+
+               last_ret = pcmcia_get_next_tuple(link, &tuple);
+               if (last_ret)
                        goto cs_failed;
        }
 
@@ -855,7 +867,9 @@ static void das16cs_pcmcia_config(struct pcmcia_device *link)
         */
        if (link->conf.Attributes & CONF_ENABLE_IRQ) {
                last_fn = RequestIRQ;
-               if ((last_ret = pcmcia_request_irq(link, &link->irq)) != 0)
+
+               last_ret = pcmcia_request_irq(link, &link->irq);
+               if (last_ret)
                        goto cs_failed;
        }
        /*
@@ -864,7 +878,8 @@ static void das16cs_pcmcia_config(struct pcmcia_device *link)
           card and host interface into "Memory and IO" mode.
         */
        last_fn = RequestConfiguration;
-       if ((last_ret = pcmcia_request_configuration(link, &link->conf)) != 0)
+       last_ret = pcmcia_request_configuration(link, &link->conf);
+       if (last_ret)
                goto cs_failed;
 
        /*
index 1afedd8e7cc0eaace9c146b35751579a3b2eb3b5..d59f4d04feb0fd2f78bc406a08d04a3acb10d997 100644 (file)
@@ -257,7 +257,8 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it)
  * it is, this is the place to do it.  Otherwise, dev->board_ptr
  * should already be initialized.
  */
-       if ((err = probe(dev, it)))
+       err = probe(dev, it);
+       if (err)
                return err;
 
 /* Output some info */
index 784b2e40f7113b7561d9e6164f5d139c8b5b2a3c..ef8accd528c6313b6a852c6af42f29ee0e5877c8 100644 (file)
@@ -646,9 +646,12 @@ static int timer_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
        dev->board_name = "timer";
 
-       if ((ret = alloc_subdevices(dev, 1)) < 0)
+       ret = alloc_subdevices(dev, 1);
+       if (ret < 0)
                return ret;
-       if ((ret = alloc_private(dev, sizeof(struct timer_private))) < 0)
+
+       ret = alloc_private(dev, sizeof(struct timer_private));
+       if (ret < 0)
                return ret;
 
        sprintf(path, "/dev/comedi%d", it->options[0]);
index 90bed0b962ee369e8069e89194f9d7bfe5945ca0..794fbb24aa32cf1c8b5050eb5d87a7595f5e9f6a 100644 (file)
@@ -772,7 +772,8 @@ static int daqboard2000_attach(struct comedi_device *dev, struct comedi_devconfi
                }
        }
 
-       if ((result = comedi_pci_enable(card, "daqboard2000")) < 0) {
+       result = comedi_pci_enable(card, "daqboard2000");
+       if (result < 0) {
                printk(" failed to enable PCI device and request regions\n");
                return -EIO;
        }
index 51dddd464ef2a86522bd7a1d394806fd4918afca..d7760e4aec1314f1d4d3369f4ba74d7746c360ae 100644 (file)
@@ -857,7 +857,8 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase)
 
        dev->board_name = thisboard->name;
 
-       if ((ret = alloc_subdevices(dev, 6)) < 0)
+       ret = alloc_subdevices(dev, 6);
+       if (ret < 0)
                return ret;
 
        s = dev->subdevices + 0;
@@ -961,7 +962,8 @@ static int das08_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        struct pci_dev *pdev;
 #endif
 
-       if ((ret = alloc_private(dev, sizeof(struct das08_private_struct))) < 0)
+       ret = alloc_private(dev, sizeof(struct das08_private_struct));
+       if (ret < 0)
                return ret;
 
        printk("comedi%d: das08: ", dev->minor);
index ed25a63da29c7e819f63df9a04914a71b4b78cf6..a97739612f8451c8cf065152603a6b339bb64bc3 100644 (file)
@@ -75,7 +75,8 @@ static int das08_cs_attach(struct comedi_device *dev, struct comedi_devconfig *i
        unsigned long iobase;
        struct pcmcia_device *link = cur_dev;   /*  XXX hack */
 
-       if ((ret = alloc_private(dev, sizeof(struct das08_private_struct))) < 0)
+       ret = alloc_private(dev, sizeof(struct das08_private_struct));
+       if (ret < 0)
                return ret;
 
        printk("comedi%d: das08_cs: ", dev->minor);
@@ -264,14 +265,23 @@ static void das08_pcmcia_config(struct pcmcia_device *link)
        tuple.TupleDataMax = sizeof(buf);
        tuple.TupleOffset = 0;
        last_fn = GetFirstTuple;
-       if ((last_ret = pcmcia_get_first_tuple(link, &tuple)) != 0)
+
+       last_ret = pcmcia_get_first_tuple(link, &tuple);
+       if (last_ret)
                goto cs_failed;
+
        last_fn = GetTupleData;
-       if ((last_ret = pcmcia_get_tuple_data(link, &tuple)) != 0)
+
+       last_ret = pcmcia_get_tuple_data(link, &tuple);
+       if (last_ret)
                goto cs_failed;
+
        last_fn = ParseTuple;
-       if ((last_ret = pcmcia_parse_tuple(&tuple, &parse)) != 0)
+
+       last_ret = pcmcia_parse_tuple(&tuple, &parse);
+       if (last_ret)
                goto cs_failed;
+
        link->conf.ConfigBase = parse.config.base;
        link->conf.Present = parse.config.rmask[0];
 
@@ -289,13 +299,20 @@ static void das08_pcmcia_config(struct pcmcia_device *link)
         */
        tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
        last_fn = GetFirstTuple;
-       if ((last_ret = pcmcia_get_first_tuple(link, &tuple)) != 0)
+
+       last_ret = pcmcia_get_first_tuple(link, &tuple);
+       if (last_ret)
                goto cs_failed;
+
        while (1) {
                cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
-               if ((last_ret = pcmcia_get_tuple_data(link, &tuple)) != 0)
+
+               last_ret = pcmcia_get_tuple_data(link, &tuple);
+               if (last_ret)
                        goto next_entry;
-               if ((last_ret = pcmcia_parse_tuple(&tuple, &parse)) != 0)
+
+               last_ret = pcmcia_parse_tuple(&tuple, &parse);
+               if (last_ret)
                        goto next_entry;
 
                if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
@@ -341,13 +358,16 @@ static void das08_pcmcia_config(struct pcmcia_device *link)
 
              next_entry:
                last_fn = GetNextTuple;
-               if ((last_ret = pcmcia_get_next_tuple(link, &tuple)) != 0)
+
+               last_ret = pcmcia_get_next_tuple(link, &tuple);
+               if (last_ret)
                        goto cs_failed;
        }
 
        if (link->conf.Attributes & CONF_ENABLE_IRQ) {
                last_fn = RequestIRQ;
-               if ((last_ret = pcmcia_request_irq(link, &link->irq)) != 0)
+               last_ret = pcmcia_request_irq(link, &link->irq);
+               if (last_ret)
                        goto cs_failed;
        }
 
@@ -357,7 +377,8 @@ static void das08_pcmcia_config(struct pcmcia_device *link)
           card and host interface into "Memory and IO" mode.
         */
        last_fn = RequestConfiguration;
-       if ((last_ret = pcmcia_request_configuration(link, &link->conf)) != 0)
+       last_ret = pcmcia_request_configuration(link, &link->conf);
+       if (last_ret)
                goto cs_failed;
 
        /*
index 2082030bd4ffe99eaf84b80d3c0942cb8ef4230c..090225128ce53f16aad51d33fa79f1001c611832 100644 (file)
@@ -1400,7 +1400,8 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                }
        }
 
-       if ((ret = alloc_private(dev, sizeof(struct das16_private_struct))) < 0)
+       ret = alloc_private(dev, sizeof(struct das16_private_struct));
+       if (ret < 0)
                return ret;
 
        if (thisboard->size < 0x400) {
@@ -1450,8 +1451,10 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
        /* now for the irq */
        if (irq > 1 && irq < 8) {
-               if ((ret = comedi_request_irq(irq, das16_dma_interrupt, 0,
-                                       "das16", dev)) < 0)
+               ret = comedi_request_irq(irq, das16_dma_interrupt, 0,
+                                        "das16", dev);
+
+               if (ret < 0)
                        return ret;
                dev->irq = irq;
                printk(" ( irq = %u )", irq);
@@ -1526,7 +1529,8 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        }
        devpriv->timer_mode = timer_mode ? 1 : 0;
 
-       if ((ret = alloc_subdevices(dev, 5)) < 0)
+       ret = alloc_subdevices(dev, 5);
+       if (ret < 0)
                return ret;
 
        s = dev->subdevices + 0;
index 7d35183b1d35742ecc91be46e53b534fc69fd76d..c29e4dcd51a00b5a61aab4ad8292cf5e09ddcccd 100644 (file)
@@ -646,8 +646,8 @@ static int das16m1_attach(struct comedi_device *dev, struct comedi_devconfig *it
 
        printk("comedi%d: das16m1:", dev->minor);
 
-       if ((ret = alloc_private(dev,
-                               sizeof(struct das16m1_private_struct))) < 0)
+       ret = alloc_private(dev, sizeof(struct das16m1_private_struct));
+       if (ret < 0)
                return ret;
 
        dev->board_name = thisboard->name;
@@ -687,7 +687,8 @@ static int das16m1_attach(struct comedi_device *dev, struct comedi_devconfig *it
                return -EINVAL;
        }
 
-       if ((ret = alloc_subdevices(dev, 4)) < 0)
+       ret = alloc_subdevices(dev, 4);
+       if (ret < 0)
                return ret;
 
        s = dev->subdevices + 0;
index b2326ec50833e85b718b83de81897abdf57dc84d..9b43f8732844e05b2dc4099ba6d4902946a61174 100644 (file)
@@ -331,10 +331,12 @@ static int das6402_attach(struct comedi_device *dev, struct comedi_devconfig *it
        }
        dev->irq = irq;
 
-       if ((ret = alloc_private(dev, sizeof(struct das6402_private))) < 0)
+       ret = alloc_private(dev, sizeof(struct das6402_private));
+       if (ret < 0)
                return ret;
 
-       if ((ret = alloc_subdevices(dev, 1)) < 0)
+       ret = alloc_subdevices(dev, 1);
+       if (ret < 0)
                return ret;
 
        /* ai subdevice */
index 309abba276d408a0aed0049f827c2a3b933f4d79..29fea1ac8ffac8f3087ac1c43c7b9e6986aab6eb 100644 (file)
@@ -521,10 +521,12 @@ static int dt2801_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        n_ai_chans = probe_number_of_ai_chans(dev);
        printk(" (ai channels = %d)", n_ai_chans);
 
-       if ((ret = alloc_subdevices(dev, 4)) < 0)
+       ret = alloc_subdevices(dev, 4);
+       if (ret < 0)
                goto out;
 
-       if ((ret = alloc_private(dev, sizeof(struct dt2801_private))) < 0)
+       ret = alloc_private(dev, sizeof(struct dt2801_private));
+       if (ret < 0)
                goto out;
 
        dev->board_name = boardtype.name;
index 634f2adf76287c279e3d2d32bbfd1cce142923f6..b782118ebff09b0cf9d8fb0cd33ad60f27cc9f21 100644 (file)
@@ -379,10 +379,14 @@ static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        }
 #endif
 
-       if ((ret = alloc_subdevices(dev, 4)) < 0)
+       ret = alloc_subdevices(dev, 4);
+       if (ret < 0)
                return ret;
-       if ((ret = alloc_private(dev, sizeof(struct dt2811_private))) < 0)
+
+       ret = alloc_private(dev, sizeof(struct dt2811_private));
+       if (ret < 0)
                return ret;
+
        switch (it->options[2]) {
        case 0:
                devpriv->adc_mux = adc_singleended;
index 6b82f6ef53f3c77da09ab0132cd25f6fd908f6f3..4db82ae6bfb6b1162ccaa371b1b7871524e4683a 100644 (file)
@@ -309,9 +309,12 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 #endif
        }
 
-       if ((ret = alloc_subdevices(dev, 1)) < 0)
+       ret = alloc_subdevices(dev, 1);
+       if (ret < 0)
                return ret;
-       if ((ret = alloc_private(dev, sizeof(struct dt2814_private))) < 0)
+
+       ret = alloc_private(dev, sizeof(struct dt2814_private));
+       if (ret < 0)
                return ret;
 
        s = dev->subdevices + 0;
index 8d52b26992207bfd48d4a2b104fc7f35376efca4..7e944c544fa196488a0f5699afa416b64fbb6665 100644 (file)
@@ -146,7 +146,8 @@ static int dt2817_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        dev->iobase = iobase;
        dev->board_name = "dt2817";
 
-       if ((ret = alloc_subdevices(dev, 1)) < 0)
+       ret = alloc_subdevices(dev, 1);
+       if (ret < 0)
                return ret;
 
        s = dev->subdevices + 0;
index 66328353fdaa0830ec1f08cc7f0a1b9c3c3707b7..64e9c4b32c0a2af4feeb92d08ce778cd405c6d43 100644 (file)
@@ -1326,7 +1326,8 @@ static int dt282x_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 #endif
        }
 
-       if ((ret = alloc_private(dev, sizeof(struct dt282x_private))) < 0)
+       ret = alloc_private(dev, sizeof(struct dt282x_private));
+       if (ret < 0)
                return ret;
 
        ret = dt282x_grab_dma(dev, it->options[opt_dma1],
@@ -1334,7 +1335,8 @@ static int dt282x_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (ret < 0)
                return ret;
 
-       if ((ret = alloc_subdevices(dev, 3)) < 0)
+       ret = alloc_subdevices(dev, 3);
+       if (ret < 0)
                return ret;
 
        s = dev->subdevices + 0;
@@ -1358,7 +1360,9 @@ static int dt282x_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        devpriv->ad_2scomp = it->options[opt_ai_twos];
 
        s++;
-       if ((s->n_chan = boardtype.dachan)) {
+
+       s->n_chan = boardtype.dachan;
+       if (s->n_chan) {
                /* ao subsystem */
                s->type = COMEDI_SUBD_AO;
                dev->write_subdev = s;
index 2d301597c3ed434d454fd14287013882a8046e84..c894e384c8ac14e846370505369abac2a65de5d9 100644 (file)
@@ -811,7 +811,8 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        bus = it->options[0];
        slot = it->options[1];
 
-       if ((ret = alloc_private(dev, sizeof(struct dt3k_private))) < 0)
+       ret = alloc_private(dev, sizeof(struct dt3k_private));
+       if (ret < 0)
                return ret;
 
        ret = dt_pci_probe(dev, bus, slot);
@@ -831,7 +832,8 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        }
        dev->irq = devpriv->pci_dev->irq;
 
-       if ((ret = alloc_subdevices(dev, 4)) < 0)
+       ret = alloc_subdevices(dev, 4);
+       if (ret < 0)
                return ret;
 
        s = dev->subdevices;
@@ -935,7 +937,8 @@ static int dt_pci_probe(struct comedi_device *dev, int bus, int slot)
        if (!devpriv->pci_dev)
                return 0;
 
-       if ((ret = setup_pci(dev)) < 0)
+       ret = setup_pci(dev);
+       if (ret < 0)
                return ret;
 
        return 1;
index fd8eb85ddbe9ea12052761c6a51a106d86791a84..f4790bfa08eec330c93b06a01610a28174084840 100644 (file)
@@ -209,9 +209,12 @@ static int pci20xxx_attach(struct comedi_device *dev, struct comedi_devconfig *i
        struct comedi_subdevice *s;
        union pci20xxx_subdev_private *sdp;
 
-       if ((ret = alloc_subdevices(dev, 1 + PCI20000_MODULES)) < 0)
+       ret = alloc_subdevices(dev, 1 + PCI20000_MODULES);
+       if (ret < 0)
                return ret;
-       if ((ret = alloc_private(dev, sizeof(struct pci20xxx_private))) < 0)
+
+       ret = alloc_private(dev, sizeof(struct pci20xxx_private));
+       if (ret < 0)
                return ret;
 
        devpriv->ioaddr = (void *)(unsigned long)it->options[0];
index 8a94334723108132a0a1eedc5acfc7215e82be75..3cb5e4753df68eb0559dd61b2cd8bb855279c6b2 100644 (file)
@@ -834,9 +834,12 @@ static int jr3_pci_attach(struct comedi_device *dev, struct comedi_devconfig *it
                devpriv->pci_dev = card;
                dev->board_name = "jr3_pci";
        }
-       if ((result = comedi_pci_enable(card, "jr3_pci")) < 0) {
+
+       result = comedi_pci_enable(card, "jr3_pci");
+       if (result < 0) {
                return -EIO;
        }
+
        devpriv->pci_enabled = 1;
        devpriv->iobase = ioremap(pci_resource_start(card, 0), sizeof(struct jr3_t));
        result = alloc_subdevices(dev, devpriv->n_channels);
index cff8ea71e28d9c36325d4b53d5ee40389cecbaa5..e1f84a5c9670c05ef4de6d607fb3227f39e644e8 100644 (file)
@@ -157,9 +157,9 @@ static int cnt_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        int error, i;
 
        /* allocate device private structure */
-       if ((error = alloc_private(dev, sizeof(struct cnt_device_private))) < 0) {
+       error = alloc_private(dev, sizeof(struct cnt_device_private));
+       if (error < 0)
                return error;
-       }
 
        /* Probe the device to determine what device in the series it is. */
        for (pci_device = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL);
@@ -203,7 +203,8 @@ static int cnt_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        dev->board_name = board->name;
 
        /* enable PCI device and request regions */
-       if ((error = comedi_pci_enable(pci_device, CNT_DRIVER_NAME)) < 0) {
+       error = comedi_pci_enable(pci_device, CNT_DRIVER_NAME);
+       if (error < 0) {
                printk("comedi%d: failed to enable PCI device and request regions!\n", dev->minor);
                return error;
        }
@@ -213,9 +214,9 @@ static int cnt_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        dev->iobase = io_base;
 
        /* allocate the subdevice structures */
-       if ((error = alloc_subdevices(dev, 1)) < 0) {
+       error = alloc_subdevices(dev, 1);
+       if (error < 0)
                return error;
-       }
 
        subdevice = dev->subdevices + 0;
        dev->read_subdev = subdevice;
index 4f476ec2d2f55fbd3c3690491cb0f0da197542a8..78ba17aec0ad4b73779567edec2685ff194a3872 100644 (file)
@@ -371,7 +371,8 @@ static int ni6527_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
        printk("comedi%d: ni6527:", dev->minor);
 
-       if ((ret = alloc_private(dev, sizeof(struct ni6527_private))) < 0)
+       ret = alloc_private(dev, sizeof(struct ni6527_private));
+       if (ret < 0)
                return ret;
 
        ret = ni6527_find_device(dev, it->options[0], it->options[1]);
@@ -389,7 +390,8 @@ static int ni6527_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
        printk(" ID=0x%02x", readb(devpriv->mite->daq_io_addr + ID_Register));
 
-       if ((ret = alloc_subdevices(dev, 3)) < 0)
+       ret = alloc_subdevices(dev, 3);
+       if (ret < 0)
                return ret;
 
        s = dev->subdevices + 0;
index 72005a40ad99a511451f995392d9d8bad14c60c3..7cf22c0f566baf5206fccf58599cc723d6775073 100644 (file)
@@ -627,7 +627,8 @@ static int ni_65xx_attach(struct comedi_device *dev, struct comedi_devconfig *it
 
        printk("comedi%d: ni_65xx:", dev->minor);
 
-       if ((ret = alloc_private(dev, sizeof(struct ni_65xx_private))) < 0)
+       ret = alloc_private(dev, sizeof(struct ni_65xx_private));
+       if (ret < 0)
                return ret;
 
        ret = ni_65xx_find_device(dev, it->options[0], it->options[1]);
@@ -647,7 +648,8 @@ static int ni_65xx_attach(struct comedi_device *dev, struct comedi_devconfig *it
        printk(" ID=0x%02x",
                readb(private(dev)->mite->daq_io_addr + ID_Register));
 
-       if ((ret = alloc_subdevices(dev, 4)) < 0)
+       ret = alloc_subdevices(dev, 4);
+       if (ret < 0)
                return ret;
 
        s = dev->subdevices + 0;
index b11f134e8c70d4212ef0b900853282083b2700c3..3c35dab02796ceb7869b67fd3c821aff81d6fa70 100644 (file)
@@ -960,8 +960,10 @@ static int ni_660x_allocate_private(struct comedi_device *dev)
        int retval;
        unsigned i;
 
-       if ((retval = alloc_private(dev, sizeof(struct ni_660x_private))) < 0)
+       retval = alloc_private(dev, sizeof(struct ni_660x_private));
+       if (retval < 0)
                return retval;
+
        spin_lock_init(&private(dev)->mite_channel_lock);
        spin_lock_init(&private(dev)->interrupt_lock);
        spin_lock_init(&private(dev)->soft_reg_copy_lock);
@@ -1105,9 +1107,11 @@ static int ni_660x_attach(struct comedi_device *dev, struct comedi_devconfig *it
        for (i = 0; i < board(dev)->n_chips; ++i) {
                set_tio_counterswap(dev, i);
        }
-       if ((ret = comedi_request_irq(mite_irq(private(dev)->mite),
-                               &ni_660x_interrupt, IRQF_SHARED, "ni_660x",
-                               dev)) < 0) {
+       ret = comedi_request_irq(mite_irq(private(dev)->mite),
+                                ni_660x_interrupt, IRQF_SHARED, "ni_660x",
+                                dev);
+
+       if (ret < 0) {
                printk(" irq not available\n");
                return ret;
        }
index c00bd0d404588f723803b4cf8a27a2047c668d2a..0caa4864190ca93f04ebd98d8fd9d549137e29b8 100644 (file)
@@ -144,7 +144,8 @@ static int ni_670x_attach(struct comedi_device *dev, struct comedi_devconfig *it
 
        printk("comedi%d: ni_670x: ", dev->minor);
 
-       if ((ret = alloc_private(dev, sizeof(struct ni_670x_private))) < 0)
+       ret = alloc_private(dev, sizeof(struct ni_670x_private));
+       if (ret < 0)
                return ret;
 
        ret = ni_670x_find_device(dev, it->options[0], it->options[1]);
index f8dda9a092e87ea952c72c2d5e605a423e23c139..c4c47497373b5fb172744c498a8347b39dc5b8aa 100644 (file)
@@ -414,8 +414,10 @@ static int ni_atmio_attach(struct comedi_device *dev, struct comedi_devconfig *i
        unsigned int irq;
 
        /* allocate private area */
-       if ((ret = ni_alloc_private(dev)) < 0)
+       ret = ni_alloc_private(dev);
+       if (ret < 0)
                return ret;
+
        devpriv->stc_writew = &ni_atmio_win_out;
        devpriv->stc_readw = &ni_atmio_win_in;
        devpriv->stc_writel = &win_out2;
@@ -476,8 +478,10 @@ static int ni_atmio_attach(struct comedi_device *dev, struct comedi_devconfig *i
                        return -EINVAL;
                }
                printk(" ( irq = %u )", irq);
-               if ((ret = comedi_request_irq(irq, ni_E_interrupt,
-                                       NI_E_IRQ_FLAGS, "ni_atmio", dev)) < 0) {
+               ret = comedi_request_irq(irq, ni_E_interrupt,
+                                         NI_E_IRQ_FLAGS, "ni_atmio", dev);
+
+               if (ret < 0) {
                        printk(" irq not available\n");
                        return -EINVAL;
                }
@@ -486,7 +490,8 @@ static int ni_atmio_attach(struct comedi_device *dev, struct comedi_devconfig *i
 
        /* generic E series stuff in ni_mio_common.c */
 
-       if ((ret = ni_E_init(dev, it)) < 0) {
+       ret = ni_E_init(dev, it);
+       if (ret < 0) {
                return ret;
        }
 
index 9fafe0c234d9de96d8d8289c7f173e2ee6f33552..b110ec651b42692986cc987a13c3450f63a06b97 100644 (file)
@@ -449,11 +449,13 @@ static int atmio16d_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s
                outw(devpriv->com_reg_1_state, dev->iobase + COM_REG_1);
        } else {
                /* Counter 4 and 5 are needed */
-               if ((tmp = sample_count & 0xFFFF)) {
+
+               tmp = sample_count & 0xFFFF;
+               if (tmp)
                        outw(tmp - 1, dev->iobase + AM9513A_DATA_REG);
-               } else {
+               else
                        outw(0xFFFF, dev->iobase + AM9513A_DATA_REG);
-               }
+
                outw(0xFF48, dev->iobase + AM9513A_COM_REG);
                outw(0, dev->iobase + AM9513A_DATA_REG);
                outw(0xFF28, dev->iobase + AM9513A_COM_REG);
@@ -726,9 +728,12 @@ static int atmio16d_attach(struct comedi_device *dev, struct comedi_devconfig *i
        /* board name */
        dev->board_name = boardtype->name;
 
-       if ((ret = alloc_subdevices(dev, 4)) < 0)
+       ret = alloc_subdevices(dev, 4);
+       if (ret < 0)
                return ret;
-       if ((ret = alloc_private(dev, sizeof(struct atmio16d_private))) < 0)
+
+       ret = alloc_private(dev, sizeof(struct atmio16d_private));
+       if (ret < 0)
                return ret;
 
        /* reset the atmio16d hardware */
@@ -737,8 +742,10 @@ static int atmio16d_attach(struct comedi_device *dev, struct comedi_devconfig *i
        /* check if our interrupt is available and get it */
        irq = it->options[1];
        if (irq) {
-               if ((ret = comedi_request_irq(irq, atmio16d_interrupt,
-                                       0, "atmio16d", dev)) < 0) {
+
+               ret = comedi_request_irq(irq, atmio16d_interrupt,
+                                         0, "atmio16d", dev);
+               if (ret < 0) {
                        printk("failed to allocate irq %u\n", irq);
                        return ret;
                }
index 21c71c9b300764089bdcbffcb5362788a83f83a1..8f594a8778cfcf94b0efa5466053f28af9a01f80 100644 (file)
@@ -594,15 +594,21 @@ static void dio700_config(struct pcmcia_device *link)
        tuple.TupleData = buf;
        tuple.TupleDataMax = sizeof(buf);
        tuple.TupleOffset = 0;
-       if ((last_ret = pcmcia_get_first_tuple(link, &tuple)) != 0) {
+
+       last_ret = pcmcia_get_first_tuple(link, &tuple);
+       if (last_ret) {
                cs_error(link, GetFirstTuple, last_ret);
                goto cs_failed;
        }
-       if ((last_ret = pcmcia_get_tuple_data(link, &tuple)) != 0) {
+
+       last_ret = pcmcia_get_tuple_data(link, &tuple);
+       if (last_ret) {
                cs_error(link, GetTupleData, last_ret);
                goto cs_failed;
        }
-       if ((last_ret = pcmcia_parse_tuple(&tuple, &parse)) != 0) {
+
+       last_ret = pcmcia_parse_tuple(&tuple, &parse);
+        if (last_ret) {
                cs_error(link, ParseTuple, last_ret);
                goto cs_failed;
        }
@@ -622,7 +628,8 @@ static void dio700_config(struct pcmcia_device *link)
           will only use the CIS to fill in implementation-defined details.
         */
        tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
-       if ((last_ret = pcmcia_get_first_tuple(link, &tuple)) != 0) {
+       last_ret = pcmcia_get_first_tuple(link, &tuple);
+       if (last_ret != 0) {
                cs_error(link, GetFirstTuple, last_ret);
                goto cs_failed;
        }
@@ -692,7 +699,9 @@ static void dio700_config(struct pcmcia_device *link)
                break;
 
              next_entry:
-               if ((last_ret = pcmcia_get_next_tuple(link, &tuple)) != 0) {
+
+               last_ret = pcmcia_get_next_tuple(link, &tuple);
+               if (last_ret) {
                        cs_error(link, GetNextTuple, last_ret);
                        goto cs_failed;
                }
@@ -703,18 +712,21 @@ static void dio700_config(struct pcmcia_device *link)
           handler to the interrupt, unless the 'Handler' member of the
           irq structure is initialized.
         */
-       if (link->conf.Attributes & CONF_ENABLE_IRQ)
-               if ((last_ret = pcmcia_request_irq(link, &link->irq)) != 0) {
+       if (link->conf.Attributes & CONF_ENABLE_IRQ) {
+               last_ret = pcmcia_request_irq(link, &link->irq);
+               if (last_ret) {
                        cs_error(link, RequestIRQ, last_ret);
                        goto cs_failed;
                }
+       }
 
        /*
           This actually configures the PCMCIA socket -- setting up
           the I/O windows and the interrupt mapping, and putting the
           card and host interface into "Memory and IO" mode.
         */
-       if ((last_ret = pcmcia_request_configuration(link, &link->conf)) != 0) {
+       last_ret = pcmcia_request_configuration(link, &link->conf);
+       if (last_ret != 0) {
                cs_error(link, RequestConfiguration, last_ret);
                goto cs_failed;
        }
index 6474591eb0c281aadd4457d070fd33ff1c57d91f..f7814dbedb4b851912d67d5a0cc81acfc8f985dc 100644 (file)
@@ -351,15 +351,21 @@ static void dio24_config(struct pcmcia_device *link)
        tuple.TupleData = buf;
        tuple.TupleDataMax = sizeof(buf);
        tuple.TupleOffset = 0;
-       if ((last_ret = pcmcia_get_first_tuple(link, &tuple)) != 0) {
+
+       last_ret = pcmcia_get_first_tuple(link, &tuple);
+       if (last_ret) {
                cs_error(link, GetFirstTuple, last_ret);
                goto cs_failed;
        }
-       if ((last_ret = pcmcia_get_tuple_data(link, &tuple)) != 0) {
+
+       last_ret = pcmcia_get_tuple_data(link, &tuple);
+       if (last_ret) {
                cs_error(link, GetTupleData, last_ret);
                goto cs_failed;
        }
-       if ((last_ret = pcmcia_parse_tuple(&tuple, &parse)) != 0) {
+
+       last_ret = pcmcia_parse_tuple(&tuple, &parse);
+       if (last_ret) {
                cs_error(link, ParseTuple, last_ret);
                goto cs_failed;
        }
@@ -379,7 +385,9 @@ static void dio24_config(struct pcmcia_device *link)
           will only use the CIS to fill in implementation-defined details.
         */
        tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
-       if ((last_ret = pcmcia_get_first_tuple(link, &tuple)) != 0) {
+
+       last_ret = pcmcia_get_first_tuple(link, &tuple);
+       if (last_ret) {
                cs_error(link, GetFirstTuple, last_ret);
                goto cs_failed;
        }
@@ -449,7 +457,9 @@ static void dio24_config(struct pcmcia_device *link)
                break;
 
              next_entry:
-               if ((last_ret = pcmcia_get_next_tuple(link, &tuple)) != 0) {
+
+               last_ret = pcmcia_get_next_tuple(link, &tuple);
+               if (last_ret) {
                        cs_error(link, GetNextTuple, last_ret);
                        goto cs_failed;
                }
@@ -460,18 +470,21 @@ static void dio24_config(struct pcmcia_device *link)
           handler to the interrupt, unless the 'Handler' member of the
           irq structure is initialized.
         */
-       if (link->conf.Attributes & CONF_ENABLE_IRQ)
-               if ((last_ret = pcmcia_request_irq(link, &link->irq)) != 0) {
+       if (link->conf.Attributes & CONF_ENABLE_IRQ) {
+               last_ret = pcmcia_request_irq(link, &link->irq);
+               if (last_ret) {
                        cs_error(link, RequestIRQ, last_ret);
                        goto cs_failed;
                }
+       }
 
        /*
           This actually configures the PCMCIA socket -- setting up
           the I/O windows and the interrupt mapping, and putting the
           card and host interface into "Memory and IO" mode.
         */
-       if ((last_ret = pcmcia_request_configuration(link, &link->conf)) != 0) {
+       last_ret = pcmcia_request_configuration(link, &link->conf);
+       if (last_ret) {
                cs_error(link, RequestConfiguration, last_ret);
                goto cs_failed;
        }
index b0c523e9f198e41334928ea650524d84535a650d..e504f4f594a6522536ec2f0aff886ac4e3445175 100644 (file)
@@ -327,15 +327,21 @@ static void labpc_config(struct pcmcia_device *link)
        tuple.TupleData = buf;
        tuple.TupleDataMax = sizeof(buf);
        tuple.TupleOffset = 0;
-       if ((last_ret = pcmcia_get_first_tuple(link, &tuple))) {
+
+       last_ret = pcmcia_get_first_tuple(link, &tuple);
+       if (last_ret) {
                cs_error(link, GetFirstTuple, last_ret);
                goto cs_failed;
        }
-       if ((last_ret = pcmcia_get_tuple_data(link, &tuple))) {
+
+       last_ret = pcmcia_get_tuple_data(link, &tuple);
+       if (last_ret) {
                cs_error(link, GetTupleData, last_ret);
                goto cs_failed;
        }
-       if ((last_ret = pcmcia_parse_tuple(&tuple, &parse))) {
+
+       last_ret = pcmcia_parse_tuple(&tuple, &parse);
+       if (last_ret) {
                cs_error(link, ParseTuple, last_ret);
                goto cs_failed;
        }
@@ -355,7 +361,8 @@ static void labpc_config(struct pcmcia_device *link)
           will only use the CIS to fill in implementation-defined details.
         */
        tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
-       if ((last_ret = pcmcia_get_first_tuple(link, &tuple))) {
+       last_ret = pcmcia_get_first_tuple(link, &tuple);
+       if (last_ret) {
                cs_error(link, GetFirstTuple, last_ret);
                goto cs_failed;
        }
@@ -422,7 +429,8 @@ static void labpc_config(struct pcmcia_device *link)
                break;
 
              next_entry:
-               if ((last_ret = pcmcia_get_next_tuple(link, &tuple))) {
+               last_ret = pcmcia_get_next_tuple(link, &tuple);
+               if (last_ret) {
                        cs_error(link, GetNextTuple, last_ret);
                        goto cs_failed;
                }
@@ -433,18 +441,21 @@ static void labpc_config(struct pcmcia_device *link)
           handler to the interrupt, unless the 'Handler' member of the
           irq structure is initialized.
         */
-       if (link->conf.Attributes & CONF_ENABLE_IRQ)
-               if ((last_ret = pcmcia_request_irq(link, &link->irq))) {
+       if (link->conf.Attributes & CONF_ENABLE_IRQ) {
+               last_ret = pcmcia_request_irq(link, &link->irq);
+               if (last_ret) {
                        cs_error(link, RequestIRQ, last_ret);
                        goto cs_failed;
                }
+       }
 
        /*
           This actually configures the PCMCIA socket -- setting up
           the I/O windows and the interrupt mapping, and putting the
           card and host interface into "Memory and IO" mode.
         */
-       if ((last_ret = pcmcia_request_configuration(link, &link->conf))) {
+       last_ret = pcmcia_request_configuration(link, &link->conf);
+       if (last_ret) {
                cs_error(link, RequestConfiguration, last_ret);
                goto cs_failed;
        }
index ff53ef781499cff54c7c004633a846af7a2aba11..a7ab3f72c7aa3713f99e88479b300e570a092ad2 100644 (file)
@@ -446,24 +446,28 @@ static int mio_cs_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        printk(" %s", boardtype.name);
        dev->board_name = boardtype.name;
 
-       if ((ret = comedi_request_irq(irq, ni_E_interrupt, NI_E_IRQ_FLAGS,
-                               "ni_mio_cs", dev)) < 0) {
+       ret = comedi_request_irq(irq, ni_E_interrupt, NI_E_IRQ_FLAGS,
+                                "ni_mio_cs", dev);
+       if (ret < 0) {
                printk(" irq not available\n");
                return -EINVAL;
        }
        dev->irq = irq;
 
        /* allocate private area */
-       if ((ret = ni_alloc_private(dev)) < 0)
+       ret = ni_alloc_private(dev);
+       if (ret < 0)
                return ret;
+
        devpriv->stc_writew = &mio_cs_win_out;
        devpriv->stc_readw = &mio_cs_win_in;
        devpriv->stc_writel = &win_out2;
        devpriv->stc_readl = &win_in2;
 
-       if ((ret = ni_E_init(dev, it)) < 0) {
+       ret = ni_E_init(dev, it);
+
+       if (ret < 0)
                return ret;
-       }
 
        return 0;
 }
index 39566316dc80f80dea0c258a904f6aa549992a6e..bfccafe6080b6c157f3ff4ff3ee881c516f1523c 100644 (file)
@@ -1679,9 +1679,10 @@ static int pcimio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                printk(" unknown irq (bad)\n");
        } else {
                printk(" ( irq = %u )", dev->irq);
-               if ((ret = comedi_request_irq(dev->irq, ni_E_interrupt,
-                                       NI_E_IRQ_FLAGS, DRV_NAME,
-                                       dev)) < 0) {
+               ret = comedi_request_irq(dev->irq, ni_E_interrupt,
+                                        NI_E_IRQ_FLAGS, DRV_NAME,
+                                        dev);
+               if (ret < 0) {
                        printk(" irq not available\n");
                        dev->irq = 0;
                }
index 73b56b36d7c7f5ee32742f33fe2b93c1a78e2161..e1a4917fc3ce3fa7a2017830b906af76649af3fd 100644 (file)
@@ -550,9 +550,12 @@ static int pcl711_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        }
        dev->irq = irq;
 
-       if ((ret = alloc_subdevices(dev, 4)) < 0)
+       ret = alloc_subdevices(dev, 4);
+       if (ret < 0)
                return ret;
-       if ((ret = alloc_private(dev, sizeof(struct pcl711_private))) < 0)
+
+       ret = alloc_private(dev, sizeof(struct pcl711_private));
+       if (ret < 0)
                return ret;
 
        s = dev->subdevices + 0;
index 75ab137ce36fec997c49d220cd6f050110e972c8..5d3ba759e862b2c31190d7d0b54af75836ef6a78 100644 (file)
@@ -183,7 +183,8 @@ static int pcl724_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                        || (it->options[1] == 96)))
                n_subdevices = 4;       /*  PCL-724 in 96 DIO configuration */
 
-       if ((ret = alloc_subdevices(dev, n_subdevices)) < 0)
+       ret = alloc_subdevices(dev, n_subdevices);
+       if (ret < 0)
                return ret;
 
        for (i = 0; i < dev->n_subdevices; i++) {
index 7c9112b0fdca1817db97109a3b69535faf05b1e8..408f1ef664f92c8f1fc73b1b818890f8cd82916e 100644 (file)
@@ -264,7 +264,8 @@ static int pcl726_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
        dev->board_name = this_board->name;
 
-       if ((ret = alloc_private(dev, sizeof(struct pcl726_private))) < 0)
+       ret = alloc_private(dev, sizeof(struct pcl726_private));
+       if (ret < 0)
                return -ENOMEM;
 
        for (i = 0; i < 12; i++) {
@@ -302,7 +303,8 @@ static int pcl726_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
        printk("\n");
 
-       if ((ret = alloc_subdevices(dev, 3)) < 0)
+       ret = alloc_subdevices(dev, 3);
+       if (ret < 0)
                return ret;
 
        s = dev->subdevices + 0;
index 1f6f3e8b418598eb2b741125f295d7b092ffdebd..6a6e84a52521d9d0f1efc4f14147531d2f64a784 100644 (file)
@@ -1286,7 +1286,8 @@ static int pcl812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        }
        dev->iobase = iobase;
 
-       if ((ret = alloc_private(dev, sizeof(struct pcl812_private))) < 0) {
+       ret = alloc_private(dev, sizeof(struct pcl812_private));
+       if (ret < 0) {
                free_resources(dev);
                return ret;     /* Can't alloc mem */
        }
@@ -1364,7 +1365,8 @@ static int pcl812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (this_board->n_dochan > 0)
                n_subdevices++;
 
-       if ((ret = alloc_subdevices(dev, n_subdevices)) < 0) {
+       ret = alloc_subdevices(dev, n_subdevices);
+       if (ret < 0) {
                free_resources(dev);
                return ret;
        }
index f44bd43f5d3f10d1f26a3c91bd59119443ec7fe6..c52ba0319a46a0ee04a2f805903f6d82a4af9bd2 100644 (file)
@@ -1041,7 +1041,8 @@ static int pcl816_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                return -EIO;
        }
 
-       if ((ret = alloc_private(dev, sizeof(struct pcl816_private))) < 0)
+       ret = alloc_private(dev, sizeof(struct pcl816_private));
+       if (ret < 0)
                return ret;     /* Can't alloc mem */
 
        /* set up some name stuff */
@@ -1177,7 +1178,9 @@ static int pcl816_attach(struct comedi_device *dev, struct comedi_devconfig *it)
   if (this_board->n_dochan > 0)
     subdevs[3] = COMEDI_SUBD_DO;
 */
-       if ((ret = alloc_subdevices(dev, 1)) < 0)
+
+       ret = alloc_subdevices(dev, 1);
+       if (ret < 0)
                return ret;
 
        s = dev->subdevices + 0;
index f1deeb247e1934113568e0adeb4a6a08a6f01b2e..6fbc9abdbd7bc06a28069ab262edd38c79f29bc9 100644 (file)
@@ -1703,7 +1703,8 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        unsigned long pages;
        struct comedi_subdevice *s;
 
-       if ((ret = alloc_private(dev, sizeof(struct pcl818_private))) < 0)
+       ret = alloc_private(dev, sizeof(struct pcl818_private));
+       if (ret < 0)
                return ret;     /* Can't alloc mem */
 
        /* claim our I/O space */
@@ -1842,7 +1843,8 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
       no_dma:
 
-       if ((ret = alloc_subdevices(dev, 4)) < 0)
+       ret = alloc_subdevices(dev, 4);
+       if (ret < 0)
                return ret;
 
        s = dev->subdevices + 0;
index 5178b43b107271f0a9efcfd3451755728c5b183c..36310adf5fb79643fc446482cead895368f7403e 100644 (file)
@@ -260,7 +260,9 @@ static int pcm3724_attach(struct comedi_device *dev, struct comedi_devconfig *it
 
        iobase = it->options[0];
        iorange = this_board->io_range;
-       if ((ret = alloc_private(dev, sizeof(struct priv_pcm3724))) < 0)
+
+       ret = alloc_private(dev, sizeof(struct priv_pcm3724));
+       if (ret < 0)
                return -ENOMEM;
 
        ((struct priv_pcm3724 *) (dev->private))->dio_1 = 0;
@@ -279,7 +281,8 @@ static int pcm3724_attach(struct comedi_device *dev, struct comedi_devconfig *it
 
        n_subdevices = this_board->numofports;
 
-       if ((ret = alloc_subdevices(dev, n_subdevices)) < 0)
+       ret = alloc_subdevices(dev, n_subdevices);
+       if (ret < 0)
                return ret;
 
        for (i = 0; i < dev->n_subdevices; i++) {
index 15986691ff32210d2310d1e60d836233e8873d69..f1e19cc2ac208e8e4b19138f4bba049105522efc 100644 (file)
@@ -140,9 +140,12 @@ static int pcmad_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        }
        dev->iobase = iobase;
 
-       if ((ret = alloc_subdevices(dev, 1)) < 0)
+       ret = alloc_subdevices(dev, 1);
+       if (ret < 0)
                return ret;
-       if ((ret = alloc_private(dev, sizeof(struct pcmad_priv_struct))) < 0)
+
+       ret = alloc_private(dev, sizeof(struct pcmad_priv_struct));
+       if (ret < 0)
                return ret;
 
        dev->board_name = this_board->name;
index 849fa4fa4ced0f911c25edca903a24614906de77..82da558fc8f7f68ceb7074d5c367ce9b7a4ae1e2 100644 (file)
@@ -921,7 +921,8 @@ static void pcmmio_stop_intr(struct comedi_device *dev, struct comedi_subdevice
 {
        int nports, firstport, asic, port;
 
-       if ((asic = subpriv->dio.intr.asic) < 0)
+       asic = subpriv->dio.intr.asic;
+       if (asic < 0)
                return;         /* not an interrupt subdev */
 
        subpriv->dio.intr.enabled_mask = 0;
@@ -948,7 +949,8 @@ static int pcmmio_start_intr(struct comedi_device *dev, struct comedi_subdevice
                int nports, firstport, asic, port;
                struct comedi_cmd *cmd = &s->async->cmd;
 
-               if ((asic = subpriv->dio.intr.asic) < 0)
+               asic = subpriv->dio.intr.asic;
+               if (asic  < 0)
                        return 1;       /* not an interrupt
                                           subdev */
                subpriv->dio.intr.enabled_mask = 0;
index 7e442dbd2c19b16898c0f1ef36581bb48567c004..cc62f518128e0a8af21d8656b291cefafbff7769 100644 (file)
@@ -841,7 +841,8 @@ static void pcmuio_stop_intr(struct comedi_device *dev, struct comedi_subdevice
 {
        int nports, firstport, asic, port;
 
-       if ((asic = subpriv->intr.asic) < 0)
+       asic = subpriv->intr.asic;
+       if (asic < 0)
                return;         /* not an interrupt subdev */
 
        subpriv->intr.enabled_mask = 0;
@@ -868,7 +869,8 @@ static int pcmuio_start_intr(struct comedi_device *dev, struct comedi_subdevice
                int nports, firstport, asic, port;
                struct comedi_cmd *cmd = &s->async->cmd;
 
-               if ((asic = subpriv->intr.asic) < 0)
+               asic = subpriv->intr.asic;
+               if (asic < 0)
                        return 1;       /* not an interrupt
                                           subdev */
                subpriv->intr.enabled_mask = 0;
index 0066218dba4894518bf576e6c8206b603fea6284..d6427e2fc14c335d2dff460aa65002cf71e7d6d7 100644 (file)
@@ -908,7 +908,8 @@ static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
        dev->iobase = local->link->io.BasePort1;
 
-       if ((ret = alloc_subdevices(dev, 4)) < 0)
+       ret = alloc_subdevices(dev, 4);
+       if (ret < 0)
                return ret;
 
        printk("comedi%d: attaching daqp%d (io 0x%04lx)\n",
@@ -1149,15 +1150,21 @@ static void daqp_cs_config(struct pcmcia_device *link)
        tuple.TupleData = buf;
        tuple.TupleDataMax = sizeof(buf);
        tuple.TupleOffset = 0;
-       if ((last_ret = pcmcia_get_first_tuple(link, &tuple))) {
+
+       last_ret = pcmcia_get_first_tuple(link, &tuple);
+       if (last_ret) {
                cs_error(link, GetFirstTuple, last_ret);
                goto cs_failed;
        }
-       if ((last_ret = pcmcia_get_tuple_data(link, &tuple))) {
+
+       last_ret = pcmcia_get_tuple_data(link, &tuple);
+       if (last_ret) {
                cs_error(link, GetTupleData, last_ret);
                goto cs_failed;
        }
-       if ((last_ret = pcmcia_parse_tuple(&tuple, &parse))) {
+
+       last_ret = pcmcia_parse_tuple(&tuple, &parse);
+       if (last_ret) {
                cs_error(link, ParseTuple, last_ret);
                goto cs_failed;
        }
@@ -1177,10 +1184,12 @@ static void daqp_cs_config(struct pcmcia_device *link)
           will only use the CIS to fill in implementation-defined details.
         */
        tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
-       if ((last_ret = pcmcia_get_first_tuple(link, &tuple))) {
+       last_ret = pcmcia_get_first_tuple(link, &tuple);
+       if (last_ret) {
                cs_error(link, GetFirstTuple, last_ret);
                goto cs_failed;
        }
+
        while (1) {
                cistpl_cftable_entry_t dflt = { 0 };
                cistpl_cftable_entry_t *cfg = &(parse.cftable_entry);
@@ -1226,7 +1235,8 @@ static void daqp_cs_config(struct pcmcia_device *link)
                break;
 
              next_entry:
-               if ((last_ret = pcmcia_get_next_tuple(link, &tuple))) {
+               last_ret = pcmcia_get_next_tuple(link, &tuple);
+               if (last_ret) {
                        cs_error(link, GetNextTuple, last_ret);
                        goto cs_failed;
                }
@@ -1237,18 +1247,21 @@ static void daqp_cs_config(struct pcmcia_device *link)
           handler to the interrupt, unless the 'Handler' member of the
           irq structure is initialized.
         */
-       if (link->conf.Attributes & CONF_ENABLE_IRQ)
-               if ((last_ret = pcmcia_request_irq(link, &link->irq))) {
+       if (link->conf.Attributes & CONF_ENABLE_IRQ) {
+               last_ret = pcmcia_request_irq(link, &link->irq);
+               if (last_ret) {
                        cs_error(link, RequestIRQ, last_ret);
                        goto cs_failed;
                }
+       }
 
        /*
           This actually configures the PCMCIA socket -- setting up
           the I/O windows and the interrupt mapping, and putting the
           card and host interface into "Memory and IO" mode.
         */
-       if ((last_ret = pcmcia_request_configuration(link, &link->conf))) {
+       last_ret = pcmcia_request_configuration(link, &link->conf);
+       if (last_ret) {
                cs_error(link, RequestConfiguration, last_ret);
                goto cs_failed;
        }
index cac2abf6f03ae90a77816d8b9a0522731063ac83..b2579f42573c535047e883a9563ff7e389e8dfaa 100644 (file)
@@ -339,8 +339,9 @@ static int rti800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        irq = it->options[1];
        if (irq) {
                printk("( irq = %u )", irq);
-               if ((ret = comedi_request_irq(irq, rti800_interrupt, 0,
-                                       "rti800", dev)) < 0) {
+               ret = comedi_request_irq(irq, rti800_interrupt, 0,
+                                        "rti800", dev);
+               if (ret < 0) {
                        printk(" Failed to allocate IRQ\n");
                        return ret;
                }
@@ -351,9 +352,12 @@ static int rti800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
        dev->board_name = this_board->name;
 
-       if ((ret = alloc_subdevices(dev, 4)) < 0)
+       ret = alloc_subdevices(dev, 4);
+       if (ret < 0)
                return ret;
-       if ((ret = alloc_private(dev, sizeof(struct rti800_private))) < 0)
+
+       ret = alloc_private(dev, sizeof(struct rti800_private));
+       if (ret < 0)
                return ret;
 
        devpriv->adc_mux = it->options[2];
index 5b383e6354e0478e96cafab4661a0393c5470cdc..18e5ddf6f968528cc5f3b9cae223795b3750624b 100644 (file)
@@ -213,7 +213,8 @@ static int unioxx5_insn_config(struct comedi_device *dev, struct comedi_subdevic
                return -1;
        }
 
-       if ((channel_offset = __unioxx5_define_chan_offset(channel)) < 0) {
+       channel_offset = __unioxx5_define_chan_offset(channel);
+       if (channel_offset < 0) {
                printk(KERN_ERR
                        "comedi%d: undefined channel %d. channel range is 0 .. 23\n",
                        dev->minor, channel);
@@ -275,8 +276,9 @@ static int __unioxx5_subdev_init(struct comedi_subdevice *subdev, int subdev_iob
                return -EIO;
        }
 
-       if ((usp = (struct unioxx5_subd_priv *) kzalloc(sizeof(*usp),
-                               GFP_KERNEL)) == NULL) {
+       usp = (struct unioxx5_subd_priv *) kzalloc(sizeof(*usp), GFP_KERNEL);
+
+       if (usp == NULL) {
                printk(KERN_ERR "comedi%d: erorr! --> out of memory!\n", minor);
                return -1;
        }
@@ -336,7 +338,8 @@ static int __unioxx5_digital_write(struct unioxx5_subd_priv *usp, unsigned int *
        int channel_offset, val;
        int mask = 1 << (channel & 0x07);
 
-       if ((channel_offset = __unioxx5_define_chan_offset(channel)) < 0) {
+       channel_offset = __unioxx5_define_chan_offset(channel);
+       if (channel_offset < 0) {
                printk(KERN_ERR
                        "comedi%d: undefined channel %d. channel range is 0 .. 23\n",
                        minor, channel);
@@ -362,7 +365,8 @@ static int __unioxx5_digital_read(struct unioxx5_subd_priv *usp, unsigned int *d
 {
        int channel_offset, mask = 1 << (channel & 0x07);
 
-       if ((channel_offset = __unioxx5_define_chan_offset(channel)) < 0) {
+       channel_offset = __unioxx5_define_chan_offset(channel);
+       if (channel_offset < 0) {
                printk(KERN_ERR
                        "comedi%d: undefined channel %d. channel range is 0 .. 23\n",
                        minor, channel);