]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
staging: gdm72xx: NULL comparison style
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Mon, 7 Sep 2015 12:38:22 +0000 (18:08 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2015 01:24:53 +0000 (18:24 -0700)
checkpatch complains if NULL comparison is done as if (var == NULL)

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gdm72xx/gdm_qos.c
drivers/staging/gdm72xx/gdm_sdio.c
drivers/staging/gdm72xx/gdm_usb.c
drivers/staging/gdm72xx/gdm_wimax.c
drivers/staging/gdm72xx/sdio_boot.c
drivers/staging/gdm72xx/usb_boot.c

index 96bf2bf87ff4b657a8ba9770e553543a74878378..72c0f7ef8f2bf2236c852821f8e24f2332fc4476 100644 (file)
@@ -190,7 +190,7 @@ static int get_qos_index(struct nic *nic, u8 *iph, u8 *tcpudph)
        int ip_ver, i;
        struct qos_cb_s *qcb = &nic->qos;
 
-       if (iph == NULL || tcpudph == NULL)
+       if (!iph || !tcpudph)
                return -1;
 
        ip_ver = (iph[0]>>4)&0xf;
index a5fd0794842ee0a9af21577a62b6b2f5ddc83e86..b0521da3c793178ddda39965723562644d7d8621 100644 (file)
@@ -173,12 +173,12 @@ static int init_sdio(struct sdiowm_dev *sdev)
        spin_lock_init(&tx->lock);
 
        tx->sdu_buf = kmalloc(SDU_TX_BUF_SIZE, GFP_KERNEL);
-       if (tx->sdu_buf == NULL)
+       if (!tx->sdu_buf)
                goto fail;
 
        for (i = 0; i < MAX_NR_SDU_BUF; i++) {
                t = alloc_tx_struct(tx);
-               if (t == NULL) {
+               if (!t) {
                        ret = -ENOMEM;
                        goto fail;
                }
@@ -192,7 +192,7 @@ static int init_sdio(struct sdiowm_dev *sdev)
 
        for (i = 0; i < MAX_NR_RX_BUF; i++) {
                r = alloc_rx_struct(rx);
-               if (r == NULL) {
+               if (!r) {
                        ret = -ENOMEM;
                        goto fail;
                }
@@ -200,7 +200,7 @@ static int init_sdio(struct sdiowm_dev *sdev)
        }
 
        rx->rx_buf = kmalloc(RX_BUF_SIZE, GFP_KERNEL);
-       if (rx->rx_buf == NULL)
+       if (!rx->rx_buf)
                goto fail;
 
        return 0;
@@ -359,7 +359,7 @@ static void do_tx(struct work_struct *work)
                is_sdu = 1;
        }
 
-       if (!is_sdu && t == NULL) {
+       if (!is_sdu && !t) {
                spin_unlock_irqrestore(&tx->lock, flags);
                return;
        }
@@ -393,7 +393,7 @@ static int gdm_sdio_send(void *priv_dev, void *data, int len,
        cmd_evt = (pkt[0] << 8) | pkt[1];
        if (cmd_evt == WIMAX_TX_SDU) {
                t = get_tx_struct(tx, &no_spc);
-               if (t == NULL) {
+               if (!t) {
                        /* This case must not happen. */
                        spin_unlock_irqrestore(&tx->lock, flags);
                        return -ENOSPC;
@@ -407,7 +407,7 @@ static int gdm_sdio_send(void *priv_dev, void *data, int len,
                t->cb_data = cb_data;
        } else {
                t = alloc_tx_struct(tx);
-               if (t == NULL) {
+               if (!t) {
                        spin_unlock_irqrestore(&tx->lock, flags);
                        return -ENOMEM;
                }
@@ -581,7 +581,7 @@ static int gdm_sdio_receive(void *priv_dev,
 
        spin_lock_irqsave(&rx->lock, flags);
        r = get_rx_struct(rx);
-       if (r == NULL) {
+       if (!r) {
                spin_unlock_irqrestore(&rx->lock, flags);
                return -ENOMEM;
        }
@@ -615,12 +615,12 @@ static int sdio_wimax_probe(struct sdio_func *func,
                return ret;
 
        phy_dev = kzalloc(sizeof(*phy_dev), GFP_KERNEL);
-       if (phy_dev == NULL) {
+       if (!phy_dev) {
                ret = -ENOMEM;
                goto out;
        }
        sdev = kzalloc(sizeof(*sdev), GFP_KERNEL);
-       if (sdev == NULL) {
+       if (!sdev) {
                ret = -ENOMEM;
                goto out;
        }
index eac2f3478bb99810921c888019fd4d4bf3ffec40..16e497d9d0cf424de81f40d7baca97d5a74493a8 100644 (file)
@@ -139,7 +139,7 @@ static struct usb_rx *get_rx_struct(struct rx_cxt *rx)
 
        if (list_empty(&rx->free_list)) {
                r = alloc_rx_struct(rx);
-               if (r == NULL)
+               if (!r)
                        return NULL;
 
                list_add(&r->list, &rx->free_list);
@@ -224,7 +224,7 @@ static int init_usb(struct usbwm_dev *udev)
        spin_lock_irqsave(&tx->lock, flags);
        for (i = 0; i < MAX_NR_SDU_BUF; i++) {
                t = alloc_tx_struct(tx);
-               if (t == NULL) {
+               if (!t) {
                        spin_unlock_irqrestore(&tx->lock, flags);
                        ret = -ENOMEM;
                        goto fail;
@@ -234,7 +234,7 @@ static int init_usb(struct usbwm_dev *udev)
        spin_unlock_irqrestore(&tx->lock, flags);
 
        r = alloc_rx_struct(rx);
-       if (r == NULL) {
+       if (!r) {
                ret = -ENOMEM;
                goto fail;
        }
@@ -313,7 +313,7 @@ static int gdm_usb_send(void *priv_dev, void *data, int len,
        cmd_evt = (pkt[0] << 8) | pkt[1];
        if (cmd_evt == WIMAX_TX_SDU) {
                t = get_tx_struct(tx, &no_spc);
-               if (t == NULL) {
+               if (!t) {
                        /* This case must not happen. */
                        spin_unlock_irqrestore(&tx->lock, flags);
                        return -ENOSPC;
@@ -321,7 +321,7 @@ static int gdm_usb_send(void *priv_dev, void *data, int len,
                list_add_tail(&t->list, &tx->sdu_list);
        } else {
                t = alloc_tx_struct(tx);
-               if (t == NULL) {
+               if (!t) {
                        spin_unlock_irqrestore(&tx->lock, flags);
                        return -ENOMEM;
                }
@@ -478,7 +478,7 @@ static int gdm_usb_receive(void *priv_dev,
        r = get_rx_struct(rx);
        spin_unlock_irqrestore(&rx->lock, flags);
 
-       if (r == NULL)
+       if (!r)
                return -ENOMEM;
 
        r->callback = cb;
@@ -558,12 +558,12 @@ static int gdm_usb_probe(struct usb_interface *intf,
        }
 
        phy_dev = kzalloc(sizeof(*phy_dev), GFP_KERNEL);
-       if (phy_dev == NULL) {
+       if (!phy_dev) {
                ret = -ENOMEM;
                goto out;
        }
        udev = kzalloc(sizeof(*udev), GFP_KERNEL);
-       if (udev == NULL) {
+       if (!udev) {
                ret = -ENOMEM;
                goto out;
        }
index 08290d901b0c88c04eae7702020eea5e8727a947..6e8dbaf354459920a8230eacf9ac356de8078b80 100644 (file)
@@ -62,7 +62,7 @@ static inline int gdm_wimax_header(struct sk_buff **pskb)
                struct sk_buff *skb2;
 
                skb2 = skb_realloc_headroom(skb, HCI_HEADER_SIZE);
-               if (skb2 == NULL)
+               if (!skb2)
                        return -ENOMEM;
                if (skb->sk)
                        skb_set_owner_w(skb2, skb->sk);
@@ -397,7 +397,7 @@ static int gdm_wimax_ioctl_set_data(struct data_s *dst, struct data_s *src)
        if (!(dst->buf && dst->size == src->size)) {
                kdelete(&dst->buf);
                dst->buf = kmalloc(src->size, GFP_KERNEL);
-               if (dst->buf == NULL)
+               if (!dst->buf)
                        return -ENOMEM;
        }
 
index 2c02842ac5da1c5f5981b7c3686ed45aaae30bba..ba94b5f13bb264a57b0e6ed9b4d8b09c3785a59d 100644 (file)
@@ -72,7 +72,7 @@ static int download_image(struct sdio_func *func, const char *img_name)
        }
 
        buf = kmalloc(DOWNLOAD_SIZE + TYPE_A_HEADER_SIZE, GFP_KERNEL);
-       if (buf == NULL)
+       if (!buf)
                return -ENOMEM;
 
        img_len = firm->size;
@@ -139,7 +139,7 @@ int sdio_boot(struct sdio_func *func)
        const char *rfs_name = FW_DIR FW_RFS;
 
        tx_buf = kmalloc(YMEM0_SIZE, GFP_KERNEL);
-       if (tx_buf == NULL)
+       if (!tx_buf)
                return -ENOMEM;
 
        ret = download_image(func, krn_name);
index 50fbec3ecf1f56c8db844c108da1de2da6d1ca89..39ca34031a6b7d662d0c071a51e0a4e3cc967ce3 100644 (file)
@@ -159,7 +159,7 @@ int usb_boot(struct usb_device *usbdev, u16 pid)
        }
 
        tx_buf = kmalloc(DOWNLOAD_SIZE, GFP_KERNEL);
-       if (tx_buf == NULL) {
+       if (!tx_buf) {
                release_firmware(firm);
                return -ENOMEM;
        }
@@ -287,7 +287,7 @@ static int em_download_image(struct usb_device *usbdev, const char *img_name,
        }
 
        buf = kmalloc(DOWNLOAD_CHUCK + pad_size, GFP_KERNEL);
-       if (buf == NULL) {
+       if (!buf) {
                release_firmware(firm);
                return -ENOMEM;
        }