[LTP] [PATCH] checkpatch: relax parenthesis style checks
Petr Vorel
pvorel@suse.cz
Wed Jul 22 08:32:59 CEST 2026
Hi Andrea, Cyril,
I found both rules useful (more readable and more consistent code). Can we put
it back? Over the years you will recognise on the code of single test that it
was written/modified by several people with a different styles. And that makes
it less readable.
* PARENTHESIS_ALIGNMENT check enforces space behind 'while' or 'if'.
i.e. instead of:
while(tst_fzsync_run_b(&fzsync_pair)) {
have:
while (tst_fzsync_run_b(&fzsync_pair)) {
cve-2014-0196.c mixes 'while()' and 'while ()'. Is it that hard to be
consistent on it?
* OPEN_ENDED_LINE asks for not ending line with '(' or '['.
i.e. instead of this:
ruleset_fd = TST_EXP_FD_SILENT(
tst_syscall(__NR_landlock_create_ruleset, ruleset_attr,
sizeof(struct tst_landlock_ruleset_attr_abi1), 0));
have this:
ruleset_fd = TST_EXP_FD_SILENT(tst_syscall(__NR_landlock_create_ruleset, ruleset_attr,
sizeof(struct tst_landlock_ruleset_attr_abi1), 0));
It's just my personal preference but I agree with the author of the rule that
enforced style is more readable.
Kind regards,
Petr
More information about the ltp
mailing list