qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 RFC] scripts/checkpatch.pl: add check for `wh


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v2 RFC] scripts/checkpatch.pl: add check for `while` and `for`
Date: Tue, 27 Feb 2018 17:32:34 +0000
User-agent: Mutt/1.9.2 (2017-12-15)

On Mon, Feb 26, 2018 at 10:53:18AM +0800, Su Hang wrote:
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 1b4b812e28fa..10c138344fa9 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2353,7 +2353,8 @@ sub process {
>               }
>  
>  # check for missing bracing round if etc

Please fix the pre-existing typo in the comment:

s/round/around/

> -             if ($line =~ /(^.*)\bif\b/ && $line !~ /\#\s*if/) {
> +             if ($line =~ /(^.*)\b(for|while|if)\b/ &&
> +                     $line !~ /\#\s*(for|while|if)/) {

Please use (?:...) like most other cases in checkpatch.pl.  Perl
automatically assigns groups to $1, $2, etc with (...).  Using (?:...)
is preferred since it's faster and free of this side-effect.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]