From: Jes Sorensen <jes.sorensen@gmail.com>
To: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>,
outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH] Staging: rtl8192u: Simplify if condition
Date: Wed, 04 Mar 2015 20:37:49 -0500 [thread overview]
Message-ID: <54F7B36D.2060801@gmail.com> (raw)
In-Reply-To: <1425511958-1021-1-git-send-email-ksenija.stanojevic@gmail.com>
On 03/04/15 18:32, Ksenija Stanojevic wrote:
> This patch simplifies if condition using following Coccinelle script:
> @@ bool a; symbol true; @@
> (
> - a != true
> + !a
> |
> - a == true
> + a
> )
> @@ bool a; symbol false; @@
> (
> - a != false
> + a
> |
> - a == false
> + !a
> )
>
> Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
> ---
> drivers/staging/rtl8192u/r8192U_wx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
The patch is correct, however you should write a proper commit message
rather than just relying on the coccinelle script.
It's important to try and show in a commit message that you know why you
made the changes, and not just comply with an automated tool.
Cheers,
Jes
> diff --git a/drivers/staging/rtl8192u/r8192U_wx.c b/drivers/staging/rtl8192u/r8192U_wx.c
> index b5a26f3..8359705 100644
> --- a/drivers/staging/rtl8192u/r8192U_wx.c
> +++ b/drivers/staging/rtl8192u/r8192U_wx.c
> @@ -335,7 +335,7 @@ static int r8192_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
> if (!priv->up)
> return -ENETDOWN;
>
> - if (priv->ieee80211->LinkDetectInfo.bBusyTraffic == true)
> + if (priv->ieee80211->LinkDetectInfo.bBusyTraffic)
> return -EAGAIN;
> if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
> struct iw_scan_req *req = (struct iw_scan_req *)b;
>
next prev parent reply other threads:[~2015-03-05 1:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-04 23:32 [PATCH] Staging: rtl8192u: Simplify if condition Ksenija Stanojevic
2015-03-05 1:37 ` Jes Sorensen [this message]
2015-03-05 15:58 ` [Outreachy kernel] " Ksenija Stanojević
-- strict thread matches above, loose matches on Subject: below --
2015-02-24 20:54 Ksenija Stanojevic
2015-02-24 21:24 ` [Outreachy kernel] " Julia Lawall
2015-02-24 21:35 ` Arnd Bergmann
2015-02-25 6:34 ` Julia Lawall
2015-02-25 6:40 ` Julia Lawall
2015-02-25 7:49 ` Ksenija Stanojević
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54F7B36D.2060801@gmail.com \
--to=jes.sorensen@gmail.com \
--cc=ksenija.stanojevic@gmail.com \
--cc=outreachy-kernel@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.