diff options
| author | Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | 2017-11-09 18:48:30 -0500 |
|---|---|---|
| committer | Petr Mladek <pmladek@suse.com> | 2018-01-09 04:45:39 -0500 |
| commit | 1df7338ac96558d5ae4c1a9dd5d1cb60fcd1bdb2 (patch) | |
| tree | 83dde4b373950f6fceb9e650caec065a988de811 /scripts | |
| parent | 04b8eb7a4ccd9ef9343e2720ccf2a5db8cfe2f67 (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/20171109234830.5067-7-sergey.senozhatsky@gmail.com
To: Tony Luck <tony.luck@intel.com>
To: Fenghua Yu <fenghua.yu@intel.com>
To: Helge Deller <deller@gmx.de>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Paul Mackerras <paulus@samba.org>
To: Michael Ellerman <mpe@ellerman.id.au>
To: James Bottomley <jejb@parisc-linux.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jessica Yu <jeyu@kernel.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-ia64@vger.kernel.org
Cc: linux-parisc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-kernel@vger.kernel.org
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Diffstat (limited to 'scripts')
| -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 | ||
