OSDN Git Service

staging: comedi: ni_tiocmd: (!foo) preferred over (foo == NULL)
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 4 Mar 2015 19:15:39 +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_tiocmd.c

index d36c3ab..4173570 100644 (file)
@@ -201,7 +201,7 @@ int ni_tio_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
        unsigned long flags;
 
        spin_lock_irqsave(&counter->lock, flags);
-       if (counter->mite_chan == NULL) {
+       if (!counter->mite_chan) {
                dev_err(counter->counter_dev->dev->class_dev,
                        "commands only supported with DMA.  ");
                dev_err(counter->counter_dev->dev->class_dev,
@@ -329,7 +329,7 @@ static int should_ack_gate(struct ni_gpct *counter)
        case ni_gpct_variant_e_series:
                spin_lock_irqsave(&counter->lock, flags);
                {
-                       if (counter->mite_chan == NULL ||
+                       if (!counter->mite_chan ||
                            counter->mite_chan->dir != COMEDI_INPUT ||
                            (mite_done(counter->mite_chan))) {
                                retval = 1;
@@ -443,7 +443,7 @@ void ni_tio_handle_interrupt(struct ni_gpct *counter,
                break;
        }
        spin_lock_irqsave(&counter->lock, flags);
-       if (counter->mite_chan == NULL) {
+       if (!counter->mite_chan) {
                spin_unlock_irqrestore(&counter->lock, flags);
                return;
        }