From: Randy Dunlap <rdunlap@infradead.org>
To: Mihai Moldovan <ionic@ionic.de>, Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kconfig: nconf: stop endless search-up loops
Date: Sat, 27 Mar 2021 15:26:38 -0700 [thread overview]
Message-ID: <362edad0-daea-1f56-bed3-b1df174cbbf1@infradead.org> (raw)
In-Reply-To: <111c5853-e488-0aaa-18e9-36792b648427@ionic.de>
On 3/27/21 3:12 PM, Mihai Moldovan wrote:
> * On 3/27/21 4:58 PM, Randy Dunlap wrote:
>> On 3/27/21 5:01 AM, Mihai Moldovan wrote:
>>> + if ((-1 == index) && (index == match_start))
>>
>> checkpatch doesn't complain about this (and I wonder how it's missed), but
>> kernel style is (mostly) "constant goes on right hand side of comparison",
>> so
>> if ((index == -1) &&
>
> I can naturally send a V2 with that swapped.
>
> To my rationale: I made sure to use checkpatch, saw that it was accepted and
> even went for a quick git grep -- '-1 ==', which likewise returned enough
> results for me to call this consistent with the current code style.
>
> Maybe those matches were just frowned-upon, but forgotten-to-be-critized
> examples of this pattern being used.
There is a test for it in checkpatch.pl but I also used checkpatch.pl
without it complaining, so I don't know what it takes to make the script
complain.
if ($lead !~ /(?:$Operators|\.)\s*$/ &&
$to !~ /^(?:Constant|[A-Z_][A-Z0-9_]*)$/ &&
WARN("CONSTANT_COMPARISON",
"Comparisons should place the constant on the right side of the test\n" . $herecurr) &&
cheers.
--
~Randy
next prev parent reply other threads:[~2021-03-27 22:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-27 12:01 Mihai Moldovan
2021-03-27 15:58 ` Randy Dunlap
2021-03-27 22:12 ` Mihai Moldovan
2021-03-27 22:26 ` Randy Dunlap [this message]
2021-03-28 9:27 ` Mihai Moldovan
2021-03-28 10:37 ` Joe Perches
2021-03-28 10:32 ` Joe Perches
2021-03-28 16:16 ` Randy Dunlap
2021-03-28 9:52 ` [PATCH v2] " Mihai Moldovan
2021-04-10 5:47 ` Masahiro Yamada
2021-04-10 7:00 ` Mihai Moldovan
2021-04-10 9:12 ` Masahiro Yamada
2021-04-15 7:28 ` [PATCH v3] kconfig: nconf: stop endless search loops Mihai Moldovan
2021-04-16 5:40 ` Masahiro Yamada
2021-04-16 10:39 ` Mihai Moldovan
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=362edad0-daea-1f56-bed3-b1df174cbbf1@infradead.org \
--to=rdunlap@infradead.org \
--cc=ionic@ionic.de \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
/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
all inboxes | Powered by JetHome®