History

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.

Joe Perches committed 8 years ago

Commit ffe07511 parent bb177a71 file · +3 −3Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+3−3
@@ -5813,14 +5813,14 @@ sub process { · 5812 unmodified lines
58135813 defined $stat &&
58145814 $stat =~ /^\+(?![^\{]*\{\s*).*\b(\w+)\s*\(.*$String\s*,/s &&
58155815 $1 !~ /^_*volatile_*$/) {
5816− my $specifier;
5817− my $extension;
5818− my $bad_specifier = "";
58195816 my $stat_real;
58205817
58215818 my $lc = $stat =~ tr@\n@@;
58225819 $lc = $lc + $linenr;
58235820 for (my $count = $linenr; $count <= $lc; $count++) {
5821+ my $specifier;
5822+ my $extension;
5823+ my $bad_specifier = "";
58245824 my $fmt = get_quoted_string($lines[$count - 1], raw_line($count, 0));
58255825 $fmt =~ s/%%//g;
58265826