aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2018-07-13 19:59:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-07-14 14:11:10 -0400
commitffe075132af8b7967089c361e506d4fa747efd14 (patch)
treeca576ebeffbba55027e0cce804deb17e30e9d8e7 /scripts
parentbb177a732c4369bb58a1fe1df8f552b6f0f7db5f (diff)
checkpatch: fix duplicate invalid vsprintf pointer extension '%p<foo>' messages
Multiline statements with invalid %p<foo> uses produce multiple warnings. Fix that. e.g.: $ cat t_block.c void foo(void) { MY_DEBUG(drv->foo, "%pk", foo->boo); } $ ./scripts/checkpatch.pl -f t_block.c WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #1: FILE: t_block.c:1: +void foo(void) WARNING: Invalid vsprintf pointer extension '%pk' #3: FILE: t_block.c:3: + MY_DEBUG(drv->foo, + "%pk", + foo->boo); WARNING: Invalid vsprintf pointer extension '%pk' #3: FILE: t_block.c:3: + MY_DEBUG(drv->foo, + "%pk", + foo->boo); total: 0 errors, 3 warnings, 6 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. t_block.c has style problems, please review. NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. Link: http://lkml.kernel.org/r/9e8341bbe4c9877d159cb512bb701043cbfbb10b.camel@perches.com Signed-off-by: Joe Perches <joe@perches.com> Cc: "Tobin C. Harding" <me@tobin.cc> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a9c05506e325..447857ffaf6b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5813,14 +5813,14 @@ sub process {
5813 defined $stat && 5813 defined $stat &&
5814 $stat =~ /^\+(?![^\{]*\{\s*).*\b(\w+)\s*\(.*$String\s*,/s && 5814 $stat =~ /^\+(?![^\{]*\{\s*).*\b(\w+)\s*\(.*$String\s*,/s &&
5815 $1 !~ /^_*volatile_*$/) { 5815 $1 !~ /^_*volatile_*$/) {
5816 my $specifier;
5817 my $extension;
5818 my $bad_specifier = "";
5819 my $stat_real; 5816 my $stat_real;
5820 5817
5821 my $lc = $stat =~ tr@\n@@; 5818 my $lc = $stat =~ tr@\n@@;
5822 $lc = $lc + $linenr; 5819 $lc = $lc + $linenr;
5823 for (my $count = $linenr; $count <= $lc; $count++) { 5820 for (my $count = $linenr; $count <= $lc; $count++) {
5821 my $specifier;
5822 my $extension;
5823 my $bad_specifier = "";
5824 my $fmt = get_quoted_string($lines[$count - 1], raw_line($count, 0)); 5824 my $fmt = get_quoted_string($lines[$count - 1], raw_line($count, 0));
5825 $fmt =~ s/%%//g; 5825 $fmt =~ s/%%//g;
5826 5826