linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: shuah <shuah@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	David Gow <davidgow@google.com>
Cc: Brendan Higgins <brendanhiggins@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Kees Cook <keescook@chromium.org>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>,
	kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org,
	shuah <shuah@kernel.org>
Subject: Re: [PATCH linux-kselftest/test v6] lib/list-test: add a test for the 'list' doubly linked list
Date: Wed, 30 Oct 2019 10:27:12 -0600	[thread overview]
Message-ID: <42a8270d-ed6f-d29f-5e71-7b76a074b63e@kernel.org> (raw)
In-Reply-To: <20191030104217.GA18421@kadam>

On 10/30/19 4:42 AM, Dan Carpenter wrote:
> On Wed, Oct 30, 2019 at 01:02:11AM -0700, David Gow wrote:
>>> ERROR: that open brace { should be on the previous line
>>> #869: FILE: lib/list-test.c:680:
>>> +static void list_test_list_for_each_entry_reverse(struct kunit *test)
>>> +{
>>>
>>>
>>> I am seeing these error and warns. As per our hallway conversation, the
>>> "for_each*" in the test naming is tripping up checkpatch.pl
>>>
>>> For now you can change the name a bit to not trip checkpatch and maybe
>>> explore fixing checkpatch to differentiate between function names
>>> with "for_each" in them vs. the actual for_each usages in the code.
>>
>> Thanks, Shuah.
>>
>> Yes, the problem here is that checkpatch.pl believes that anything
>> with "for_each" in its name must be a loop, so expects that the open
>> brace is placed on the same line as for a for loop.
>>
>> Longer term, I think it'd be nicer, naming-wise, to fix or work around
>> this issue in checkpatch.pl itself, as that'd allow the tests to
>> continue to follow a naming pattern of "list_test_[x]", where [x] is
>> the name of the function/macro being tested. Of course, short of
>> trying to fit a whole C parser in checkpatch.pl, that's going to
>> involve some compromises as well.
> 
> Just make it a black list of the 5 most common for_each macros.
> 

How does black listing work in the context of checkpatch.pl?

>>
>> In the meantime, I'm sending out v7 which replaces "for_each" with
>> "for__each" (adding the extra underscore), so that checkpatch is
>> happy.

This change is required just to quiet checkpatch and I am not happy
about asking for this change. At the same time, I am concerned about
git hooks failing on this patch.

> 
> It's better to ignore checkpatch and other scripts when they are wrong.
> (unless the warning message inspires you to make the code more readable
> for humans).
> 

It gets confusing when to ignore and when not to. It takes work to
figure out and it is subjective.

It would be great if we can consistently rely on a tool that is used as
a criteria for patches to accept patches.

thanks,
-- Shuah



  reply	other threads:[~2019-10-30 16:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-24 22:46 David Gow
2019-10-29 13:00 ` shuah
2019-10-30  8:02   ` David Gow
2019-10-30 10:42     ` Dan Carpenter
2019-10-30 16:27       ` shuah [this message]
2019-10-30 16:35         ` Brendan Higgins
2019-10-30 17:18           ` Joe Perches
2019-10-31  8:51             ` Brendan Higgins
2019-10-31 10:07               ` Joe Perches
2019-10-31 10:20               ` Dan Carpenter
2019-10-30 18:46         ` Dan Carpenter
2019-10-30 19:15           ` Joe Perches
2019-10-31  6:59             ` Dan Carpenter
2019-11-01 10:50             ` Rasmus Villemoes
2019-10-30 19:12         ` Dan Carpenter
2019-10-30 19:23           ` Joe Perches
2019-10-31  7:12             ` David Gow
2019-10-31  7:42               ` Dan Carpenter
2019-11-01 16:49             ` shuah
2019-10-30 16:31       ` Joe Perches
2019-10-31 18:50 ` Kees Cook
2019-11-01 10:25   ` David Gow

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=42a8270d-ed6f-d29f-5e71-7b76a074b63e@kernel.org \
    --to=shuah@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=brendanhiggins@google.com \
    --cc=dan.carpenter@oracle.com \
    --cc=davidgow@google.com \
    --cc=keescook@chromium.org \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --subject='Re: [PATCH linux-kselftest/test v6] lib/list-test: add a test for the '\''list'\'' doubly linked list' \
    /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

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).