staging: comedi: ni_660x: (!foo) preferred over (foo == NULL)
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 4 Mar 2015 19:15:34 +0000 (12:15 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Mar 2015 00:01:29 +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/ni_660x.c

index 1e4dd82b12ea7d082d1d595d71ac6e96347443ec..9d7567bf1ce3afec5f6d1556c56baf90469da823 100644 (file)
@@ -702,7 +702,7 @@ static int ni_660x_request_mite_channel(struct comedi_device *dev,
        BUG_ON(counter->mite_chan);
        mite_chan = mite_request_channel(devpriv->mite,
                                         mite_ring(devpriv, counter));
-       if (mite_chan == NULL) {
+       if (!mite_chan) {
                spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags);
                dev_err(dev->class_dev,
                        "failed to reserve mite dma channel for counter\n");
@@ -861,7 +861,7 @@ static int ni_660x_alloc_mite_rings(struct comedi_device *dev)
                for (j = 0; j < counters_per_chip; ++j) {
                        devpriv->mite_rings[i][j] =
                            mite_alloc_ring(devpriv->mite);
-                       if (devpriv->mite_rings[i][j] == NULL)
+                       if (!devpriv->mite_rings[i][j])
                                return -ENOMEM;
                }
        }
@@ -1107,7 +1107,7 @@ static int ni_660x_auto_attach(struct comedi_device *dev,
                                                     ni_gpct_variant_660x,
                                                     ni_660x_num_counters
                                                     (dev));
-       if (devpriv->counter_dev == NULL)
+       if (!devpriv->counter_dev)
                return -ENOMEM;
        for (i = 0; i < NI_660X_MAX_NUM_COUNTERS; ++i) {
                s = &dev->subdevices[NI_660X_GPCT_SUBDEV(i)];