Skip to contentSkip to conversation

staging: rtl8192u: remove unneeded bool

PATCH Superseded Luis de Bethencourt 2 participants 2 messages Jul 17, 2015 – Jul 18, 2015 Staging

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v5 2/2 staging: rtl8192u: remove unneeded bool

bool Reval is set to match the value of bHalfWirelessN24GMode just to this. The value can be returned directly. Removing uneeded bool.

---
 drivers/staging/rtl8192u/r8192U_core.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/staging/rtl8192u/r8192U_core.c +1 -7
index dd74813..41cf99d 100644
@@ -2043,16 +2043,10 @@ static bool GetNmodeSupportBySecCfg8192(struct net_device *dev)
 
 static bool GetHalfNmodeSupportByAPs819xUsb(struct net_device *dev)
 {
-	bool			Reval;
 	struct r8192_priv *priv = ieee80211_priv(dev);
 	struct ieee80211_device *ieee = priv->ieee80211;
 
-	if (ieee->bHalfWirelessN24GMode)
-		Reval = true;
-	else
-		Reval =  false;
-
-	return Reval;
+	return ieee->bHalfWirelessN24GMode;
 }
 
 static void rtl8192_refresh_supportrate(struct r8192_priv *priv)
Signature · 1 line
2.1.4
#1 lore raw
Quoted 2 lines · Luis de Bethencourt

bool Reval is set to match the value of bHalfWirelessN24GMode just to this. The value can be returned directly. Removing uneeded bool.

trivia:

drivers/staging/rtl8192u/r8192U_core.c

Quoted 1 line
drivers/staging/rtl8192u/r8192U_core.c +0 -0

[]

drivers/staging/rtl8192u/r8192U_core.c static bool GetNmodeSupportBySecCfg8192(struct net_device *dev) · line 2046

Quoted 6 lines
drivers/staging/rtl8192u/r8192U_core.c +0 -1
@@ -2043,16 +2043,10 @@ static bool GetNmodeSupportBySecCfg8192(struct net_device *dev) 
 static bool GetHalfNmodeSupportByAPs819xUsb(struct net_device *dev)
 {
-	bool			Reval;
 	struct r8192_priv *priv = ieee80211_priv(dev);
 	struct ieee80211_device *ieee = priv->ieee80211;

There doesn't seem to be much value in this temporary.

drivers/staging/rtl8192u/r8192U_core.c static bool GetNmodeSupportBySecCfg8192(struct net_device *dev) · line 2049

Quoted 7 lines
drivers/staging/rtl8192u/r8192U_core.c +1 -6
-	if (ieee->bHalfWirelessN24GMode)
-		Reval = true;
-	else
-		Reval =  false;
-
-	return Reval;
+	return ieee->bHalfWirelessN24GMode;
	return priv->ieee80211->bHalfWirelessN24GMode;

would work as well. But no doubt the compiler does the same thing in any case.