diff options
author | Elise Lennion <elise.lennion@gmail.com> | 2016-10-29 03:29:21 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-10-30 18:09:03 +0300 |
commit | 15ed5398c94c8e29ee11022926351cb77cf70e7f (patch) | |
tree | 40179e06ab132a4eed8c8854d5fe6b55f2e27f72 /drivers/staging/rtl8192e | |
parent | 7dd448f0986a9c2cf076ca0bea7c9be967e7fe07 (diff) | |
download | linux-15ed5398c94c8e29ee11022926351cb77cf70e7f.tar.xz |
staging: rtl8192e: Standardize test for NULL.
The test for NULL of the return variable of functions was changed from
(ret == NULL) to !ret to match the standard.
Coccinelle was used with semantic patch:
@@
expression e;
identifier id, f;
statement S;
@@
f(...) { <+...
id =
\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap
\|usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\) (...)
... when any
when != id = e
+ if (!id)
- if (\(NULL == id\|id == NULL\))
S
...+> }
Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192e')
-rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_rx.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c index f9003a28cae2..757ffd4f2f89 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c @@ -49,7 +49,7 @@ bool rtl92e_send_cmd_pkt(struct net_device *dev, u32 type, const void *data, else skb = dev_alloc_skb(frag_length + 4); - if (skb == NULL) { + if (!skb) { rt_status = false; goto Failed; } diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index d6777ecda64d..d67e3f3db76d 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -130,7 +130,7 @@ rtllib_frag_cache_get(struct rtllib_device *ieee, ETH_ALEN /* WDS */ + /* QOS Control */ (RTLLIB_QOS_HAS_SEQ(fc) ? 2 : 0)); - if (skb == NULL) + if (!skb) return NULL; entry = &ieee->frag_cache[tid][ieee->frag_next_idx[tid]]; @@ -1430,7 +1430,7 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb, /* skb: hdr + (possible reassembled) full plaintext payload */ payload = skb->data + hdrlen; rxb = kmalloc(sizeof(struct rtllib_rxb), GFP_ATOMIC); - if (rxb == NULL) + if (!rxb) goto rx_dropped; /* to parse amsdu packets */ |