staging: wlan-ng: fix NULL comparison
authorFu Yong Quah <fuyong@linux.com>
Sat, 20 Feb 2016 10:23:14 +0000 (10:23 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Feb 2016 22:53:27 +0000 (14:53 -0800)
Fix NULL equality comparision by changing it with exclamation mark,
as suggested by Documentation/CodingStyle

Signed-off-by: Fu Yong Quah <fuyong@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/p80211netdev.c

index a9c1e0bafa62badc12221ba92b90b7e75a178605..88255ce2871b5e1ad6ff7215ce38d2b30c8e8f0c 100644 (file)
@@ -328,7 +328,7 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
 
        p80211_wep.data = NULL;
 
-       if (skb == NULL)
+       if (!skb)
                return NETDEV_TX_OK;
 
        if (wlandev->state != WLAN_DEVICE_OPEN) {
@@ -388,7 +388,7 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
                        goto failed;
                }
        }
-       if (wlandev->txframe == NULL) {
+       if (!wlandev->txframe) {
                result = 1;
                goto failed;
        }
@@ -736,7 +736,7 @@ int wlan_setup(wlandevice_t *wlandev, struct device *physdev)
 
        /* Allocate and initialize the wiphy struct */
        wiphy = wlan_create_wiphy(physdev, wlandev);
-       if (wiphy == NULL) {
+       if (!wiphy) {
                dev_err(physdev, "Failed to alloc wiphy.\n");
                return 1;
        }
@@ -744,7 +744,7 @@ int wlan_setup(wlandevice_t *wlandev, struct device *physdev)
        /* Allocate and initialize the struct device */
        netdev = alloc_netdev(sizeof(struct wireless_dev), "wlan%d",
                              NET_NAME_UNKNOWN, ether_setup);
-       if (netdev == NULL) {
+       if (!netdev) {
                dev_err(physdev, "Failed to alloc netdev.\n");
                wlan_free_wiphy(wiphy);
                result = 1;