lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 31 Oct 2019 09:59:01 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Joe Perches <joe@...ches.com>
Cc:     shuah <shuah@...nel.org>, David Gow <davidgow@...gle.com>,
        Brendan Higgins <brendanhiggins@...gle.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Kees Cook <keescook@...omium.org>,
        "open list:KERNEL SELFTEST FRAMEWORK" 
        <linux-kselftest@...r.kernel.org>, kunit-dev@...glegroups.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH linux-kselftest/test v6] lib/list-test: add a test for
 the 'list' doubly linked list

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ