Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753612Ab2KAHMh (ORCPT ); Thu, 1 Nov 2012 03:12:37 -0400 Received: from perches-mx.perches.com ([206.117.179.246]:60516 "EHLO labridge.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752855Ab2KAHMg (ORCPT ); Thu, 1 Nov 2012 03:12:36 -0400 From: Joe Perches To: Andrew Morton , Andy Whitcroft Cc: Adil Mujeeb , Pavel Machek , linux-kernel@vger.kernel.org Subject: [PATCH V2 1/3] checkpatch: Find hex constants as a single IDENT Date: Thu, 1 Nov 2012 00:12:16 -0700 Message-Id: X-Mailer: git-send-email 1.7.8.112.g3fd21 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1223 Lines: 34 Hexadecimal values are current found in 2 parts. A hex constant like 0x123456abcdef is found as 0 and then x123456abcdef and later coalesced. Instead, reverse the order of the 2 searches in $Constant to find 0x first, then 0 so that the entire hex constant is found all at once. Signed-off-by: Joe Perches --- scripts/checkpatch.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index f18750e..099a0ad 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -227,7 +227,7 @@ our $Inline = qr{inline|__always_inline|noinline}; our $Member = qr{->$Ident|\.$Ident|\[[^]]*\]}; our $Lval = qr{$Ident(?:$Member)*}; -our $Constant = qr{(?i:(?:[0-9]+|0x[0-9a-f]+)[ul]*)}; +our $Constant = qr{(?i:(?:0x[0-9a-f]+|[0-9]+)[ul]*)}; our $Assignment = qr{(?:\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=)}; our $Compare = qr{<=|>=|==|!=|<|>}; our $Operators = qr{ -- 1.7.8.112.g3fd21 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/