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: 820169 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y3tdy3PYRz9t2x for ; Sat, 30 Sep 2017 13:07:50 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="U6oIE88O"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3y3tdy2KBCzDqsB for ; Sat, 30 Sep 2017 13:07:50 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="U6oIE88O"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c05::244; helo=mail-pg0-x244.google.com; envelope-from=sergey.senozhatsky@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="U6oIE88O"; dkim-atps=neutral Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com [IPv6:2607:f8b0:400e:c05::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3y3tM71KbDzDqYf for ; Sat, 30 Sep 2017 12:54:59 +1000 (AEST) Received: by mail-pg0-x244.google.com with SMTP id j16so885471pga.2 for ; Fri, 29 Sep 2017 19:54:59 -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=R8AZUBiWg3AbNTGsZvJ2XfZEjZ2nXOm+afwc/r9zWror5LiE+xqoD43xaUcn5dsGFd KO2OxITLrlWZonS3piJYBRXY9F12/oKiBViV01W0CCf77G4Husp6OlOKS76Bp4l5voCX klXsS3la74zcmwEcaYlM7ymb3/RR0HMUD2lVkEwdHvX1qSylZwbO6Nw5htnO/NBhyKEO ZgIocii3YyR1aca2TOCUSIpZUX2qSp+Fpz+Z7sPmbTjTDtIqbZG6823bbKs7vqCJeJJM plGpjGOGQE/gvM8lvA3IDtgTJQDMaVMIgUfhWk8306yK3qFaigRKp9KjFz79M/rclaHi to6w== X-Gm-Message-State: AMCzsaWImZqzEAupqFhUpgcxJb/+HAvIpvGA2ImkjnzGvGYcwh+Px1jT AP5rGSv0jduURMXKO/cg4Kw= 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 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> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andy Whitcroft , Fenghua Yu , Tony Luck , linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, Helge Deller , Jessica Yu , James Bottomley , Alexei Starovoitov , Sergey Senozhatsky , Paul Mackerras , Joe Perches , Andrew Morton , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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"); } }