lkml.org 
[lkml]   [2023]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@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


\
 
 \ /
  Last update: 2023-04-11 15:39    [W:0.078 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site