From: Dan Carpenter <dan.carpenter@oracle.com>
To: Madhumitha Prabakaran <madhumithabiw@gmail.com>
Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] Staging: rtlwifi: Remove unwanted parentheses
Date: Thu, 4 Apr 2019 12:09:00 +0300 [thread overview]
Message-ID: <20190404090900.GH32590@kadam> (raw)
In-Reply-To: <20190403223851.22524-1-madhumithabiw@gmail.com>
You should probably update the subject line because now it's not just
about parentheses any more.
[PATCH v2] Staging: rtlwifi: clean up crc16_ccitt()
So the one thing per patch rule is a little bit about selling your
patch. We never allow "Clean up whole_file.c" but we do sometimes allow
"Clean up a function()" so long as the patch description sells it in
the right way.
Blah blah function does "BIT(0) << i" instead of "BIT(i)". Using !!
is slightly shorter than "foo ? 1 : 0". Blah blah, etc.
On Wed, Apr 03, 2019 at 05:38:51PM -0500, Madhumitha Prabakaran wrote:
> @@ -351,13 +351,13 @@ static u16 crc16_ccitt(u8 data, u16 crc)
> else
> result |= BIT(0);
>
> - crc_bit11 = ((crc & BIT(11)) ? 1 : 0) ^ shift_in;
> + crc_bit11 = !!(crc & BIT(11)) ^ shift_in;
> if (crc_bit11 == 0)
> result &= (~BIT(12));
^ ^
I thought your Coccinelle script was going to complain about these
parentheses. Probably the &= confuses it? There are a couple others
in the same function.
regards,
dan carpenter
next prev parent reply other threads:[~2019-04-04 9:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-03 22:38 [PATCH v2] Staging: rtlwifi: Remove unwanted parentheses Madhumitha Prabakaran
2019-04-04 9:09 ` Dan Carpenter [this message]
2019-04-04 19:56 ` Madhumthia Prabakaran
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=20190404090900.GH32590@kadam \
--to=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=madhumithabiw@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox