Staging: irda: net: Use NOT operator instead of comparison to NULL
authorGeorgiana Chelu <georgiana.chelu93@gmail.com>
Fri, 22 Sep 2017 07:52:13 +0000 (00:52 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Sep 2017 08:53:45 +0000 (10:53 +0200)
Fix issues find by checkpatch.pl.
CHECK: Comparison to NULL could be written "!dongles"
CHECK: Comparison to NULL could be written "!tasks"

Signed-off-by: Georgiana Chelu <georgiana.chelu93@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/irda/net/irda_device.c

index 3501478..944eeaa 100644 (file)
@@ -62,14 +62,14 @@ static void irda_task_timer_expired(void *data);
 int __init irda_device_init( void)
 {
        dongles = hashbin_new(HB_NOLOCK);
-       if (dongles == NULL) {
+       if (!dongles) {
                net_warn_ratelimited("IrDA: Can't allocate dongles hashbin!\n");
                return -ENOMEM;
        }
        spin_lock_init(&dongles->hb_spinlock);
 
        tasks = hashbin_new(HB_LOCK);
-       if (tasks == NULL) {
+       if (!tasks) {
                net_warn_ratelimited("IrDA: Can't allocate tasks hashbin!\n");
                hashbin_delete(dongles, NULL);
                return -ENOMEM;