LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 2/2] staging: rtl8192u: remove unneeded bool
@ 2015-07-17  9:35 Luis de Bethencourt
  2015-07-18  0:40 ` Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: Luis de Bethencourt @ 2015-07-17  9:35 UTC (permalink / raw
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Frans Klaver, Sudip Mukherjee,
	Antoine Schweitzer-Chaput, Cristina Opriceana, Aya Mahfouz,
	Rickard Strandqvist, Koray Gulcu, Greg Donald, Lorenzo Stoakes,
	Ebru Akagunduz, Karthik Nayak, devel

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

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
---
 drivers/staging/rtl8192u/r8192U_core.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index dd74813..41cf99d 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -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)
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v5 2/2] staging: rtl8192u: remove unneeded bool
  2015-07-17  9:35 [PATCH v5 2/2] staging: rtl8192u: remove unneeded bool Luis de Bethencourt
@ 2015-07-18  0:40 ` Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2015-07-18  0:40 UTC (permalink / raw
  To: Luis de Bethencourt
  Cc: linux-kernel, Greg Kroah-Hartman, Frans Klaver, Sudip Mukherjee,
	Antoine Schweitzer-Chaput, Cristina Opriceana, Aya Mahfouz,
	Rickard Strandqvist, Koray Gulcu, Greg Donald, Lorenzo Stoakes,
	Ebru Akagunduz, Karthik Nayak, devel

On Fri, 2015-07-17 at 11:35 +0200, Luis de Bethencourt wrote:
> bool Reval is set to match the value of bHalfWirelessN24GMode just to
> this. The value can be returned directly. Removing uneeded bool.

trivia:

> diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
[]
> @@ -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.

> -	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.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-18  0:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-17  9:35 [PATCH v5 2/2] staging: rtl8192u: remove unneeded bool Luis de Bethencourt
2015-07-18  0:40 ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).