diff options
author | Pranjal Bhor <bhor.pranjal@gmail.com> | 2016-01-18 22:35:13 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-08 06:04:55 +0300 |
commit | d23054350d0fafdc4a6f8d68b18cd70ec581c95d (patch) | |
tree | 415f4f9be8811cd268b7d87f8ecf314890e096a2 /drivers/staging/wlan-ng | |
parent | 64ddba5275c397e34899a1d77e2ca0ee8e169e4b (diff) | |
download | linux-d23054350d0fafdc4a6f8d68b18cd70ec581c95d.tar.xz |
staging: wlan-ng: NULL comparisons made elegant
Elegance added for NULL comparisons
Signed-off-by: Pranjal Bhor <bhor.pranjal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wlan-ng')
-rw-r--r-- | drivers/staging/wlan-ng/p80211conv.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c index 81f0f06eb597..0a8f3960d465 100644 --- a/drivers/staging/wlan-ng/p80211conv.c +++ b/drivers/staging/wlan-ng/p80211conv.c @@ -562,17 +562,17 @@ void p80211skb_rxmeta_detach(struct sk_buff *skb) struct p80211_frmmeta *frmmeta; /* Sanity checks */ - if (skb == NULL) { /* bad skb */ + if (!skb) { /* bad skb */ pr_debug("Called w/ null skb.\n"); return; } frmmeta = P80211SKB_FRMMETA(skb); - if (frmmeta == NULL) { /* no magic */ + if (!frmmeta) { /* no magic */ pr_debug("Called w/ bad frmmeta magic.\n"); return; } rxmeta = frmmeta->rx; - if (rxmeta == NULL) { /* bad meta ptr */ + if (!rxmeta) { /* bad meta ptr */ pr_debug("Called w/ bad rxmeta ptr.\n"); return; } @@ -608,7 +608,7 @@ int p80211skb_rxmeta_attach(struct wlandevice *wlandev, struct sk_buff *skb) struct p80211_frmmeta *frmmeta; /* If these already have metadata, we error out! */ - if (P80211SKB_RXMETA(skb) != NULL) { + if (P80211SKB_RXMETA(skb)) { netdev_err(wlandev->netdev, "%s: RXmeta already attached!\n", wlandev->name); result = 0; @@ -618,7 +618,7 @@ int p80211skb_rxmeta_attach(struct wlandevice *wlandev, struct sk_buff *skb) /* Allocate the rxmeta */ rxmeta = kzalloc(sizeof(struct p80211_rxmeta), GFP_ATOMIC); - if (rxmeta == NULL) { + if (!rxmeta) { netdev_err(wlandev->netdev, "%s: Failed to allocate rxmeta.\n", wlandev->name); result = 1; |