Skip to contentSkip to conversation

drivers: staging : wlan-ng : collect return status without variable

PATCH Superseded Hariprasad Kelam 2 participants 2 messages May 11, 2019 Staging

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drivers: staging : wlan-ng : collect return status without variable

As caller rdev_set_default_key not particular about -EFAULT. We can preserve the return value of prism2_domibset_uint32.

-----
Changes in v2:
- remove masking of original return value with EFAULT

---
 drivers/staging/wlan-ng/cfg80211.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/staging/wlan-ng/cfg80211.c +3 -6
index 5dad5ac..4018fc5 100644
@@ -231,12 +231,9 @@ static int prism2_set_default_key(struct wiphy *wiphy, struct net_device *dev,
 {
 	struct wlandevice *wlandev = dev->ml_priv;
 
-	if (prism2_domibset_uint32(wlandev,
-				   DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID,
-				   key_index))
-		return -EFAULT;
-	else
-		return 0;
+	return prism2_domibset_uint32(wlandev,
+				      DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID,
+				      key_index);
 }
 
 static int prism2_get_station(struct wiphy *wiphy, struct net_device *dev,
Signature · 1 line
2.7.4
#1 lore raw
Quoted 20 lines · Hariprasad Kelam

As caller rdev_set_default_key not particular about -EFAULT. We can preserve the return value of prism2_domibset_uint32.

-----
Changes in v2:
- remove masking of original return value with EFAULT

---
 drivers/staging/wlan-ng/cfg80211.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/staging/wlan-ng/cfg80211.c +0 -1
index 5dad5ac..4018fc5 100644
@@ -231,12 +231,9 @@ static int prism2_set_default_key(struct wiphy *wiphy, struct net_device *dev,
 {
 	struct wlandevice *wlandev = dev->ml_priv;
 
-	if (prism2_domibset_uint32(wlandev,

drivers/staging/wlan-ng/cfg80211.c static int prism2_set_default_key(struct wiphy *wiphy, struct net_device *dev, · line 238

Quoted 10 lines
drivers/staging/wlan-ng/cfg80211.c +3 -5
-				   DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID,
-				   key_index))
-		return -EFAULT;
-	else
-		return 0;
+	return prism2_domibset_uint32(wlandev,
+				      DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID,
+				      key_index);
 }
 

I'm sorry, this patch can only be applied on top of v1, but we need a patch which can be applied on top of linux-next without applying v1 first. (Merge/fold the two patches together and resend).

regards,
dan carpenter