From patchwork Wed Sep 20 17:38:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 9961985 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8FB2860234 for ; Wed, 20 Sep 2017 17:46:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EE3129195 for ; Wed, 20 Sep 2017 17:46:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7321F291EA; Wed, 20 Sep 2017 17:46:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F26BA29195 for ; Wed, 20 Sep 2017 17:46:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751471AbdITRph (ORCPT ); Wed, 20 Sep 2017 13:45:37 -0400 Received: from smtprelay0218.hostedemail.com ([216.40.44.218]:56029 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751436AbdITRpg (ORCPT ); Wed, 20 Sep 2017 13:45:36 -0400 X-Greylist: delayed 393 seconds by postgrey-1.27 at vger.kernel.org; Wed, 20 Sep 2017 13:45:36 EDT Received: from smtprelay.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by smtpgrave01.hostedemail.com (Postfix) with ESMTP id 5462618076639; Wed, 20 Sep 2017 17:39:04 +0000 (UTC) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id 1060C18076614; Wed, 20 Sep 2017 17:39:03 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: ring37_1461611bad501 X-Filterd-Recvd-Size: 3188 Received: from XPS-9350 (unknown [47.151.132.55]) (Authenticated sender: joe@perches.com) by omf13.hostedemail.com (Postfix) with ESMTPA; Wed, 20 Sep 2017 17:38:59 +0000 (UTC) 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> X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) -- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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");   }   }