Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1df7338a authored by Sergey Senozhatsky's avatar Sergey Senozhatsky Committed by Petr Mladek
Browse files

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: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
parent 04b8eb7a
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -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");
			}
		}