Messages in this thread Patch in this message | | | Subject | [PATCH] scripts/checkpatch.pl: Add WARN on printk format split on multiple lines | From | Joe Perches <> | Date | Sun, 20 Dec 2009 11:44:15 -0800 |
| |
On Sun, 2009-12-20 at 20:15 +0100, Ingo Molnar wrote: > Checkpatch should warn about printk > lines that end with a '"', those are almost always a sign of some ill-advised > break-the-string artifact.
Perhaps something like this:
diff from Andy Whitcroft's testing script, where logFunctions is defined. http://www.kernel.org/pub/linux/kernel/people/apw/checkpatch/checkpatch.pl-testing
--- a/scripts/checkpatch.pl-testing 2009-12-20 11:35:28.000000000 -0800 +++ b/scripts/checkpatch.pl-testing 2009-12-20 11:35:46.000000000 -0800 @@ -1398,6 +1398,11 @@ WARN("line over 80 characters\n" . $herecurr); } +#Logging function format split over multiple lines + if ($line =~ /^\+\s*$logFunctions.*"\s*$/) { + WARN("Don't split logging function format\n" . $herecurr); + } + # check for adding lines without a newline. if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) { WARN("adding a line without newline at end of file\n" . $herecurr);
| |