From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751824AbdITRjF (ORCPT ); Wed, 20 Sep 2017 13:39:05 -0400 Received: from smtprelay0155.hostedemail.com ([216.40.44.155]:37123 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751024AbdITRjE (ORCPT ); Wed, 20 Sep 2017 13:39:04 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 30,2,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:960:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2197:2198:2199:2200:2393:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3653:3867:3868:3871:4321:5007:6119:8957:10004:10400:10848:11026:11232:11473:11658:11783:11914:12043:12048:12438:12555:12740:12895:12986:13069:13095:13141:13230:13311:13357:13439:13894:14181:14659:14721:21080:21221:21433:21505:21627:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: ring37_1461611bad501 X-Filterd-Recvd-Size: 3188 Message-ID: <1505929138.12311.5.camel@perches.com> Subject: Re: [RFC][PATCH v2 7/7] checkpatch: add pF/pf deprecation warning From: Joe Perches To: Sergey Senozhatsky , Tony Luck , Fenghua Yu , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , James Bottomley , Helge Deller Cc: Petr Mladek , Steven Rostedt , Andrew Morton , Jessica Yu , Alexei Starovoitov , linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Andy Whitcroft Date: Wed, 20 Sep 2017 10:38:58 -0700 In-Reply-To: <20170920162910.32053-8-sergey.senozhatsky@gmail.com> References: <20170920162910.32053-1-sergey.senozhatsky@gmail.com> <20170920162910.32053-8-sergey.senozhatsky@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2017-09-21 at 01:29 +0900, Sergey Senozhatsky wrote: > 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. > > checkpatch warning example: > > WARNING: Use '%pS/%ps' instead. This pointer extension was deprecated: '%pF' If this series is accepted, I think this message is unclear and would prefer something like: --- scripts/checkpatch.pl | 11 +++++++++--  1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index dd2c262aebbf..71f3273d5913 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5762,18 +5762,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]/i) { + $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");   }   }