clang-format inconsistencies with checkpatch.pl

From: Mickaël Salaün
Date: Sat Apr 23 2022 - 07:45:24 EST


Hi,

I would like to use clang-format (with a pinned version, probably 14) to keep a consistent coding style, or at least start with one. However, there is some inconsistencies with the checkpatch.pl script:

In some cases, goto labels are indented, which checkpatch.pl doesn't like.

checkpatch.pl complains about some functions (e.g. FIXTURE or FIXTURE_VARIANT_ADD) that get an open brace just after but without a space.

I also noticed that there is some clang-format configuration lines that are commented because of incompatibilities with versions older than 6. Shouldn't we require a minimal version, at least the 6th?

About checkpatch.pl, it incorrectly warns about space between function name and open parenthesis for *for_each* functions (specifically interpreted as "for" statements in .clang-format, e.g. list_for_each_entry).

Regards,
Mickaël