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
57535753 for (my $count = $linenr; $count <= $lc; $count++) {
57545754 my $fmt = get_quoted_string($lines[$count - 1], raw_line($count, 0));
57555755 $fmt =~ s/%%//g;
5756− if ($fmt =~ /(\%[\*\d\.]*p(?![\WFfSsBKRraEhMmIiUDdgVCbGNO]).)/) {
5756+ if ($fmt =~ /(\%[\*\d\.]*p(?![\WSsBKRraEhMmIiUDdgVCbGNO]).)/) {
57575757 $bad_extension = $1;
57585758 last;
57595759 }
57605760 }
57615761 if ($bad_extension ne "") {
57625762 my $stat_real = raw_line($linenr, 0);
5763+ my $ext_type = "Invalid";
5764+ my $use = "";
57635765 for (my $count = $linenr + 1; $count <= $lc; $count++) {
57645766 $stat_real = $stat_real . "\n" . raw_line($count, 0);
57655767 }
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+ }
57665773 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");
57685775 }
57695776 }
57705777

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