Skip to contentSkip to conversation

Clarification on the behaviour of checkpatch.pl

Linux-kernel-mentees Saheed Bolarinwa 2 participants 3 messages Apr 20, 2020 – Apr 21, 2020 Documentation

lore
Share & tools
lore
#0 lore raw

Hello,

My experience is that checkpatch.pl will not flag some warnings when I use

the '-f' flag. This especially true for .rst files. My understanding is that this flag

is needed to use it with a raw source file instead of a patch.

Please, I will like to confirm if this is a normal behaviour or is it my system setup.

Below is an example from the current stable release linux-5.6.y

[saheed@net linux-stable]$ perl ./scripts/checkpatch.pl -f ./Documentation/admin-guide/hw-vuln/tsx_async_abort.rst
total: 0 errors, 0 warnings, 279 lines checked

./Documentation/admin-guide/hw-vuln/tsx_async_abort.rst has no obvious style problems and is ready for submission.

[saheed@net linux-stable]$ perl ./scripts/checkpatch.pl ./Documentation/admin-guide/hw-vuln/tsx_async_abort.rst
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#6:
TAA is a hardware vulnerability that allows unprivileged speculative access to

ERROR: Does not appear to be a unified-diff format patch

total: 1 errors, 1 warnings, 0 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or
--fix-inplace.

./Documentation/admin-guide/hw-vuln/tsx_async_abort.rst has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.

Thank you.

Bolarinwa Saheed

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#1 lore raw

Em Mon, 20 Apr 2020 02:20:19 +0200
Saheed Bolarinwa <[email protected]> escreveu:

Quoted 30 lines

Hello,

My experience is that checkpatch.pl will not flag some warnings when I use

the '-f' flag. This especially true for .rst files. My understanding is that this flag

is needed to use it with a raw source file instead of a patch.

Please, I will like to confirm if this is a normal behaviour or is it my system setup.

Below is an example from the current stable release linux-5.6.y

[saheed@net linux-stable]$ perl ./scripts/checkpatch.pl -f ./Documentation/admin-guide/hw-vuln/tsx_async_abort.rst
total: 0 errors, 0 warnings, 279 lines checked

./Documentation/admin-guide/hw-vuln/tsx_async_abort.rst has no obvious style problems and is ready for submission.

[saheed@net linux-stable]$ perl ./scripts/checkpatch.pl ./Documentation/admin-guide/hw-vuln/tsx_async_abort.rst
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#6:
TAA is a hardware vulnerability that allows unprivileged speculative access to

Quoted 3 lines

ERROR: Does not appear to be a unified-diff format patch

total: 1 errors, 1 warnings, 0 lines checked

If you don't use "-f" flag, then you need to pass a patch to checkpatch, e. g.:

	git show --pretty=email | ./scripts/checkpatch.pl

That's btw what you need to do with all patches you would submit upstream.

The "-f" flag is used only when you want to run a check on an entire file (and not to the lines modified by a patch).

Thanks,
Mauro

#2 lore raw
Quoted 39 lines · Mauro Carvalho Chehab

Em Mon, 20 Apr 2020 02:20:19 +0200
Saheed Bolarinwa <[email protected]> escreveu:

Quoted 30 lines

Hello,

My experience is that checkpatch.pl will not flag some warnings when I use

the '-f' flag. This especially true for .rst files. My understanding is that this flag

is needed to use it with a raw source file instead of a patch.

Please, I will like to confirm if this is a normal behaviour or is it my system setup.

Below is an example from the current stable release linux-5.6.y

[saheed@net linux-stable]$ perl ./scripts/checkpatch.pl -f ./Documentation/admin-guide/hw-vuln/tsx_async_abort.rst
total: 0 errors, 0 warnings, 279 lines checked

./Documentation/admin-guide/hw-vuln/tsx_async_abort.rst has no obvious style problems and is ready for submission.

[saheed@net linux-stable]$ perl ./scripts/checkpatch.pl ./Documentation/admin-guide/hw-vuln/tsx_async_abort.rst
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#6:
TAA is a hardware vulnerability that allows unprivileged speculative access to

Quoted 3 lines

ERROR: Does not appear to be a unified-diff format patch

total: 1 errors, 1 warnings, 0 lines checked

If you don't use "-f" flag, then you need to pass a patch to checkpatch, e. g.:

Quoted 8 lines
	git show --pretty=email | ./scripts/checkpatch.pl

That's btw what you need to do with all patches you would submit upstream.

The "-f" flag is used only when you want to run a check on an entire file (and not to the lines modified by a patch).

Thank you for the clarification.

Saheed