[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4] scripts/checkpatch.pl: add check for `while`
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v4] scripts/checkpatch.pl: add check for `while` and `for` |
Date: |
Tue, 6 Mar 2018 17:00:11 +0000 |
User-agent: |
Mutt/1.9.2 (2017-12-15) |
On Tue, Mar 06, 2018 at 03:04:50PM +0800, Su Hang wrote:
> Adding check for `while` and `for` statements, which condition has more than
> one line.
>
> The former checkpatch.pl can check `if` statement, which condition has more
> than one line, whether block misses brace round, like this:
> '''
> if (cond1 ||
> cond2)
> statement;
> '''
> But it doesn't do the same check for `for` and `while` statements.
>
> Using `(?:...)` instead of `(...)` in regex pattern catch.
> Because `(?:...)` is faster and avoids unwanted side-effect.
>
> Suggested-by: Stefan Hajnoczi <address@hidden>
> Suggested-by: Eric Blake <address@hidden>
> Suggested-by: Thomas Huth <address@hidden>
> Signed-off-by: Su Hang <address@hidden>
> ---
> scripts/checkpatch.pl | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Thanks, applied to my block-next tree:
https://github.com/stefanha/qemu/commits/block-next
Stefan
signature.asc
Description: PGP signature