staging: pi433: rewrite comparison with NULL
authorValentin Vidic <Valentin.Vidic@CARNet.hr>
Sun, 10 Dec 2017 14:31:17 +0000 (15:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Dec 2017 11:59:40 +0000 (12:59 +0100)
Fixes checkpatch warning for comparing value with NULL.

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/pi433/pi433_if.c

index 00cd8193cfd4b60d24cb6dae3c8f2554a7235e01..86e358831feb16b931f15d80bced8cc23ca934ab 100644 (file)
@@ -873,7 +873,7 @@ pi433_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
        instance = filp->private_data;
        device = instance->device;
 
-       if (device == NULL)
+       if (!device)
                return -ESHUTDOWN;
 
        switch (cmd) {
@@ -985,7 +985,7 @@ static int pi433_release(struct inode *inode, struct file *filp)
        if (!device->users) {
                kfree(device->rx_buffer);
                device->rx_buffer = NULL;
-               if (device->spi == NULL)
+               if (!device->spi)
                        kfree(device);
        }