aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Senozhatsky <[email protected]>2017-11-10 08:48:30 +0900
committerPetr Mladek <[email protected]>2018-01-09 10:45:39 +0100
commit1df7338ac96558d5ae4c1a9dd5d1cb60fcd1bdb2 (patch)
tree83dde4b373950f6fceb9e650caec065a988de811
parent04b8eb7a4ccd9ef9343e2720ccf2a5db8cfe2f67 (diff)
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. Link: http://lkml.kernel.org/r/[email protected] To: Tony Luck <[email protected]> To: Fenghua Yu <[email protected]> To: Helge Deller <[email protected]> To: Benjamin Herrenschmidt <[email protected]> To: Paul Mackerras <[email protected]> To: Michael Ellerman <[email protected]> To: James Bottomley <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Jessica Yu <[email protected]> Cc: Petr Mladek <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: Sergey Senozhatsky <[email protected]> Cc: Sergey Senozhatsky <[email protected]> Cc: Joe Perches <[email protected]> Cc: Andy Whitcroft <[email protected]> Signed-off-by: Sergey Senozhatsky <[email protected]> Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Petr Mladek <[email protected]>
-rwxr-xr-xscripts/checkpatch.pl11
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 {
for (my $count = $linenr; $count <= $lc; $count++) {
my $fmt = get_quoted_string($lines[$count - 1], raw_line($count, 0));
$fmt =~ s/%%//g;
- if ($fmt =~ /(\%[\*\d\.]*p(?![\WFfSsBKRraEhMmIiUDdgVCbGNO]).)/) {
+ if ($fmt =~ /(\%[\*\d\.]*p(?![\WSsBKRraEhMmIiUDdgVCbGNO]).)/) {
$bad_extension = $1;
last;
}
}
if ($bad_extension ne "") {
my $stat_real = raw_line($linenr, 0);
+ my $ext_type = "Invalid";
+ my $use = "";
for (my $count = $linenr + 1; $count <= $lc; $count++) {
$stat_real = $stat_real . "\n" . raw_line($count, 0);
}
+ if ($bad_extension =~ /p[Ff]/) {
+ $ext_type = "Deprecated";
+ $use = " - use %pS instead";
+ $use =~ s/pS/ps/ if ($bad_extension =~ /pf/);
+ }
WARN("VSPRINTF_POINTER_EXTENSION",
- "Invalid vsprintf pointer extension '$bad_extension'\n" . "$here\n$stat_real\n");
+ "$ext_type vsprintf pointer extension '$bad_extension'$use\n" . "$here\n$stat_real\n");
}
}