Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek...
[linux-2.6-block.git] / scripts / checkpatch.pl
index ba03f17ff662a16e6226876aebf71ddff4601f8b..e954df2b207706875ab9695ad2c1c5daf0ec1ed0 100755 (executable)
@@ -5759,18 +5759,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(?![\WFfSsBKRraEhMmIiUDdgVCbGNOx]).)/) {
+                               if ($fmt =~ /(\%[\*\d\.]*p(?![\WSsBKRraEhMmIiUDdgVCbGNOx]).)/) {
                                        $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");
                        }
                }