diff options
author | Gargi Sharma <gs051095@gmail.com> | 2017-02-24 01:46:46 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-06 09:17:01 +0100 |
commit | 3337134e419bd392cf4d63c66848536ae0c9d8df (patch) | |
tree | c97c46b695b56cd2bbc0e11f6f982e365bd19a24 /drivers/staging/rtl8192u | |
parent | c01496a7d2abe8462e10c9a536b5e0c46a460d06 (diff) |
staging: rtl8192u: 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/staging/rtl8192u')
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c index 6619b8fb9700..e82b5073c3f1 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c @@ -117,7 +117,7 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, P return NULL; } skb = dev_alloc_skb(len + sizeof( struct rtl_80211_hdr_3addr)); //need to add something others? FIXME - if (skb == NULL) { + if (!skb) { IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc skb for ADDBA_REQ\n"); return NULL; } @@ -202,7 +202,7 @@ static struct sk_buff *ieee80211_DELBA( DelbaParamSet.field.TID = pBA->BaParamSet.field.TID; skb = dev_alloc_skb(len + sizeof( struct rtl_80211_hdr_3addr)); //need to add something others? FIXME - if (skb == NULL) { + if (!skb) { IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc skb for ADDBA_REQ\n"); return NULL; } |