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

2018-02-28 Thread Stefan Hajnoczi
On Tue, Feb 27, 2018 at 05:42:50PM +, Peter Maydell wrote: > On 27 February 2018 at 17:32, Stefan Hajnoczi wrote: > > On Mon, Feb 26, 2018 at 10:53:18AM +0800, Su Hang wrote: > >> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > >> index

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

2018-02-27 Thread Peter Maydell
On 27 February 2018 at 17:32, Stefan Hajnoczi wrote: > 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 >> +++

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

2018-02-27 Thread Stefan Hajnoczi
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

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

2018-02-25 Thread Su Hang
Add 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