From 6b7eaf6e1428be33f731287de963862e3846cd42 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Mon, 17 Dec 2012 16:02:02 -0800 Subject: checkpatch: find hex constants as a single IDENT 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 Cc: Andy Whitcroft Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/checkpatch.pl') diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 725c59611e9..8cb9bfc7c14 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -230,7 +230,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{ -- cgit v1.2.3