History

checkpatch: add pF/pf deprecation warning

We deprecated '%pF/%pf' printk specifiers, since '%pS/%ps' is now smart enough to handle function pointer dereference on platforms where such dereference is required.

Sergey Senozhatsky committed 9 years ago

Commit 1df73381 parent 04b8eb71 file · +9 −2Browse files

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

Unified · Split

scripts/checkpatch.pl+9−2
@@ -5753,18 +5753,25 @@ sub process { · 5752 unmodified lines
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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t