From: Jes Sorensen <jes.sorensen@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>,
Vatika Harlalka <vatikaharlalka@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH] Staging: rtl8188eu: Refine if condition
Date: Mon, 02 Mar 2015 12:30:13 -0500 [thread overview]
Message-ID: <54F49E25.8040205@gmail.com> (raw)
In-Reply-To: <20150302002103.GA17196@kroah.com>
On 03/01/15 19:21, Greg KH wrote:
> On Fri, Feb 27, 2015 at 11:28:49PM +0530, Vatika Harlalka wrote:
>> Variable bound takes maximum value 8 so the if condition
>> for odd i is made more compact.
>>
>> Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
>> ---
>> drivers/staging/rtl8188eu/hal/phy.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
>> index 6af72a4..3d0e447 100644
>> --- a/drivers/staging/rtl8188eu/hal/phy.c
>> +++ b/drivers/staging/rtl8188eu/hal/phy.c
>> @@ -1038,7 +1038,7 @@ static bool simularity_compare(struct adapter *adapt, s32 resulta[][8],
>> bound = 4;
>>
>> for (i = 0; i < bound; i++) {
>> - if ((i == 1) || (i == 3) || (i == 5) || (i == 7)) {
>> + if (i%2 == 1) {
>
> I find this harder to read now, sorry, '%' is not used often in C code
> for a reason :)
In this case, it is probably more common in the kernel to use
if ((i & 1) == 1)
in this case.
Jes
prev parent reply other threads:[~2015-03-02 17:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-27 17:58 [PATCH] Staging: rtl8188eu: Refine if condition Vatika Harlalka
2015-03-02 0:21 ` [Outreachy kernel] " Greg KH
2015-03-02 17:30 ` Jes Sorensen [this message]
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=54F49E25.8040205@gmail.com \
--to=jes.sorensen@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=outreachy-kernel@googlegroups.com \
--cc=vatikaharlalka@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 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.