From patchwork Sat Sep 30 02:53:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 9979063 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 CA42B6037F for ; Sat, 30 Sep 2017 02:55:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE14429794 for ; Sat, 30 Sep 2017 02:55:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF699297C4; Sat, 30 Sep 2017 02:55:01 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 45D9D29794 for ; Sat, 30 Sep 2017 02:55:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752840AbdI3Cy7 (ORCPT ); Fri, 29 Sep 2017 22:54:59 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:34431 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752822AbdI3Cy6 (ORCPT ); Fri, 29 Sep 2017 22:54:58 -0400 Received: by mail-pg0-f65.google.com with SMTP id u27so732796pgn.1; Fri, 29 Sep 2017 19:54:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hGJkn+UUWUIo4YYizc+EGmKwkqSk/TeUzyhiuzX2NP0=; b=U6oIE88OUNVk/UrfxhDYMFxDRTDhy3La0y6srR8jt6mkc+/TIs7YxSwBWPjHyk9sBv SPBZYQqv/NhZUzh7YNj0c/WY3aLX7/QQtqLcUbJ1+yM4GxPjVrHbabUX0UgLNXFVve7x 210Rl3jLv4Xs/Zxsyz5QO6Erc4SZWpuj17oPURUe7NI1zm5zkhQ8r2AXZaJmf7yKbYX4 8iSuoY1xvwWmMXvpCdHYa7X0BjelXaAgQrXpo0/w4obvxa64brEpYcX/DVMScNADSFAW AneMkgnxWiOc5fbKzgdeS5LkS+QpVw4fKCVBeBYu483GaywUzS7ZpYsYJS1oYMi1d/qo 19vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hGJkn+UUWUIo4YYizc+EGmKwkqSk/TeUzyhiuzX2NP0=; b=OIQnJRVmHW3PwmS3f0jg2k1VDFGUrR6ZSOBZHVIcqrxTVlk364Uos3JvBjCjwcRfE1 os049YnKiyDz/wSjEjZ8EgjBV3ov+Sj78qavdqYIs7MCquiNlBVMSRV/dnl4oeK0f1k9 pEyw3WhHnZN1IAHqu02ZTmfjTynjlJbRlJND8o+NTek/DqJLaTNpcmstQ4z405s73YBb jASX2/Pz6TYQjzkPgv4tW+5C0RkTDG8FAXJbKrl0K9EVXE8RrURRuwGoMiooENo47UDr 1Hcfk1VCQ896DM9ZjBkP19n08zOgUcDWlr6c3c5RAZ192NxuJQBm46cOW8SM2r/SKCTx pESA== X-Gm-Message-State: AMCzsaUJ53nRv+AbBqXtf/XtmxwlY1L+Ca7JRXH/x4tnpZwpCRxBsvy5 OMCun65YkY8rIg0NIDEg0wg= X-Google-Smtp-Source: AOwi7QB9lEUlw+yANAsofv9GfVy4UblzWJf9S5T7ssQH33WpWDFq2GLq0f69jABZQi8MqCNfRyhSXg== X-Received: by 10.84.176.163 with SMTP id v32mr1097671plb.428.1506740097504; Fri, 29 Sep 2017 19:54:57 -0700 (PDT) Received: from localhost.localdomain ([175.223.27.84]) by smtp.gmail.com with ESMTPSA id b1sm8680714pgn.94.2017.09.29.19.54.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Sep 2017 19:54:56 -0700 (PDT) From: Sergey Senozhatsky To: Petr Mladek , Steven Rostedt Cc: Tony Luck , Fenghua Yu , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , James Bottomley , Helge Deller , 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, Sergey Senozhatsky , Joe Perches , Andy Whitcroft Subject: [PATCHv3 7/7] checkpatch: add pF/pf deprecation warning Date: Sat, 30 Sep 2017 11:53:19 +0900 Message-Id: <20170930025319.987-8-sergey.senozhatsky@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20170930025319.987-1-sergey.senozhatsky@gmail.com> References: <20170930025319.987-1-sergey.senozhatsky@gmail.com> 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 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: Deprecated vsprintf pointer extension '%pF' - use %pS instead Signed-off-by: Sergey Senozhatsky Signed-off-by: Joe Perches Cc: Andy Whitcroft Tested-by: Helge Deller # parisc64 Tested-by: Santosh Sivaraj # powerpc64 Acked-by: Michael Ellerman # powerpc64 Tested-by: Tony Luck # ia64 Reviewed-by: Petr Mladek --- scripts/checkpatch.pl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 03eb2551477d..387c453413e0 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]/) { + $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"); } }