aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index ba03f17ff662..e954df2b2077 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5759,18 +5759,25 @@ sub process {
5759 for (my $count = $linenr; $count <= $lc; $count++) { 5759 for (my $count = $linenr; $count <= $lc; $count++) {
5760 my $fmt = get_quoted_string($lines[$count - 1], raw_line($count, 0)); 5760 my $fmt = get_quoted_string($lines[$count - 1], raw_line($count, 0));
5761 $fmt =~ s/%%//g; 5761 $fmt =~ s/%%//g;
5762 if ($fmt =~ /(\%[\*\d\.]*p(?![\WFfSsBKRraEhMmIiUDdgVCbGNOx]).)/) { 5762 if ($fmt =~ /(\%[\*\d\.]*p(?![\WSsBKRraEhMmIiUDdgVCbGNOx]).)/) {
5763 $bad_extension = $1; 5763 $bad_extension = $1;
5764 last; 5764 last;
5765 } 5765 }
5766 } 5766 }
5767 if ($bad_extension ne "") { 5767 if ($bad_extension ne "") {
5768 my $stat_real = raw_line($linenr, 0); 5768 my $stat_real = raw_line($linenr, 0);
5769 my $ext_type = "Invalid";
5770 my $use = "";
5769 for (my $count = $linenr + 1; $count <= $lc; $count++) { 5771 for (my $count = $linenr + 1; $count <= $lc; $count++) {
5770 $stat_real = $stat_real . "\n" . raw_line($count, 0); 5772 $stat_real = $stat_real . "\n" . raw_line($count, 0);
5771 } 5773 }
5774 if ($bad_extension =~ /p[Ff]/) {
5775 $ext_type = "Deprecated";
5776 $use = " - use %pS instead";
5777 $use =~ s/pS/ps/ if ($bad_extension =~ /pf/);
5778 }
5772 WARN("VSPRINTF_POINTER_EXTENSION", 5779 WARN("VSPRINTF_POINTER_EXTENSION",
5773 "Invalid vsprintf pointer extension '$bad_extension'\n" . "$here\n$stat_real\n"); 5780 "$ext_type vsprintf pointer extension '$bad_extension'$use\n" . "$here\n$stat_real\n");
5774 } 5781 }
5775 } 5782 }
5776 5783