Commit f1e155bbf863a removed a bunch of stuff that really don't make sense outside the linux kernel. An exception though is logging functions: it is convenient to be able to grep error messages in the code. For this to work, error strings mustn't be broken down on multiple lines, and therefore are likely to overcome the 90 characters limit, and make checkpatch unhappy.
This patch reverts the change for logging functions and adapts it to QEMU. Signed-off-by: Greg Kurz <gr...@kaod.org> --- scripts/checkpatch.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index f0845429342a..cc2796238170 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -192,6 +192,11 @@ our $typeTypedefs = qr{(?x: | QEMUBH # all uppercase )}; +our $logFunctions = qr{(?x: + error_report| + error_printf +)}; + our @typeList = ( qr{void}, qr{(?:unsigned\s+)?char}, @@ -1341,7 +1346,8 @@ sub process { #90 column limit if ($line =~ /^\+/ && - !($line =~ /^\+\s*"[^"]*"\s*(?:\s*|,|\)\s*;)\s*$/) && + !($line =~ /^\+\s*$logFunctions\s*\(\s*(?:([^"]*))?"[X\t]*"\s*(?:,|\)\s*;)\s*$/ || + $line =~ /^\+\s*"[^"]*"\s*(?:\s*|,|\)\s*;)\s*$/) && $length > 80) { if ($length > 90) {