History

checkpatch: fix $Float creation of match variables

Commit 74349bccedb3 ("checkpatch: add support for floating point constants") added an unnecessary match variable that caused tests that used a $Constant or $LvalOrFunc to have one too many matches. This causes problems with usleep_range, min/max and other extended tests. Avoid using match variables in $Float. Avoid using match variables in $Assignment too.

Joe Perches committed 13 years ago

Commit 326b1ff1 parent 91c777d1 file · +5 −5Browse files

Unified · Split

scripts/checkpatch.pl+5−5
@@ -230,12 +230,12 @@ our $Inline = qr{inline|__always_inline|noinline}; · 229 unmodified lines
230our $Member = qr{->$Ident|\.$Ident|\[[^]]*\]};230our $Member = qr{->$Ident|\.$Ident|\[[^]]*\]};
231our $Lval = qr{$Ident(?:$Member)*};231our $Lval = qr{$Ident(?:$Member)*};
232 232
233our $Float_hex = qr{(?i:0x[0-9a-f]+p-?[0-9]+[fl]?)};233our $Float_hex = qr{(?i)0x[0-9a-f]+p-?[0-9]+[fl]?};
234our $Float_dec = qr{(?i:((?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)(?:e-?[0-9]+)?[fl]?))};234our $Float_dec = qr{(?i)(?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)(?:e-?[0-9]+)?[fl]?};
235our $Float_int = qr{(?i:[0-9]+e-?[0-9]+[fl]?)};235our $Float_int = qr{(?i)[0-9]+e-?[0-9]+[fl]?};
236our $Float = qr{$Float_hex|$Float_dec|$Float_int};236our $Float = qr{$Float_hex|$Float_dec|$Float_int};
237our $Constant = qr{(?:$Float|(?i:(?:0x[0-9a-f]+|[0-9]+)[ul]*))};237our $Constant = qr{$Float|(?i)(?:0x[0-9a-f]+|[0-9]+)[ul]*};
238our $Assignment = qr{(?:\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=)};238our $Assignment = qr{\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=};
239our $Compare = qr{<=|>=|==|!=|<|>};239our $Compare = qr{<=|>=|==|!=|<|>};
240our $Operators = qr{240our $Operators = qr{
241 <=|>=|==|!=|241 <=|>=|==|!=|