Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6b7eaf6e authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds
Browse files

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: default avatarJoe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d1e2ad07
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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{