diff options
Diffstat (limited to 'scripts/checkpatch.pl')
| -rwxr-xr-x | scripts/checkpatch.pl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 95cda3ecc66b..0bb68e7ff173 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
| @@ -5753,18 +5753,25 @@ sub process { | |||
| 5753 | for (my $count = $linenr; $count <= $lc; $count++) { | 5753 | for (my $count = $linenr; $count <= $lc; $count++) { |
| 5754 | my $fmt = get_quoted_string($lines[$count - 1], raw_line($count, 0)); | 5754 | my $fmt = get_quoted_string($lines[$count - 1], raw_line($count, 0)); |
| 5755 | $fmt =~ s/%%//g; | 5755 | $fmt =~ s/%%//g; |
| 5756 | if ($fmt =~ /(\%[\*\d\.]*p(?![\WFfSsBKRraEhMmIiUDdgVCbGNO]).)/) { | 5756 | if ($fmt =~ /(\%[\*\d\.]*p(?![\WSsBKRraEhMmIiUDdgVCbGNO]).)/) { |
| 5757 | $bad_extension = $1; | 5757 | $bad_extension = $1; |
| 5758 | last; | 5758 | last; |
| 5759 | } | 5759 | } |
| 5760 | } | 5760 | } |
| 5761 | if ($bad_extension ne "") { | 5761 | if ($bad_extension ne "") { |
| 5762 | my $stat_real = raw_line($linenr, 0); | 5762 | my $stat_real = raw_line($linenr, 0); |
| 5763 | my $ext_type = "Invalid"; | ||
| 5764 | my $use = ""; | ||
| 5763 | for (my $count = $linenr + 1; $count <= $lc; $count++) { | 5765 | for (my $count = $linenr + 1; $count <= $lc; $count++) { |
| 5764 | $stat_real = $stat_real . "\n" . raw_line($count, 0); | 5766 | $stat_real = $stat_real . "\n" . raw_line($count, 0); |
| 5765 | } | 5767 | } |
| 5768 | if ($bad_extension =~ /p[Ff]/) { | ||
| 5769 | $ext_type = "Deprecated"; | ||
| 5770 | $use = " - use %pS instead"; | ||
| 5771 | $use =~ s/pS/ps/ if ($bad_extension =~ /pf/); | ||
| 5772 | } | ||
| 5766 | WARN("VSPRINTF_POINTER_EXTENSION", | 5773 | WARN("VSPRINTF_POINTER_EXTENSION", |
| 5767 | "Invalid vsprintf pointer extension '$bad_extension'\n" . "$here\n$stat_real\n"); | 5774 | "$ext_type vsprintf pointer extension '$bad_extension'$use\n" . "$here\n$stat_real\n"); |
| 5768 | } | 5775 | } |
| 5769 | } | 5776 | } |
| 5770 | 5777 | ||
