From: Andy Shevchenko <andy@kernel.org>
To: "Björn Töpel" <bjorn@kernel.org>
Cc: "Andy Whitcroft" <apw@canonical.com>,
"Joe Perches" <joe@perches.com>,
"Dwaipayan Ray" <dwaipayanray1@gmail.com>,
"Lukas Bulwahn" <lukas.bulwahn@gmail.com>,
linux-kernel@vger.kernel.org, "Björn Töpel" <bjorn@rivosinc.com>
Subject: Re: [RFC PATCH] checkpatch: Support __initconst combined with struct definition
Date: Tue, 11 Apr 2023 16:38:14 +0300 [thread overview]
Message-ID: <ZDVixjH5qLoy1jTW@smile.fi.intel.com> (raw)
In-Reply-To: <20230301094320.15954-1-bjorn@kernel.org>
On Wed, Mar 01, 2023 at 10:43:20AM +0100, Björn Töpel wrote:
> From: Björn Töpel <bjorn@rivosinc.com>
>
> Checkpatch sometimes report a false positive for __initconst. E.g., for the
> following snippet:
>
> | static const struct strspn_test {
> | const char str[16];
> | const char accept[16];
> | const char reject[16];
> | unsigned a;
> | unsigned r;
> | } tests[] __initconst = {
> | { "foobar", "", "", 0, 6 },
> | { "abba", "abc", "ABBA", 4, 4 },
> | { "abba", "a", "b", 1, 1 },
> | { "", "abc", "abc", 0, 0},
> | };
>
> checkpatch would report:
>
> | ERROR: Use of __initconst requires a separate use of const
> | #190: FILE: ./test_string.c:190:
> | + } tests[] __initconst = {
>
> Improve the reporting by trying harder to find the 'const'.
Joe, what do you think about this?
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-04-11 13:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-01 9:43 Björn Töpel
2023-04-11 13:38 ` Andy Shevchenko [this message]
2023-04-12 1:53 ` Joe Perches
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=ZDVixjH5qLoy1jTW@smile.fi.intel.com \
--to=andy@kernel.org \
--cc=apw@canonical.com \
--cc=bjorn@kernel.org \
--cc=bjorn@rivosinc.com \
--cc=dwaipayanray1@gmail.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
/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®