From: H Hartley Sweeten Date: Wed, 4 Mar 2015 19:15:34 +0000 (-0700) Subject: staging: comedi: ni_660x: (!foo) preferred over (foo == NULL) X-Git-Tag: v4.1-rc1~152^2~138^2~596 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=307da4b2e89c388d2e44efdd6899d4d1d8429806;p=karo-tx-linux.git staging: comedi: ni_660x: (!foo) preferred over (foo == NULL) Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/ni_660x.c b/drivers/staging/comedi/drivers/ni_660x.c index 1e4dd82b12ea..9d7567bf1ce3 100644 --- a/drivers/staging/comedi/drivers/ni_660x.c +++ b/drivers/staging/comedi/drivers/ni_660x.c @@ -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)];