Re: [PATCH] staging: rtl8192u: bool tests don't need comparisons

From: Frans Klaver
Date: Tue Jun 23 2015 - 08:57:06 EST


On Tue, Jun 23, 2015 at 2:52 PM, Luis de Bethencourt
<luis@xxxxxxxxxxxxxxxxx> wrote:
> Remove explicit true/false comparations to bool variables.
>
> Signed-off-by: Luis de Bethencourt <luis@xxxxxxxxxxxxxxxxx>
> ---
> drivers/staging/rtl8192u/r8192U_core.c | 7 ++++---
> drivers/staging/rtl8192u/r8192U_dm.c | 21 +++++++++++----------
> 2 files changed, 15 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
> index a4795af..c53d670 100644
> --- a/drivers/staging/rtl8192u/r8192U_core.c
> +++ b/drivers/staging/rtl8192u/r8192U_core.c
> @@ -2047,7 +2047,7 @@ static bool GetHalfNmodeSupportByAPs819xUsb(struct net_device *dev)
> struct r8192_priv *priv = ieee80211_priv(dev);
> struct ieee80211_device *ieee = priv->ieee80211;
>
> - if (ieee->bHalfWirelessN24GMode == true)
> + if (ieee->bHalfWirelessN24GMode)
> Reval = true;
> else
> Reval = false;

With this one I'd go as far as saying that

Reval = ieee->bHalfWirelessN24GMode;

Frans
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/