staging: comedi: cb_pcidas64: (!foo) preferred over (foo == NULL)
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 4 Mar 2015 19:15:32 +0000 (12:15 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Mar 2015 00:01:28 +0000 (16:01 -0800)
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/cb_pcidas64.c

index bd24059999069296bfe351b1d4605faef89b7d59..c8f4a227cc59d2d9cad87d505f83d638e03fd402 100644 (file)
@@ -1473,7 +1473,7 @@ static int alloc_and_init_dma_members(struct comedi_device *dev)
                devpriv->ai_buffer[i] =
                        pci_alloc_consistent(pcidev, DMA_BUFFER_SIZE,
                                             &devpriv->ai_buffer_bus_addr[i]);
-               if (devpriv->ai_buffer[i] == NULL)
+               if (!devpriv->ai_buffer[i])
                        return -ENOMEM;
 
        }
@@ -1483,7 +1483,7 @@ static int alloc_and_init_dma_members(struct comedi_device *dev)
                                pci_alloc_consistent(pcidev, DMA_BUFFER_SIZE,
                                                     &devpriv->
                                                      ao_buffer_bus_addr[i]);
-                       if (devpriv->ao_buffer[i] == NULL)
+                       if (!devpriv->ao_buffer[i])
                                return -ENOMEM;
 
                }
@@ -1493,7 +1493,7 @@ static int alloc_and_init_dma_members(struct comedi_device *dev)
                pci_alloc_consistent(pcidev, sizeof(struct plx_dma_desc) *
                                     ai_dma_ring_count(thisboard),
                                     &devpriv->ai_dma_desc_bus_addr);
-       if (devpriv->ai_dma_desc == NULL)
+       if (!devpriv->ai_dma_desc)
                return -ENOMEM;
 
        if (ao_cmd_is_supported(thisboard)) {
@@ -1502,7 +1502,7 @@ static int alloc_and_init_dma_members(struct comedi_device *dev)
                                             sizeof(struct plx_dma_desc) *
                                             AO_DMA_RING_COUNT,
                                             &devpriv->ao_dma_desc_bus_addr);
-               if (devpriv->ao_dma_desc == NULL)
+               if (!devpriv->ao_dma_desc)
                        return -ENOMEM;
        }
        /*  initialize dma descriptors */
@@ -2975,7 +2975,7 @@ static void handle_ao_interrupt(struct comedi_device *dev,
        unsigned long flags;
 
        /* board might not support ao, in which case write_subdev is NULL */
-       if (s == NULL)
+       if (!s)
                return;
        async = s->async;
        cmd = &async->cmd;