From: Joe Perches <joe@perches.com>
To: Matteo Croce <mcroce@redhat.com>,
linux-kernel@vger.kernel.org, Andy Whitcroft <apw@canonical.com>
Cc: Kees Cook <keescook@chromium.org>,
Aaron Tomlin <atomlin@redhat.com>,
Matthew Wilcox <willy@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] checkpatch.pl: Warn on duplicate sysctl local variable
Date: Thu, 30 May 2019 17:54:57 -0700 [thread overview]
Message-ID: <685e8554eed17eebc731d62336ef30eb44bd14f7.camel@perches.com> (raw)
In-Reply-To: <20190530235101.3248-1-mcroce@redhat.com>
On Fri, 2019-05-31 at 01:51 +0200, Matteo Croce wrote:
> Commit 6a33853c5773 ("proc/sysctl: add shared variables for range check")
> adds some shared const variables to be used instead of a local copy in
> each source file.
> Warn when a chunk duplicates one of these values in a ctl_table struct:
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -6639,6 +6639,13 @@ sub process {
> "unknown module license " . $extracted_string . "\n" . $herecurr);
> }
> }
> +
> +# check for sysctl duplicate constants
> + if ($line =~ /\.extra[12]\s*=\s*&(zero|one|int_max|max_int)\b/) {
> + my $extracted_string = get_quoted_string($line, $rawline);
> + WARN("DUPLICATED_SYSCTL_CONST",
> + "duplicated sysctl range checking value '$1', consider using the shared one in include/linux/sysctl.h" . $extracted_string . "\n" . $herecurr);
> + }
why is $extracted_string used here?
next prev parent reply other threads:[~2019-05-31 0:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-30 23:51 Matteo Croce
2019-05-31 0:54 ` Joe Perches [this message]
2019-05-31 1:08 ` Matteo Croce
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=685e8554eed17eebc731d62336ef30eb44bd14f7.camel@perches.com \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=apw@canonical.com \
--cc=atomlin@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcroce@redhat.com \
--cc=willy@infradead.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®