linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Joe Perches <joe@perches.com>
Cc: shuah <shuah@kernel.org>, David Gow <davidgow@google.com>,
	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
Subject: Re: [PATCH linux-kselftest/test v6] lib/list-test: add a test for the 'list' doubly linked list
Date: Thu, 31 Oct 2019 09:59:01 +0300	[thread overview]
Message-ID: <20191031065901.GC1705@kadam> (raw)
In-Reply-To: <2b3b48a8512d2c567fce388394ad1d262d31908e.camel@perches.com>

On Wed, Oct 30, 2019 at 12:15:30PM -0700, Joe Perches wrote:
> On Wed, 2019-10-30 at 21:46 +0300, Dan Carpenter wrote:
> > Hm...  I imagined the checkpatch code a little different in my head but
> > this would also work to make it stricter.  I doubt it miss very many
> > real life style problems.
> 
> Well, doubts vs reality...
> 
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> []
> > @@ -3607,7 +3607,7 @@ sub process {
> >  
> >  # if/while/etc brace do not go on next line, unless defining a do while loop,
> >  # or if that brace on the next line is for something else
> > -		if ($line =~ /(.*)\b((?:if|while|for|switch|(?:[a-z_]+|)for_each[a-z_]+)\s*\(|do\b|else\b)/ && $line !~ /^.\s*\#/) {
> > +		if ($line =~ /(.*)\b((?:if|while|for|switch|(?:list|hlist)_for_each[a-z_]+)\s*\(|do\b|else\b)/ && $line !~ /^.\s*\#/) {
> >  			my $pre_ctx = "$1$2";
> >  
> >  			my ($level, @ctx) = ctx_statement_level($linenr, $realcnt, 0);
> 
> So - nak
> 

What I mean is that only the people doing list_for_each and
hlist_for_each don't know how to do it right.  I just tested this over
night and my assumptions were correct.  Here are all the lines that
generate a warning:

+               hlist_for_each_entry_safe(tmp_fil, n, head, fnode)
+static void list_test_list_for_each_prev(struct kunit *test)
+static void list_test_list_for_each_safe(struct kunit *test)
+static void list_test_list_for_each_prev_safe(struct kunit *test)
+static void list_test_list_for_each_entry(struct kunit *test)
+static void list_test_list_for_each_entry_reverse(struct kunit *test)
+       hlist_for_each_entry_safe(x6spi, n,
+       list_for_each_entry(w, &card->widgets, list)

Only the first and last warnings are real style problems and my patch
catches both.

regards,
dan carpenter


  reply	other threads:[~2019-10-31  6:59 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
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 [this message]
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=20191031065901.GC1705@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=brendanhiggins@google.com \
    --cc=davidgow@google.com \
    --cc=joe@perches.com \
    --cc=keescook@chromium.org \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@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).