[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZDVixjH5qLoy1jTW@smile.fi.intel.com>
Date: Tue, 11 Apr 2023 16:38:14 +0300
From: Andy Shevchenko <andy@...nel.org>
To: Björn Töpel <bjorn@...nel.org>
Cc: Andy Whitcroft <apw@...onical.com>, Joe Perches <joe@...ches.com>,
Dwaipayan Ray <dwaipayanray1@...il.com>,
Lukas Bulwahn <lukas.bulwahn@...il.com>,
linux-kernel@...r.kernel.org,
Björn Töpel <bjorn@...osinc.com>
Subject: Re: [RFC PATCH] checkpatch: Support __initconst combined with struct
definition
On Wed, Mar 01, 2023 at 10:43:20AM +0100, Björn Töpel wrote:
> From: Björn Töpel <bjorn@...osinc.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
Powered by blists - more mailing lists