From patchwork Tue Aug 27 06:00:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 2850002 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 34EAEBF546 for ; Tue, 27 Aug 2013 06:00:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2348120443 for ; Tue, 27 Aug 2013 06:00:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0980B20437 for ; Tue, 27 Aug 2013 06:00:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752691Ab3H0GAt (ORCPT ); Tue, 27 Aug 2013 02:00:49 -0400 Received: from perches-mx.perches.com ([206.117.179.246]:57848 "EHLO labridge.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752505Ab3H0GAs (ORCPT ); Tue, 27 Aug 2013 02:00:48 -0400 Received: from [108.38.126.162] (account joe@perches.com HELO [192.168.1.152]) by labridge.com (CommuniGate Pro SMTP 5.0.14) with ESMTPA id 21266150; Mon, 26 Aug 2013 23:00:48 -0700 Message-ID: <1377583247.2658.13.camel@joe-AO722> Subject: Re: [trivial PATCH] treewide: Fix printks with 0x%# From: Joe Perches To: Mike Frysinger Cc: Jiri Kosina , "James E.J. Bottomley" , Helge Deller , John Stultz , Thomas Gleixner , Daniele Venzano , Andi Kleen , Jaroslav Kysela , Takashi Iwai , linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-mm@kvack.org, alsa-devel Date: Mon, 26 Aug 2013 23:00:47 -0700 In-Reply-To: <201308270139.29838.vapier@gentoo.org> References: <1374778405.1957.21.camel@joe-AO722> <201308270139.29838.vapier@gentoo.org> X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, 2013-08-27 at 01:39 -0400, Mike Frysinger wrote: > On Thursday 25 July 2013 14:53:25 Joe Perches wrote: > > Using 0x%# emits 0x0x. Only one is necessary. > > sounds like a job for checkpatch.pl :) Here. Submit it yourself... --- scripts/checkpatch.pl | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- 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 9ba4fc4..520f8e7 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3869,6 +3869,18 @@ sub process { } } +# check for formats with "0x%#" + if ($line =~ /"X*"/) { + my $fmt = get_quoted_string($line, $rawline); + if ($fmt =~ /0x%#/) { + if (WARN("REDUNDANT_HEX", + "Redundant hex prefix 0x format\n" . $herecurr) && + $fix) { + $fixed[$linenr - 1] =~ s/0x%#/%#/g; + } + } + } + # Check for misused memsets if ($^V && $^V ge 5.10.0 && defined $stat &&