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

2019-09-01 Thread Markus Elfring
> +# 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

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

2019-09-01 Thread Markus Elfring
+# nested likely/unlikely calls + if ($line =~ /\b(?:(?:un)?likely)\s*\(\s*!?\s*(IS_ERR(?:_OR_NULL|_VALUE)?|WARN)/) { + WARN("LIKELY_MISUSE", How do you think about to use the specification “(?:IS_ERR(?:_(?:OR_NULL|VALUE))?|WARN)” in this regular

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

2019-09-01 Thread Markus Elfring
>>> +# nested likely/unlikely calls >>> +    if ($line =~ >>> /\b(?:(?:un)?likely)\s*\(\s*!?\s*(IS_ERR(?:_OR_NULL|_VALUE)?|WARN)/) { >>> +    WARN("LIKELY_MISUSE", >> >> How do you think about to use the specification >> “(?:IS_ERR(?:_(?:OR_NULL|VALUE))?|WARN)” >> in this regular

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

2019-08-31 Thread Denis Efremov
On 31.08.2019 19:45, Markus Elfring wrote: +# nested likely/unlikely calls +    if ($line =~ /\b(?:(?:un)?likely)\s*\(\s*!?\s*(IS_ERR(?:_OR_NULL|_VALUE)?|WARN)/) { +    WARN("LIKELY_MISUSE", >>> >>> How do you think about to use the specification >>>

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

2019-08-31 Thread Denis Efremov
On 31.08.2019 12:15, Markus Elfring wrote: >> +# nested likely/unlikely calls >> +    if ($line =~ >> /\b(?:(?:un)?likely)\s*\(\s*!?\s*(IS_ERR(?:_OR_NULL|_VALUE)?|WARN)/) { >> +    WARN("LIKELY_MISUSE", > > How do you think about to use the specification >

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

2019-08-29 Thread Denis Efremov
IS_ERR(), IS_ERR_OR_NULL(), IS_ERR_VALUE() and WARN*() already contain unlikely() optimization internally. Thus, there is no point in calling these functions and defines under likely()/unlikely(). This check is based on the coccinelle rule developed by Enrico Weigelt