Re: [PATCH v3 01/11] checkpatch: check for nested (un)?likely() calls

From: Markus Elfring
Date: Sat Aug 31 2019 - 13:27:46 EST


>>>>> +# nested likely/unlikely calls
>>>>> +ÂÂÂÂÂÂÂ if ($line =~ /\b(?:(?:un)?likely)\s*\(\s*!?\s*(IS_ERR(?:_OR_NULL|_VALUE)?|WARN)/) {
>>>>> +ÂÂÂÂÂÂÂÂÂÂÂ WARN("LIKELY_MISUSE",
â
>> \b(?:un)?likely\s*
>
> This pair of brackets is required to match "unlikely"
> and it's optional in order to match "likely".

I agree also to this view if you refer to the shortened regular expression here.
But I got an other development opinion for an extra pair of non-capturing parentheses
at the front (from the version which you suggested).

Regards,
Markus