]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
staging: ks7010: Remove the explicit NULL comparison
authorsayli karnik <karniksayli1995@gmail.com>
Mon, 12 Sep 2016 21:17:28 +0000 (02:47 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Sep 2016 13:01:29 +0000 (15:01 +0200)
The patch removes the explicit null comparisons entirely for the ks7010 driver.
This was detected by checkpatch.pl

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks7010_sdio.c
drivers/staging/ks7010/ks_hostif.c
drivers/staging/ks7010/ks_wlan_net.c

index 632253c11cd42df6a052f705a88d85c41f1622fe..d5299f03217962d1bc4ef4d250bb5cab3f678ca1 100644 (file)
@@ -266,7 +266,7 @@ static int enqueue_txdev(struct ks_wlan_private *priv, unsigned char *p,
 
        if (priv->dev_state < DEVICE_STATE_BOOT) {
                kfree(p);
-               if (complete_handler != NULL)
+               if (complete_handler)
                        (*complete_handler) (arg1, arg2);
                return 1;
        }
@@ -275,7 +275,7 @@ static int enqueue_txdev(struct ks_wlan_private *priv, unsigned char *p,
                /* in case of buffer overflow */
                DPRINTK(1, "tx buffer overflow\n");
                kfree(p);
-               if (complete_handler != NULL)
+               if (complete_handler)
                        (*complete_handler) (arg1, arg2);
                return 1;
        }
@@ -346,7 +346,7 @@ static void tx_device_task(void *dev)
 
                }
                kfree(sp->sendp);       /* allocated memory free */
-               if (sp->complete_handler != NULL)       /* TX Complete */
+               if (sp->complete_handler)       /* TX Complete */
                        (*sp->complete_handler) (sp->arg1, sp->arg2);
                inc_txqhead(priv);
 
@@ -687,7 +687,7 @@ static void trx_device_exit(struct ks_wlan_private *priv)
        while (cnt_txqbody(priv) > 0) {
                sp = &priv->tx_dev.tx_dev_buff[priv->tx_dev.qhead];
                kfree(sp->sendp);       /* allocated memory free */
-               if (sp->complete_handler != NULL)       /* TX Complete */
+               if (sp->complete_handler)       /* TX Complete */
                        (*sp->complete_handler) (sp->arg1, sp->arg2);
                inc_txqhead(priv);
        }
@@ -1010,7 +1010,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 
        /* private memory allocate */
        netdev = alloc_etherdev(sizeof(*priv));
-       if (netdev == NULL) {
+       if (!netdev) {
                printk(KERN_ERR "ks7010 : Unable to alloc new net device\n");
                goto error_release_irq;
        }
@@ -1126,7 +1126,7 @@ static void ks7010_sdio_remove(struct sdio_func *func)
 
        card = sdio_get_drvdata(func);
 
-       if (card == NULL)
+       if (!card)
                return;
 
        DPRINTK(1, "priv = card->priv\n");
@@ -1149,7 +1149,7 @@ static void ks7010_sdio_remove(struct sdio_func *func)
                        struct hostif_stop_request_t *pp;
                        pp = (struct hostif_stop_request_t *)
                            kzalloc(hif_align_size(sizeof(*pp)), GFP_KERNEL);
-                       if (pp == NULL) {
+                       if (!pp) {
                                DPRINTK(3, "allocate memory failed..\n");
                                return; /* to do goto ni suru */
                        }
index e09df36016ad32569cf92698043c9a678bb0b906..8e33a43ca46b0806482106835f88aead95fa5c33 100644 (file)
@@ -1178,7 +1178,7 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *packet)
            kmalloc(hif_align_size(sizeof(*pp) + 6 + packet_len + 8),
                    KS_WLAN_MEM_FLAG);
 
-       if (pp == NULL) {
+       if (!pp) {
                DPRINTK(3, "allocate memory failed..\n");
                dev_kfree_skb(packet);
                return -2;
@@ -1319,7 +1319,7 @@ void hostif_mib_get_request(struct ks_wlan_private *priv,
        /* make primitive */
        pp = (struct hostif_mib_get_request_t *)
            kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG);
-       if (pp == NULL) {
+       if (!pp) {
                DPRINTK(3, "allocate memory failed..\n");
                return;
        }
@@ -1350,7 +1350,7 @@ void hostif_mib_set_request(struct ks_wlan_private *priv,
        /* make primitive */
        pp = (struct hostif_mib_set_request_t *)
            kmalloc(hif_align_size(sizeof(*pp) + size), KS_WLAN_MEM_FLAG);
-       if (pp == NULL) {
+       if (!pp) {
                DPRINTK(3, "allocate memory failed..\n");
                return;
        }
@@ -1380,7 +1380,7 @@ void hostif_start_request(struct ks_wlan_private *priv, unsigned char mode)
        /* make primitive */
        pp = (struct hostif_start_request_t *)
            kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG);
-       if (pp == NULL) {
+       if (!pp) {
                DPRINTK(3, "allocate memory failed..\n");
                return;
        }
@@ -1408,7 +1408,7 @@ void hostif_ps_adhoc_set_request(struct ks_wlan_private *priv)
        /* make primitive */
        pp = (struct hostif_ps_adhoc_set_request_t *)
            kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG);
-       if (pp == NULL) {
+       if (!pp) {
                DPRINTK(3, "allocate memory failed..\n");
                return;
        }
@@ -1452,7 +1452,7 @@ void hostif_infrastructure_set_request(struct ks_wlan_private *priv)
        /* make primitive */
        pp = (struct hostif_infrastructure_set_request_t *)
            kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG);
-       if (pp == NULL) {
+       if (!pp) {
                DPRINTK(3, "allocate memory failed..\n");
                return;
        }
@@ -1519,7 +1519,7 @@ static void hostif_infrastructure_set2_request(struct ks_wlan_private *priv)
        /* make primitive */
        pp = (struct hostif_infrastructure_set2_request_t *)
            kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG);
-       if (pp == NULL) {
+       if (!pp) {
                DPRINTK(3, "allocate memory failed..\n");
                return;
        }
@@ -1589,7 +1589,7 @@ void hostif_adhoc_set_request(struct ks_wlan_private *priv)
        /* make primitive */
        pp = (struct hostif_adhoc_set_request_t *)
            kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG);
-       if (pp == NULL) {
+       if (!pp) {
                DPRINTK(3, "allocate memory failed..\n");
                return;
        }
@@ -1635,7 +1635,7 @@ void hostif_adhoc_set2_request(struct ks_wlan_private *priv)
        /* make primitive */
        pp = (struct hostif_adhoc_set2_request_t *)
            kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG);
-       if (pp == NULL) {
+       if (!pp) {
                DPRINTK(3, "allocate memory failed..\n");
                return;
        }
@@ -1683,7 +1683,7 @@ void hostif_stop_request(struct ks_wlan_private *priv)
        /* make primitive */
        pp = (struct hostif_stop_request_t *)
            kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG);
-       if (pp == NULL) {
+       if (!pp) {
                DPRINTK(3, "allocate memory failed..\n");
                return;
        }
@@ -1706,7 +1706,7 @@ void hostif_phy_information_request(struct ks_wlan_private *priv)
        /* make primitive */
        pp = (struct hostif_phy_information_request_t *)
            kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG);
-       if (pp == NULL) {
+       if (!pp) {
                DPRINTK(3, "allocate memory failed..\n");
                return;
        }
@@ -1738,7 +1738,7 @@ void hostif_power_mngmt_request(struct ks_wlan_private *priv,
        /* make primitive */
        pp = (struct hostif_power_mngmt_request_t *)
            kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG);
-       if (pp == NULL) {
+       if (!pp) {
                DPRINTK(3, "allocate memory failed..\n");
                return;
        }
@@ -1765,7 +1765,7 @@ void hostif_sleep_request(struct ks_wlan_private *priv, unsigned long mode)
                /* make primitive */
                pp = (struct hostif_sleep_request_t *)
                    kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG);
-               if (pp == NULL) {
+               if (!pp) {
                        DPRINTK(3, "allocate memory failed..\n");
                        return;
                }
@@ -1799,7 +1799,7 @@ void hostif_bss_scan_request(struct ks_wlan_private *priv,
        /* make primitive */
        pp = (struct hostif_bss_scan_request_t *)
            kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG);
-       if (pp == NULL) {
+       if (!pp) {
                DPRINTK(3, "allocate memory failed..\n");
                return;
        }
@@ -1856,7 +1856,7 @@ void hostif_mic_failure_request(struct ks_wlan_private *priv,
        /* make primitive */
        pp = (struct hostif_mic_failure_request_t *)
            kmalloc(hif_align_size(sizeof(*pp)), KS_WLAN_MEM_FLAG);
-       if (pp == NULL) {
+       if (!pp) {
                DPRINTK(3, "allocate memory failed..\n");
                return;
        }
index d69b4c945d218621f71fa25fe63fb38fe123e915..a35325ed26fc426f510bf43e5900f46e68ed6453 100644 (file)
@@ -3366,7 +3366,7 @@ int ks_wlan_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
        DPRINTK(3, "in_interrupt()=%ld\n", in_interrupt());
 
-       if (skb == NULL) {
+       if (!skb) {
                printk(KERN_ERR "ks_wlan:  skb == NULL!!!\n");
                return 0;
        }