Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
checkpatch: Support __initconst combined with struct definition
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 | torvalds#190: FILE: ./test_string.c:190: | + } tests[] __initconst = { Improve the reporting by trying harder to find the 'const'. Signed-off-by: Björn Töpel <[email protected]>
- Loading branch information