[LTP] [PATCH 4/4] checkpatch: Enable more checks, disable ENOSYS
Petr Vorel
pvorel@suse.cz
Fri Apr 24 11:39:19 CEST 2026
Use --spdx-cxx-comments (new feature from previous commit) to avoid
false positive errors:
tst_safe_clocks.h:1: WARNING: Improper SPDX comment style for 'tst_safe_clocks.h', please use '/*' instead
tst_safe_clocks.h:1: WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
Disable checks (via --ignore) to avoid false positive errors:
* ENOSYS
fallocate01.c:230: WARNING: ENOSYS means 'invalid syscall nr' and nothing else
Add new checks:
* CONCATENATED_STRING
lib/tst_test.c:200: CHECK: Concatenated strings should use spaces between elements
* PARENTHESIS_ALIGNMENT
lib/tst_kconfig.c:180: CHECK: Alignment should match open parenthesis
* SPACING (https://www.kernel.org/doc/html/latest/process/coding-style.html#spaces)
lib/tst_kconfig.c:383: CHECK: spaces preferred around that '-' (ctx:VxV)
lib/tst_test.c:1900: CHECK: spaces preferred around that '/' (ctx:VxV)
tst_minmax.h:15: CHECK: No space is necessary after a cast
* SPLIT_STRING
lib/tst_test.c:1951: WARNING: quoted string split across lines
* UNNECESSARY_PARENTHESES
lib/tst_test.c:802: CHECK: Unnecessary parentheses around toptions[i].arg
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
.checkpatch.conf | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/.checkpatch.conf b/.checkpatch.conf
index 20b92aaca9..41b2a6ee18 100644
--- a/.checkpatch.conf
+++ b/.checkpatch.conf
@@ -3,6 +3,9 @@
-f --terse --no-summary
+# allow // in headers
+--spdx-cxx-comments
+
# enable more tests
--strict
@@ -10,4 +13,7 @@
--ignore PREFER_KERNEL_TYPES,STRCPY,STRLCPY,STRNCPY
# TODO: document reason
---ignore CONST_STRUCT,VOLATILE,SPLIT_STRING,FILE_PATH_CHANGES,LONG_LINE,MACRO_ARG_REUSE,SPACING,MULTIPLE_ASSIGNMENTS,UNNECESSARY_PARENTHESES,PARENTHESIS_ALIGNMENT,CONCATENATED_STRING
+--ignore CONST_STRUCT,VOLATILE,FILE_PATH_CHANGES,PREFER_KERNEL_TYPES,LONG_LINE,MACRO_ARG_REUSE,MULTIPLE_ASSIGNMENTS
+
+# ENOSYS is used in test error macros
+--ignore ENOSYS
--
2.53.0
More information about the ltp
mailing list