* [PATCH] staging: rtl8192u: Modify if, else if conditions to remove unnecessary equality checks. This change was detected with the help of coccinelle tool.
@ 2015-05-18 16:00 Dhere, Chaitanya (C.)
2015-05-18 22:41 ` gregkh
2015-05-19 5:39 ` Paul Gortmaker
0 siblings, 2 replies; 3+ messages in thread
From: Dhere, Chaitanya (C.) @ 2015-05-18 16:00 UTC (permalink / raw)
To: gregkh, cristina.opriceana, gdonald, hamohammed.sa,
mahfouz.saif.elyazal, benoit.taine, paul.gortmaker
Cc: devel, linux-kernel
Signed-off-by: Chaitanya Dhere <cvijaydh@visteon.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);
}
- else if(ieee->is_silent_reset == 1)
- {
+ else if (ieee->is_silent_reset) {
printk("==================>silent reset associate\n");
ieee->is_silent_reset = false;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: rtl8192u: Modify if, else if conditions to remove unnecessary equality checks. This change was detected with the help of coccinelle tool.
2015-05-18 16:00 [PATCH] staging: rtl8192u: Modify if, else if conditions to remove unnecessary equality checks. This change was detected with the help of coccinelle tool Dhere, Chaitanya (C.)
@ 2015-05-18 22:41 ` gregkh
2015-05-19 5:39 ` Paul Gortmaker
1 sibling, 0 replies; 3+ messages in thread
From: gregkh @ 2015-05-18 22:41 UTC (permalink / raw)
To: Dhere, Chaitanya (C.)
Cc: cristina.opriceana, gdonald, hamohammed.sa, mahfouz.saif.elyazal,
benoit.taine, paul.gortmaker, devel, linux-kernel
On Mon, May 18, 2015 at 04:00:00PM +0000, Dhere, Chaitanya (C.) wrote:
> Signed-off-by: Chaitanya Dhere <cvijaydh@visteon.com>
Your subject line is too long :(
Put some information in the change log area here please, above the
signed-off-by line.
> Reply-To:
Why is this here?
Please fix up and resend.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: rtl8192u: Modify if, else if conditions to remove unnecessary equality checks. This change was detected with the help of coccinelle tool.
2015-05-18 16:00 [PATCH] staging: rtl8192u: Modify if, else if conditions to remove unnecessary equality checks. This change was detected with the help of coccinelle tool Dhere, Chaitanya (C.)
2015-05-18 22:41 ` gregkh
@ 2015-05-19 5:39 ` Paul Gortmaker
1 sibling, 0 replies; 3+ messages in thread
From: Paul Gortmaker @ 2015-05-19 5:39 UTC (permalink / raw)
To: Dhere, Chaitanya (C.)
Cc: gregkh, cristina.opriceana, gdonald, hamohammed.sa,
mahfouz.saif.elyazal, benoit.taine, devel, linux-kernel
[[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@visteon.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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-19 5:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-18 16:00 [PATCH] staging: rtl8192u: Modify if, else if conditions to remove unnecessary equality checks. This change was detected with the help of coccinelle tool Dhere, Chaitanya (C.)
2015-05-18 22:41 ` gregkh
2015-05-19 5:39 ` Paul Gortmaker
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 NNTP newsgroup(s).