diff options
author | Gargi Sharma <gs051095@gmail.com> | 2017-02-24 01:36:59 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-06 09:17:01 +0100 |
commit | 5043bd3c33e1ffee3fd20e5057742f3a6abb34b7 (patch) | |
tree | f42a9ad8324d18f119a76d3ae459b27b67603e67 /drivers | |
parent | 3337134e419bd392cf4d63c66848536ae0c9d8df (diff) |
staging: rtl8192e: replace explicit NULL comparison
Replace explicit NULL comparison with ! operator to
simplify code.
Found with Coccinelle script:
@@
expression ptr;
position p;
statement s0, s1;
@@
ptr@p =
\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\|usb_alloc_urb\|
alloc_netdev\|dev_alloc_skb\)(...)
... when != ptr
if (
(
+ !
ptr
- == NULL
)
) s0 else s1
Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/rtl8192e/rtl819x_BAProc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c index 20260af49ee7..1d3963136295 100644 --- a/drivers/staging/rtl8192e/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c @@ -88,7 +88,7 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst, return NULL; } skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr)); - if (skb == NULL) + if (!skb) return NULL; memset(skb->data, 0, sizeof(struct rtllib_hdr_3addr)); @@ -154,7 +154,7 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst, DelbaParamSet.field.TID = pBA->BaParamSet.field.TID; skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr)); - if (skb == NULL) + if (!skb) return NULL; skb_reserve(skb, ieee->tx_headroom); |