Skip to contentSkip to conversation

: staging: wlan-ng: Remove unnecessary NULL check before returning error.

PATCH In review Sandhya 2 participants 2 messages Feb 20, 2016 Staging

lore
Share & tools
lore

Sandhya

author
#0 lore raw

PATCH 1/1 : staging: wlan-ng: Remove unnecessary NULL check before returning error.

Remove unnecessary NULL check before returning error.

---
 drivers/staging/wlan-ng/cfg80211.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/wlan-ng/cfg80211.c +2 -2
index 8c1e3f0..c59dd33 100644
@@ -303,7 +303,7 @@ static int prism2_get_station(struct wiphy *wiphy, struct net_device *dev,
 
 	memset(sinfo, 0, sizeof(*sinfo));
 
-	if ((wlandev == NULL) || (wlandev->msdstate != WLAN_MSD_RUNNING))
+	if (!wlandev || (wlandev->msdstate != WLAN_MSD_RUNNING))
 		return -EOPNOTSUPP;
 
 	/* build request message */
@@ -312,7 +312,7 @@ static int prism2_get_station(struct wiphy *wiphy, struct net_device *dev,
 	quality.dbm.status = P80211ENUM_msgitem_status_data_ok;
 
 	/* send message to nsd */
-	if (wlandev->mlmerequest == NULL)
+	if (!wlandev->mlmerequest)
 		return -EOPNOTSUPP;
 
 	result = wlandev->mlmerequest(wlandev, (struct p80211msg *) &quality);
Signature · 1 line
1.8.3.4
#1 lore raw
Quoted 1 line · Sandhya

Remove unnecessary NULL check before returning error.

The commit message is very misleading. You are not removing the check, you are writing it in a different way. The fact that an error is returned is also not relevant to what you are doing.

julia

Quoted 38 lines
---
 drivers/staging/wlan-ng/cfg80211.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/wlan-ng/cfg80211.c +2 -3
index 8c1e3f0..c59dd33 100644
@@ -303,7 +303,7 @@ static int prism2_get_station(struct wiphy *wiphy, struct net_device *dev,
 
 	memset(sinfo, 0, sizeof(*sinfo));
 
-	if ((wlandev == NULL) || (wlandev->msdstate != WLAN_MSD_RUNNING))
+	if (!wlandev || (wlandev->msdstate != WLAN_MSD_RUNNING))
 		return -EOPNOTSUPP;
 
 	/* build request message */
@@ -312,7 +312,7 @@ static int prism2_get_station(struct wiphy *wiphy, struct net_device *dev,
 	quality.dbm.status = P80211ENUM_msgitem_status_data_ok;
 
 	/* send message to nsd */
-	if (wlandev->mlmerequest == NULL)
+	if (!wlandev->mlmerequest)
 		return -EOPNOTSUPP;
 
 	result = wlandev->mlmerequest(wlandev, (struct p80211msg *) &quality);
--

1.8.3.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160220044933.GA10427%40sandhya.
For more options, visit https://groups.google.com/d/optout.