lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150519053914.GP497@windriver.com>
Date:	Tue, 19 May 2015 01:39:14 -0400
From:	Paul Gortmaker <paul.gortmaker@...driver.com>
To:	"Dhere, Chaitanya (C.)" <cvijaydh@...teon.com>
CC:	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	"cristina.opriceana@...il.com" <cristina.opriceana@...il.com>,
	"gdonald@...il.com" <gdonald@...il.com>,
	"hamohammed.sa@...il.com" <hamohammed.sa@...il.com>,
	"mahfouz.saif.elyazal@...il.com" <mahfouz.saif.elyazal@...il.com>,
	"benoit.taine@...6.fr" <benoit.taine@...6.fr>,
	"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] staging: rtl8192u: Modify if, else if conditions to
 remove unnecessary equality checks. This change was detected with the help
 of coccinelle tool.

[[PATCH] staging: rtl8192u: Modify if, else if conditions to remove unnecessary equality checks. This change was detected with the help of coccinelle tool.] On 18/05/2015 (Mon 16:00) Dhere, Chaitanya (C.) wrote:

> Signed-off-by: Chaitanya Dhere <cvijaydh@...teon.com>
> Reply-To: 
> 
> ---
>  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> index d2e8b12..30b0135 100644
> --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> @@ -1364,12 +1364,11 @@ static void ieee80211_associate_complete_wq(struct work_struct *work)
>  		ieee->LinkDetectInfo.NumRecvDataInPeriod= 1;
>  	}
>  	ieee->link_change(ieee->dev);
> -	if(ieee->is_silent_reset == 0){
> +	if (!ieee->is_silent_reset) {
>  		printk("============>normal associate\n");
>  	notify_wx_assoc_event(ieee);
>  	}

In addition to Greg's comments, I'd ask while here, what about the
misleading lack of indent on the notify_wx_assoc_event() call above?
That would concern me more than trivial equality check changes that
gcc will no doubt optimize to the same thing.

> -	else if(ieee->is_silent_reset == 1)
> -	{
> +	else if (ieee->is_silent_reset) {

But why leave the "else if" vs an "else"?  You know this:

staging/rtl8192u/ieee80211/ieee80211.h: bool is_silent_reset;

and you've already tested "if (!ieee->is_silent_reset)".  By
definition, a bool can have only two values and you've already
tested for one of them, so...

Paul.
--

>  		printk("==================>silent reset associate\n");
>  		ieee->is_silent_reset = false;
>  	}
> -- 
> 1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ