]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
checkpatch: exclude forward declarations of const structs
authorTaylor Nelms <tknelms@google.com>
Tue, 31 Mar 2026 18:15:09 +0000 (14:15 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 15 Apr 2026 09:15:02 +0000 (02:15 -0700)
commitf758440d3d82f2e1804d7df281a64d9ad88b7f52
treebe09e125ac3aa951e64906fc3e1a8cb771b32fff
parentcc82b3dcc6a8fa259fbda12ab00d6fc00908a49e
checkpatch: exclude forward declarations of const structs

Limit checkpatch warnings for normally-const structs by excluding patterns
consistent with forward declarations.

For example, the forward declaration `struct regmap_access_table;` in a
header file currently generates a warning recommending that it is
generally declared as const; however, this would apply a useless type
qualifier in the empty declaration `const struct regmap_access_table;`,
and subsequently generate compiler warnings.

Link: https://lkml.kernel.org/r/20260331181509.1258693-1-tknelms@google.com
Signed-off-by: Taylor Nelms <tknelms@google.com>
Acked-by: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
scripts/checkpatch.pl