[Qemu-devel] [PATCH] checkpatch: detect doubly-encoded UTF-8

2019-05-17 Thread Paolo Bonzini
Copy and pasting from Thunderbird's "view source" window results in double encoding of multibyte UTF-8 sequences. The appearance of those sequences is very peculiar, so detect it and give an error despite the (low) possibility of false positives. As the major offender, I am also adding the same c

[Qemu-devel] [PATCH] checkpatch: allow SPDX-License-Identifier

2019-04-25 Thread Peter Xu
According to: https://spdx.org/ids-how, let's still allow QEMU to use the SPDX license identifier: // SPDX-License-Identifier: *** CC: Paolo Bonzini Signed-off-by: Peter Xu --- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/s

Re: [Qemu-devel] [PATCH] checkpatch: Flag suspicious attribution lines

2019-02-04 Thread Eric Blake
On 2/4/19 3:56 PM, Eric Blake wrote: > Flag commit attribution tags that are unusual (often because they > were a typo), but only as a warning (because sometimes a humorous > or otherwise useful tag is intentionally supplied). > > This picks the 6-most popular tags, each with 700 or more uses (wel

[Qemu-devel] [PATCH] checkpatch: Flag suspicious attribution lines

2019-02-04 Thread Eric Blake
Flag commit attribution tags that are unusual (often because they were a typo), but only as a warning (because sometimes a humorous or otherwise useful tag is intentionally supplied). This picks the 6-most popular tags, each with 700 or more uses (well, S-o-b was already checked for case-sensitivi

Re: [Qemu-devel] [PATCH] checkpatch: Don't spuriously warn about /** comment starters

2019-01-18 Thread Peter Maydell
On Fri, 18 Jan 2019 at 16:26, Eric Blake wrote: > > On 1/18/19 10:08 AM, Peter Maydell wrote: > > >>> The sequence "/\*\*?" was intended to match either "/*" or "/**", > >>> but Perl's semantics for '?' allow it to backtrack and try the > >>> "matches 0 chars" option if the "matches 1 char" choice

Re: [Qemu-devel] [PATCH] checkpatch: Don't spuriously warn about /** comment starters

2019-01-18 Thread Eric Blake
On 1/18/19 10:08 AM, Peter Maydell wrote: >>> The sequence "/\*\*?" was intended to match either "/*" or "/**", >>> but Perl's semantics for '?' allow it to backtrack and try the >>> "matches 0 chars" option if the "matches 1 char" choice leads to >>> a failure of the rest of the regex to match.

Re: [Qemu-devel] [PATCH] checkpatch: Don't spuriously warn about /** comment starters

2019-01-18 Thread Peter Maydell
On Fri, 18 Jan 2019 at 15:53, Eric Blake wrote: > > On 1/18/19 7:27 AM, Peter Maydell wrote: > > In checkpatch we attempt to check for and warn about > > block comments which start with /* or /** followed by a > > non-blank. Unfortunately a bug in the regex meant that > > we would incorrectly warn

Re: [Qemu-devel] [PATCH] checkpatch: Don't spuriously warn about /** comment starters

2019-01-18 Thread Eric Blake
On 1/18/19 7:27 AM, Peter Maydell wrote: > In checkpatch we attempt to check for and warn about > block comments which start with /* or /** followed by a > non-blank. Unfortunately a bug in the regex meant that > we would incorrectly warn about comments starting with > "/**" with no following text:

[Qemu-devel] [PATCH] checkpatch: Don't spuriously warn about /** comment starters

2019-01-18 Thread Peter Maydell
In checkpatch we attempt to check for and warn about block comments which start with /* or /** followed by a non-blank. Unfortunately a bug in the regex meant that we would incorrectly warn about comments starting with "/**" with no following text: git show 9813dc6ac3954d58ba16b3920556f106f97e1c

Re: [Qemu-devel] [PATCH] checkpatch: g_test_message does not need a a trailing newline

2018-11-22 Thread Paolo Bonzini
On 21/11/18 19:38, Philippe Mathieu-Daudé wrote: > > > On 21/11/18 19:27, Paolo Bonzini wrote: >> Signed-off-by: Paolo Bonzini >> --- >>   scripts/checkpatch.pl | 3 ++- >>   1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl >> index e

Re: [Qemu-devel] [PATCH] checkpatch: g_test_message does not need a a trailing newline

2018-11-22 Thread Thomas Huth
On 2018-11-21 19:38, Philippe Mathieu-Daudé wrote: > > > On 21/11/18 19:27, Paolo Bonzini wrote: >> Signed-off-by: Paolo Bonzini >> --- >>   scripts/checkpatch.pl | 3 ++- >>   1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl >> index

Re: [Qemu-devel] [PATCH] checkpatch: g_test_message does not need a a trailing newline

2018-11-21 Thread Philippe Mathieu-Daudé
On 21/11/18 19:27, Paolo Bonzini wrote: Signed-off-by: Paolo Bonzini --- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index eccd656c41..d27bc51f8c 100755 --- a/scripts/checkpatch.pl +++ b/scripts/c

[Qemu-devel] [PATCH] checkpatch: g_test_message does not need a a trailing newline

2018-11-21 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index eccd656c41..d27bc51f8c 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2802,7 +2802,8 @@ sub process

[Qemu-devel] [PATCH] checkpatch: handle token pasting better

2018-07-04 Thread Paolo Bonzini
The mechanism to find possible type tokens can sometimes be confused and go into an infinite loop. This happens for example in QEMU for a line that looks like uint## BITS ##_t S = _S, T = _T;\ uint## BITS ##_t as, at, xs, xt, xd;

Re: [Qemu-devel] [PATCH] checkpatch: warn about missing MAINTAINERS file changes

2018-04-18 Thread Thomas Huth
On 19.04.2018 04:06, Fam Zheng wrote: > On Mon, 04/16 16:09, Markus Armbruster wrote: >> Thomas Huth writes: >> >>> On 12.03.2018 14:18, Stefan Hajnoczi wrote: Warn if files are added/renamed/deleted without MAINTAINERS file changes. This has helped me in Linux and we could benefit from

Re: [Qemu-devel] [PATCH] checkpatch: warn about missing MAINTAINERS file changes

2018-04-18 Thread Fam Zheng
On Mon, 04/16 16:09, Markus Armbruster wrote: > Thomas Huth writes: > > > On 12.03.2018 14:18, Stefan Hajnoczi wrote: > >> Warn if files are added/renamed/deleted without MAINTAINERS file > >> changes. This has helped me in Linux and we could benefit from this > >> check in QEMU. > >> > >> This

Re: [Qemu-devel] [PATCH] checkpatch: warn about missing MAINTAINERS file changes

2018-04-16 Thread Markus Armbruster
Peter Maydell writes: > On 16 April 2018 at 15:11, Markus Armbruster wrote: >> Peter Maydell writes: >> >>> On 12 March 2018 at 13:18, Stefan Hajnoczi wrote: Warn if files are added/renamed/deleted without MAINTAINERS file changes. This has helped me in Linux and we could benefit fr

Re: [Qemu-devel] [PATCH] checkpatch: warn about missing MAINTAINERS file changes

2018-04-16 Thread Peter Maydell
On 16 April 2018 at 15:11, Markus Armbruster wrote: > Peter Maydell writes: > >> On 12 March 2018 at 13:18, Stefan Hajnoczi wrote: >>> Warn if files are added/renamed/deleted without MAINTAINERS file >>> changes. This has helped me in Linux and we could benefit from this >>> check in QEMU. >>>

Re: [Qemu-devel] [PATCH] checkpatch: warn about missing MAINTAINERS file changes

2018-04-16 Thread Markus Armbruster
Peter Maydell writes: > On 12 March 2018 at 13:18, Stefan Hajnoczi wrote: >> Warn if files are added/renamed/deleted without MAINTAINERS file >> changes. This has helped me in Linux and we could benefit from this >> check in QEMU. >> >> This patch is a manual cherry-pick of Linux commit >> 13f1

Re: [Qemu-devel] [PATCH] checkpatch: warn about missing MAINTAINERS file changes

2018-04-16 Thread Markus Armbruster
Thomas Huth writes: > On 12.03.2018 14:18, Stefan Hajnoczi wrote: >> Warn if files are added/renamed/deleted without MAINTAINERS file >> changes. This has helped me in Linux and we could benefit from this >> check in QEMU. >> >> This patch is a manual cherry-pick of Linux commit >> 13f1937ef339

Re: [Qemu-devel] [PATCH] checkpatch: warn about missing MAINTAINERS file changes

2018-03-15 Thread Stefan Hajnoczi
On Tue, Mar 13, 2018 at 11:49:57AM +0100, Thomas Huth wrote: > On 13.03.2018 11:37, Stefan Hajnoczi wrote: > > On Mon, Mar 12, 2018 at 02:46:20PM +0100, Thomas Huth wrote: > >> On 12.03.2018 14:18, Stefan Hajnoczi wrote: > >>> Warn if files are added/renamed/deleted without MAINTAINERS file > >>> c

Re: [Qemu-devel] [PATCH] checkpatch: warn about missing MAINTAINERS file changes

2018-03-13 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20180312131806.23209-1-stefa...@redhat.com Subject: [Qemu-devel] [PATCH] checkpatch: warn about missing MAINTAINERS file changes === TEST SCRIPT BEGIN === #!/bin/bash BASE

Re: [Qemu-devel] [PATCH] checkpatch: warn about missing MAINTAINERS file changes

2018-03-13 Thread Thomas Huth
On 13.03.2018 11:37, Stefan Hajnoczi wrote: > On Mon, Mar 12, 2018 at 02:46:20PM +0100, Thomas Huth wrote: >> On 12.03.2018 14:18, Stefan Hajnoczi wrote: >>> Warn if files are added/renamed/deleted without MAINTAINERS file >>> changes. This has helped me in Linux and we could benefit from this >>>

Re: [Qemu-devel] [PATCH] checkpatch: warn about missing MAINTAINERS file changes

2018-03-13 Thread Stefan Hajnoczi
On Mon, Mar 12, 2018 at 02:46:20PM +0100, Thomas Huth wrote: > On 12.03.2018 14:18, Stefan Hajnoczi wrote: > > Warn if files are added/renamed/deleted without MAINTAINERS file > > changes. This has helped me in Linux and we could benefit from this > > check in QEMU. > > > > This patch is a manual

Re: [Qemu-devel] [PATCH] checkpatch: warn about missing MAINTAINERS file changes

2018-03-12 Thread Thomas Huth
On 12.03.2018 14:18, Stefan Hajnoczi wrote: > Warn if files are added/renamed/deleted without MAINTAINERS file > changes. This has helped me in Linux and we could benefit from this > check in QEMU. > > This patch is a manual cherry-pick of Linux commit > 13f1937ef33950b1112049972249e6191b82e6c9 (

Re: [Qemu-devel] [PATCH] checkpatch: warn about missing MAINTAINERS file changes

2018-03-12 Thread Marc-André Lureau
On Mon, Mar 12, 2018 at 2:18 PM, Stefan Hajnoczi wrote: > Warn if files are added/renamed/deleted without MAINTAINERS file > changes. This has helped me in Linux and we could benefit from this > check in QEMU. > > This patch is a manual cherry-pick of Linux commit > 13f1937ef33950b1112049972249e6

Re: [Qemu-devel] [PATCH] checkpatch: warn about missing MAINTAINERS file changes

2018-03-12 Thread Peter Maydell
On 12 March 2018 at 13:18, Stefan Hajnoczi wrote: > Warn if files are added/renamed/deleted without MAINTAINERS file > changes. This has helped me in Linux and we could benefit from this > check in QEMU. > > This patch is a manual cherry-pick of Linux commit > 13f1937ef33950b1112049972249e6191b82

[Qemu-devel] [PATCH] checkpatch: warn about missing MAINTAINERS file changes

2018-03-12 Thread Stefan Hajnoczi
Warn if files are added/renamed/deleted without MAINTAINERS file changes. This has helped me in Linux and we could benefit from this check in QEMU. This patch is a manual cherry-pick of Linux commit 13f1937ef33950b1112049972249e6191b82e6c9 ("checkpatch: emit a warning on file add/move/delete") by

Re: [Qemu-devel] [PATCH] checkpatch: Exempt long URLs

2018-03-07 Thread Paolo Bonzini
On 22/02/2018 22:58, Eric Blake wrote: > Sometimes, we want to refer to really long URLs, but checkpatch > balks, and we have to manually bypass the check. URL shorterners > may be nice at reducing long links, but it's hard to guarantee the > shortened link will live as long as the real target, an

Re: [Qemu-devel] [PATCH] checkpatch: Exempt long URLs

2018-03-06 Thread Stefan Hajnoczi
On Thu, Feb 22, 2018 at 03:58:38PM -0600, Eric Blake wrote: > Sometimes, we want to refer to really long URLs, but checkpatch > balks, and we have to manually bypass the check. URL shorterners > may be nice at reducing long links, but it's hard to guarantee the > shortened link will live as long a

Re: [Qemu-devel] [PATCH] checkpatch: add a warning for basename/dirname

2018-03-02 Thread Julia Suvorova via Qemu-devel
On 02.03.2018 11:56, Paolo Bonzini wrote: > On 02/03/2018 09:22, Julia Suvorova wrote: >> Signed-off-by: Julia Suvorova >> --- >> scripts/checkpatch.pl | 5 + >> 1 file changed, 5 insertions(+) >> >> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl >> index 1b4b812..6c4fb42 100755

Re: [Qemu-devel] [PATCH] checkpatch: add a warning for basename/dirname

2018-03-02 Thread Paolo Bonzini
On 02/03/2018 09:22, Julia Suvorova wrote: > Signed-off-by: Julia Suvorova > --- > scripts/checkpatch.pl | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index 1b4b812..6c4fb42 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/check

Re: [Qemu-devel] [PATCH] checkpatch: add a warning for basename/dirname

2018-03-02 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 1519978965-16865-1-git-send-email-jus...@mail.ru Subject: [Qemu-devel] [PATCH] checkpatch: add a warning for basename/dirname === TEST SCRIPT BEGIN === #!/bin/bash BASE

[Qemu-devel] [PATCH] checkpatch: add a warning for basename/dirname

2018-03-02 Thread Julia Suvorova via Qemu-devel
Signed-off-by: Julia Suvorova --- scripts/checkpatch.pl | 5 + 1 file changed, 5 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 1b4b812..6c4fb42 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2584,6 +2584,11 @@ sub process {

Re: [Qemu-devel] [PATCH] checkpatch: Exempt long URLs

2018-02-22 Thread Eric Blake
On 02/22/2018 03:58 PM, Eric Blake wrote: Sometimes, we want to refer to really long URLs, but checkpatch balks, and we have to manually bypass the check. URL shorterners s/shorterners/shorteners/ (Is it bad when I spell-check my own patches?) may be nice at reducing long links, but it's ha

[Qemu-devel] [PATCH] checkpatch: Exempt long URLs

2018-02-22 Thread Eric Blake
Sometimes, we want to refer to really long URLs, but checkpatch balks, and we have to manually bypass the check. URL shorterners may be nice at reducing long links, but it's hard to guarantee the shortened link will live as long as the real target, and it is also nice to see the original target wi

Re: [Qemu-devel] [PATCH] checkpatch: warn when using volatile with a comment

2017-12-18 Thread Darren Kenny
Nevermind, saw that updated comment in the later patch... Thanks, Darren. On Mon, Dec 18, 2017 at 01:36:52PM +, Darren Kenny wrote: Hi Paolo, Slight nit on the subject line, did you mean to s/with/without/ - that seems to reflect the change in the patch more correctly. Thanks, Darren.

Re: [Qemu-devel] [PATCH] checkpatch: warn when using volatile with a comment

2017-12-18 Thread Darren Kenny
Hi Paolo, Slight nit on the subject line, did you mean to s/with/without/ - that seems to reflect the change in the patch more correctly. Thanks, Darren. On Mon, Dec 18, 2017 at 01:49:52PM +0100, Paolo Bonzini wrote: On 15/12/2017 19:18, Marc-André Lureau wrote: Instead of an error, lower to

Re: [Qemu-devel] [PATCH] checkpatch: warn when using volatile with a comment

2017-12-18 Thread Paolo Bonzini
On 18/12/2017 13:54, Marc-André Lureau wrote: > Hi > > On Mon, Dec 18, 2017 at 1:49 PM, Paolo Bonzini wrote: >> On 15/12/2017 19:18, Marc-André Lureau wrote: >>> Instead of an error, lower to a warning message, assuming the comment >>> gives some justification. >>> >>> Discussed in: >>> '[Qemu-de

Re: [Qemu-devel] [PATCH] checkpatch: warn when using volatile with a comment

2017-12-18 Thread Marc-André Lureau
Hi On Mon, Dec 18, 2017 at 1:49 PM, Paolo Bonzini wrote: > On 15/12/2017 19:18, Marc-André Lureau wrote: >> Instead of an error, lower to a warning message, assuming the comment >> gives some justification. >> >> Discussed in: >> '[Qemu-devel] [PATCH] dump-guest-memory.py: fix "You can't do that

Re: [Qemu-devel] [PATCH] checkpatch: warn when using volatile with a comment

2017-12-18 Thread Paolo Bonzini
On 15/12/2017 19:18, Marc-André Lureau wrote: > Instead of an error, lower to a warning message, assuming the comment > gives some justification. > > Discussed in: > '[Qemu-devel] [PATCH] dump-guest-memory.py: fix "You can't do that without a > process to debug"' > > Suggested-by: Fam Zheng > S

Re: [Qemu-devel] [PATCH] checkpatch: warn when using volatile with a comment

2017-12-15 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20171215181810.4122-1-marcandre.lur...@redhat.com Subject: [Qemu-devel] [PATCH] checkpatch: warn when using volatile with a comment === TEST SCRIPT BEGIN === #!/bin/bash

[Qemu-devel] [PATCH] checkpatch: warn when using volatile with a comment

2017-12-15 Thread Marc-André Lureau
Instead of an error, lower to a warning message, assuming the comment gives some justification. Discussed in: '[Qemu-devel] [PATCH] dump-guest-memory.py: fix "You can't do that without a process to debug"' Suggested-by: Fam Zheng Signed-off-by: Marc-André Lureau --- scripts/checkpatch.pl | 7

Re: [Qemu-devel] [PATCH] checkpatch: replace ERROR with WARN for extern checking.

2017-11-05 Thread Markus Armbruster
Peter Maydell writes: > On 11 October 2017 at 05:33, Jiang Biao wrote: >> There are some rare cases which need external declarations in .c >> files. patchew.org and checkpatch.pl will complain errors on >> patches for these declarations. >> >> Degrade ERROR to WARN to erase the error complaints

Re: [Qemu-devel] [PATCH] checkpatch: replace ERROR with WARN forextern checking.

2017-10-16 Thread jiang.biao2
> On 11 October 2017 at 05:33, Jiang Biao wrote: > > I'd rather not drop this to a warning for the sake of a single > use case that's already in the tree (and which if you really > cared about you could work around by putting the link_error() > declaration in a header file I suppose, though I wou

Re: [Qemu-devel] [PATCH] checkpatch: replace ERROR with WARN for extern checking.

2017-10-11 Thread Peter Maydell
On 11 October 2017 at 05:33, Jiang Biao wrote: > There are some rare cases which need external declarations in .c > files. patchew.org and checkpatch.pl will complain errors on > patches for these declarations. > > Degrade ERROR to WARN to erase the error complaints taking > checkpatch.pl in kerne

[Qemu-devel] [PATCH] checkpatch: ignore perl files.

2017-10-11 Thread Jiang Biao
Most coding styles are not suit for perl files. If we check scripts/checkpatch.pl with itself, there would be tons of complaints. And if we make patches for checkpatch.pl, patchew.org and checkpatch.pl would complain errors for the patches. Ignore perl files taking Linux kernel version as referenc

Re: [Qemu-devel] [PATCH] checkpatch: replace ERROR with WARN for extern checking.

2017-10-10 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 1507696406-11168-1-git-send-email-jiang.bi...@zte.com.cn Subject: [Qemu-devel] [PATCH] checkpatch: replace ERROR with WARN for extern checking. === TEST SCRIPT BEGIN

[Qemu-devel] [PATCH] checkpatch: replace ERROR with WARN for extern checking.

2017-10-10 Thread Jiang Biao
There are some rare cases which need external declarations in .c files. patchew.org and checkpatch.pl will complain errors on patches for these declarations. Degrade ERROR to WARN to erase the error complaints taking checkpatch.pl in kernel as reference. Signed-off-by: Jiang Biao --- scripts/ch

Re: [Qemu-devel] [PATCH] checkpatch: fix incompatibility with old perl

2017-10-05 Thread Stefan Hajnoczi
On Wed, Oct 04, 2017 at 06:44:20PM +0300, Vladimir Sementsov-Ogievskiy wrote: > Do not use '/r' modifier which was introduced in perl 5.14. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > scripts/checkpatch.pl | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Thanks, applied to

Re: [Qemu-devel] [PATCH] checkpatch: fix incompatibility with old perl

2017-10-04 Thread Daniel P. Berrange
On Wed, Oct 04, 2017 at 06:44:20PM +0300, Vladimir Sementsov-Ogievskiy wrote: > Do not use '/r' modifier which was introduced in perl 5.14. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > scripts/checkpatch.pl | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Daniel

Re: [Qemu-devel] [PATCH] checkpatch: fix incompatibility with old perl

2017-10-04 Thread Alex Williamson
On Wed, 4 Oct 2017 18:44:20 +0300 Vladimir Sementsov-Ogievskiy wrote: > Do not use '/r' modifier which was introduced in perl 5.14. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- Fixes: 3e5875afc0f ("checkpatch: check trace-events code style") Tested-by: Alex Williamson Thanks > sc

[Qemu-devel] [PATCH] checkpatch: fix incompatibility with old perl

2017-10-04 Thread Vladimir Sementsov-Ogievskiy
Do not use '/r' modifier which was introduced in perl 5.14. Signed-off-by: Vladimir Sementsov-Ogievskiy --- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 3c0a28e644..0c41f1212f 100755 --- a/scripts/

Re: [Qemu-devel] [PATCH] checkpatch: add hwaddr to @typeList

2017-09-15 Thread Paolo Bonzini
On 14/09/2017 11:12, Greg Kurz wrote: > The script doesn't know about all possible types and learn them as > it parses the code. If it reaches a line with a type cast but the > type isn't known yet, it is misinterpreted as an identifier. > > For example the following line: > > foo = (hwaddr)

[Qemu-devel] [PATCH] checkpatch: add hwaddr to @typeList

2017-09-14 Thread Greg Kurz
The script doesn't know about all possible types and learn them as it parses the code. If it reaches a line with a type cast but the type isn't known yet, it is misinterpreted as an identifier. For example the following line: foo = (hwaddr) -1; results in the following false-positive to be r

Re: [Qemu-devel] [PATCH] checkpatch: Error if signal(2) is used non-portably.

2017-07-04 Thread Richard W.M. Jones
Ignore this, Paolo also sent a similar patch after we were discussing this on IRC. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://li

Re: [Qemu-devel] [PATCH] checkpatch: should not use signal except for SIG_DFL or SIG_IGN

2017-07-04 Thread Richard W.M. Jones
On Tue, Jul 04, 2017 at 11:27:04AM +0200, Paolo Bonzini wrote: > Using signal to establish a signal handler is not portable; on > SysV systems, the signal handler would be reset to SIG_DFL after > delivery, while BSD preserves the signal handler. Daniel Berrange > reported that (to complicate matt

[Qemu-devel] [PATCH] checkpatch: Error if signal(2) is used non-portably.

2017-07-04 Thread Richard W.M. Jones
The only portable use for signal(2) is setting a signal to SIG_IGN or SIG_DFL. Everything else is a portability minefield. This change adds such a check to checkpatch. It gives an error like this: ERROR: Use sigaction instead of signal, except when setting the handler to SIG_IGN or SIG_DFL

Re: [Qemu-devel] [PATCH] checkpatch: should not use signal except for SIG_DFL or SIG_IGN

2017-07-04 Thread Daniel P. Berrange
On Tue, Jul 04, 2017 at 11:27:04AM +0200, Paolo Bonzini wrote: > Using signal to establish a signal handler is not portable; on > SysV systems, the signal handler would be reset to SIG_DFL after > delivery, while BSD preserves the signal handler. Daniel Berrange > reported that (to complicate matt

[Qemu-devel] [PATCH] checkpatch: should not use signal except for SIG_DFL or SIG_IGN

2017-07-04 Thread Paolo Bonzini
Using signal to establish a signal handler is not portable; on SysV systems, the signal handler would be reset to SIG_DFL after delivery, while BSD preserves the signal handler. Daniel Berrange reported that (to complicate matters further) the signal system call has SysV behavior, but glibc signal

Re: [Qemu-devel] [PATCH] checkpatch: Disallow glib asserts in main code

2017-04-28 Thread Eric Blake
On 04/28/2017 10:10 AM, Daniel P. Berrange wrote: >>> Or could we perhaps instead undo the damage via a hack like >>> >>> #define g_assert_cmpint g_assert_cmpint_orig >>> #define g_assert_cmpint(x, y, z) \ >>> g_assert_cmpint_orig(x, y,x); \ >>> abort() Not quite the right hack (we do

Re: [Qemu-devel] [PATCH] checkpatch: Disallow glib asserts in main code

2017-04-28 Thread Daniel P. Berrange
On Fri, Apr 28, 2017 at 02:45:32PM +0100, Dr. David Alan Gilbert wrote: > * Daniel P. Berrange (berra...@redhat.com) wrote: > > On Thu, Apr 27, 2017 at 05:55:26PM +0100, Dr. David Alan Gilbert (git) > > wrote: > > > From: "Dr. David Alan Gilbert" > > > > > > Glib commit a6a875068779 (from 2013)

Re: [Qemu-devel] [PATCH] checkpatch: Disallow glib asserts in main code

2017-04-28 Thread Eric Blake
On 04/28/2017 08:34 AM, Markus Armbruster wrote: >> >> Ban most of the glib assertion functions (basically everything except >> g_assert and g_assert_not_reached) except in tests/ You'll also want to exclude scripts/ and possible include/glib-compat.h... > If these are screwy enough to warrant

Re: [Qemu-devel] [PATCH] checkpatch: Disallow glib asserts in main code

2017-04-28 Thread Peter Maydell
On 28 April 2017 at 14:34, Markus Armbruster wrote: > If these are screwy enough to warrant rejecting them in new code, > they're probably screwy enough to purge them from existing code: > > include/glib-compat.h:#ifndef g_assert_true > include/glib-compat.h:#define g_assert_true(expr) T

Re: [Qemu-devel] [PATCH] checkpatch: Disallow glib asserts in main code

2017-04-28 Thread Dr. David Alan Gilbert
* Daniel P. Berrange (berra...@redhat.com) wrote: > On Thu, Apr 27, 2017 at 05:55:26PM +0100, Dr. David Alan Gilbert (git) wrote: > > From: "Dr. David Alan Gilbert" > > > > Glib commit a6a875068779 (from 2013) made many of the glib assert > > macros non-fatal if a flag is set. > > This causes two

Re: [Qemu-devel] [PATCH] checkpatch: Disallow glib asserts in main code

2017-04-28 Thread Daniel P. Berrange
On Thu, Apr 27, 2017 at 05:55:26PM +0100, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > Glib commit a6a875068779 (from 2013) made many of the glib assert > macros non-fatal if a flag is set. > This causes two problems: > a) Compilers moan that your code is unsafe even

Re: [Qemu-devel] [PATCH] checkpatch: Disallow glib asserts in main code

2017-04-28 Thread Markus Armbruster
"Dr. David Alan Gilbert (git)" writes: > From: "Dr. David Alan Gilbert" > > Glib commit a6a875068779 (from 2013) made many of the glib assert > macros non-fatal if a flag is set. > This causes two problems: > a) Compilers moan that your code is unsafe even though you've > put an assert in

Re: [Qemu-devel] [PATCH] checkpatch: Disallow glib asserts in main code

2017-04-28 Thread Paolo Bonzini
- Original Message - > From: "Dr. David Alan Gilbert (git)" > To: qemu-devel@nongnu.org, pbonz...@redhat.com, arm...@redhat.com > Sent: Thursday, April 27, 2017 6:55:26 PM > Subject: [Qemu-devel] [PATCH] checkpatch: Disallow glib asserts in main code > > F

[Qemu-devel] [PATCH] checkpatch: Disallow glib asserts in main code

2017-04-27 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Glib commit a6a875068779 (from 2013) made many of the glib assert macros non-fatal if a flag is set. This causes two problems: a) Compilers moan that your code is unsafe even though you've put an assert in before the point of use. b) Someone evil could, in

Re: [Qemu-devel] [PATCH] checkpatch: Supress warning in function pointer typedefs

2017-03-21 Thread Vinzenz Feenstra
> On Mar 21, 2017, at 1:37 PM, Peter Maydell wrote: > > On 16 March 2017 at 11:14, Vinzenz 'evilissimo' Feenstra > wrote: >> From: Vinzenz Feenstra >> >> When importing dynamically functions via `GetProcAddress` in windows >> related code, it is quite common to make a typedef for the resultin

Re: [Qemu-devel] [PATCH] checkpatch: Supress warning in function pointer typedefs

2017-03-21 Thread Peter Maydell
On 16 March 2017 at 11:14, Vinzenz 'evilissimo' Feenstra wrote: > From: Vinzenz Feenstra > > When importing dynamically functions via `GetProcAddress` in windows > related code, it is quite common to make a typedef for the resulting > function pointer. When the function to be imported, has a stdc

[Qemu-devel] [PATCH] checkpatch: Supress warning in function pointer typedefs

2017-03-21 Thread Vinzenz 'evilissimo' Feenstra
From: Vinzenz Feenstra When importing dynamically functions via `GetProcAddress` in windows related code, it is quite common to make a typedef for the resulting function pointer. When the function to be imported, has a stdcall calling convention, usually the `WINAPI` macro is used. This patch add

Re: [Qemu-devel] [PATCH] checkpatch: allow longer lines for logging functions

2017-03-17 Thread Greg Kurz
On Fri, 17 Mar 2017 03:45:56 -0700 (PDT) no-re...@patchew.org wrote: > Hi, > > This series seems to have some coding style problems. See output below for > more information: > > Message-id: 148974701986.29545.5414999102981738774.stgit@bahia > Subject: [Qemu-devel] [PAT

Re: [Qemu-devel] [PATCH] checkpatch: allow longer lines for logging functions

2017-03-17 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 148974701986.29545.5414999102981738774.stgit@bahia Subject: [Qemu-devel] [PATCH] checkpatch: allow longer lines for logging functions Type: series === TEST SCRIPT BEGIN === #!/bin/bash

[Qemu-devel] [PATCH] checkpatch: allow longer lines for logging functions

2017-03-17 Thread Greg Kurz
Commit f1e155bbf863a removed a bunch of stuff that really don't make sense outside the linux kernel. An exception though is logging functions: it is convenient to be able to grep error messages in the code. For this to work, error strings mustn't be broken down on multiple lines, and therefore are

Re: [Qemu-devel] [PATCH] checkpatch: downgrade "architecture specific defines should be avoided"

2016-09-22 Thread Markus Armbruster
Paolo Bonzini writes: > On 22/09/2016 09:12, Markus Armbruster wrote: >> Paolo Bonzini writes: >> >>> --- >>> scripts/checkpatch.pl | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl >>> index dde3f5f..3afa19a 100755 >>>

Re: [Qemu-devel] [PATCH] checkpatch: downgrade "architecture specific defines should be avoided"

2016-09-22 Thread Paolo Bonzini
On 22/09/2016 09:12, Markus Armbruster wrote: > Paolo Bonzini writes: > >> --- >> scripts/checkpatch.pl | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl >> index dde3f5f..3afa19a 100755 >> --- a/scripts/checkpatch.pl >> +

Re: [Qemu-devel] [PATCH] checkpatch: downgrade "architecture specific defines should be avoided"

2016-09-22 Thread Markus Armbruster
Paolo Bonzini writes: > --- > scripts/checkpatch.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index dde3f5f..3afa19a 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -2407,7 +2407,7 @@ sub proce

Re: [Qemu-devel] [PATCH] checkpatch: downgrade "architecture specific defines should be avoided"

2016-09-21 Thread no-reply
Hi, Your series seems to have some coding style problems. See output below for more information: Type: series Message-id: 1474476607-4990-1-git-send-email-pbonz...@redhat.com Subject: [Qemu-devel] [PATCH] checkpatch: downgrade "architecture specific defines should be avoided" === T

[Qemu-devel] [PATCH] checkpatch: downgrade "architecture specific defines should be avoided"

2016-09-21 Thread Paolo Bonzini
--- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index dde3f5f..3afa19a 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2407,7 +2407,7 @@ sub process { # we have e.g. CONFIG_LINUX and CON

Re: [Qemu-devel] [PATCH] checkpatch: Fix whitespace checks for documentation code blocks

2016-09-07 Thread Lluís Vilanova
Paolo Bonzini writes: > On 06/09/2016 12:30, Lluís Vilanova wrote: >> Prevent blank lines in documentation code blocks to be signalled as >> incorrect trailing whitespace. >> >> Code blocks in documentation are 4-column aligned, and blank lines in >> them should have exactly 4 columns of trailing

Re: [Qemu-devel] [PATCH] checkpatch: Fix whitespace checks for documentation code blocks

2016-09-06 Thread Paolo Bonzini
On 06/09/2016 12:30, Lluís Vilanova wrote: > Prevent blank lines in documentation code blocks to be signalled as > incorrect trailing whitespace. > > Code blocks in documentation are 4-column aligned, and blank lines in > them should have exactly 4 columns of trailing whitespace to prevent > QEM

[Qemu-devel] [PATCH] checkpatch: Fix whitespace checks for documentation code blocks

2016-09-06 Thread Lluís Vilanova
Prevent blank lines in documentation code blocks to be signalled as incorrect trailing whitespace. Code blocks in documentation are 4-column aligned, and blank lines in them should have exactly 4 columns of trailing whitespace to prevent QEMU's wiki to render them as separate code blocks. Signed-

Re: [Qemu-devel] [PATCH] checkpatch: allow tabs in linux-headers

2016-08-10 Thread Cornelia Huck
On Wed, 10 Aug 2016 15:55:28 +0200 Radim Krčmář wrote: > 2016-08-10 09:09+0200, Cornelia Huck: > > On Tue, 9 Aug 2016 12:14:14 -0400 (EDT) > > Paolo Bonzini wrote: > >> > Make scripts/checkpatch.pl accept tabs in linux-headers/, instead of > >> > changing scripts/update-linux-headers.sh to expan

Re: [Qemu-devel] [PATCH] checkpatch: ignore automatically imported Linux headers

2016-08-10 Thread Cornelia Huck
On Tue, 9 Aug 2016 19:38:41 +0200 Radim Krčmář wrote: > Linux uses tabs for indentation and checkpatch always complained about > automatically imported headers. update-linux-headers.sh could be modified to > expand tabs, but there is no real reason to complain about any ugly code in > Linux hea

Re: [Qemu-devel] [PATCH] checkpatch: allow tabs in linux-headers

2016-08-10 Thread Radim Krčmář
2016-08-10 09:09+0200, Cornelia Huck: > On Tue, 9 Aug 2016 12:14:14 -0400 (EDT) > Paolo Bonzini wrote: >> > Make scripts/checkpatch.pl accept tabs in linux-headers/, instead of >> > changing scripts/update-linux-headers.sh to expand tabs when importing. >> > >> > Signed-off-by: Radim Krčmář >> >

Re: [Qemu-devel] [PATCH] checkpatch: allow tabs in linux-headers

2016-08-10 Thread Cornelia Huck
On Tue, 9 Aug 2016 12:14:14 -0400 (EDT) Paolo Bonzini wrote: > > > - Original Message - > > From: "Radim Krčmář" > > To: no-re...@ec2-52-6-146-230.compute-1.amazonaws.com > > Cc: f...@redhat.com, ehabk...@redhat.com, m...@redhat.com, > > qemu-devel@nongnu.org, pet...@redhat.com, "jan

Re: [Qemu-devel] [PATCH] checkpatch: ignore automatically imported Linux headers

2016-08-09 Thread Paolo Bonzini
On 09/08/2016 19:38, Radim Krčmář wrote: > Linux uses tabs for indentation and checkpatch always complained about > automatically imported headers. update-linux-headers.sh could be modified to > expand tabs, but there is no real reason to complain about any ugly code in > Linux headers, so skip

Re: [Qemu-devel] [PATCH] checkpatch: ignore automatically imported Linux headers

2016-08-09 Thread no-reply
Hi, Your series seems to have some coding style problems. See output below for more information: Message-id: 20160809173841.716-1-rkrc...@redhat.com Type: series Subject: [Qemu-devel] [PATCH] checkpatch: ignore automatically imported Linux headers === TEST SCRIPT BEGIN === #!/bin/bash BASE

[Qemu-devel] [PATCH] checkpatch: ignore automatically imported Linux headers

2016-08-09 Thread Radim Krčmář
Linux uses tabs for indentation and checkpatch always complained about automatically imported headers. update-linux-headers.sh could be modified to expand tabs, but there is no real reason to complain about any ugly code in Linux headers, so skip all hunk-related checks. Signed-off-by: Radim Krčm

Re: [Qemu-devel] [PATCH] checkpatch: allow tabs in linux-headers

2016-08-09 Thread Radim Krčmář
2016-08-09 18:39+0200, Paolo Bonzini: > On 09/08/2016 18:37, Radim Krčmář wrote: Make scripts/checkpatch.pl accept tabs in linux-headers/, instead of changing scripts/update-linux-headers.sh to expand tabs when importing. Signed-off-by: Radim Krčmář --- diff --git a/s

Re: [Qemu-devel] [PATCH] checkpatch: allow tabs in linux-headers

2016-08-09 Thread Radim Krčmář
>> Make scripts/checkpatch.pl accept tabs in linux-headers/, instead of >> changing scripts/update-linux-headers.sh to expand tabs when importing. >> >> Signed-off-by: Radim Krčmář >> --- >> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl >> index 929708721299..38232d4b25c3 100755 >> -

Re: [Qemu-devel] [PATCH] checkpatch: allow tabs in linux-headers

2016-08-09 Thread no-reply
Hi, Your series seems to have some coding style problems. See output below for more information: Message-id: 20160809160703.GA10637@potion Type: series Subject: [Qemu-devel] [PATCH] checkpatch: allow tabs in linux-headers === TEST SCRIPT BEGIN === #!/bin/bash BASE=base n=1 total=$(git log

[Qemu-devel] [PATCH] checkpatch: allow tabs in linux-headers

2016-08-09 Thread Radim Krčmář
2016-08-09 08:31-0700, no-re...@ec2-52-6-146-230.compute-1.amazonaws.com: > Hi, > > Your series seems to have some coding style problems. See output below for > more information: > > Message-id: 20160809150333.9991-1-rkrc...@redhat.com > Type: series > Subject: [Qemu-devel] [PATCH for-2.7 0/2] in

Re: [Qemu-devel] [PATCH] checkpatch: allow tabs in linux-headers

2016-08-09 Thread Paolo Bonzini
On 09/08/2016 18:37, Radim Krčmář wrote: >>> Make scripts/checkpatch.pl accept tabs in linux-headers/, instead of >>> changing scripts/update-linux-headers.sh to expand tabs when importing. >>> >>> Signed-off-by: Radim Krčmář >>> --- >>> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl

Re: [Qemu-devel] [PATCH] checkpatch: allow tabs in linux-headers

2016-08-09 Thread Paolo Bonzini
- Original Message - > From: "Radim Krčmář" > To: no-re...@ec2-52-6-146-230.compute-1.amazonaws.com > Cc: f...@redhat.com, ehabk...@redhat.com, m...@redhat.com, > qemu-devel@nongnu.org, pet...@redhat.com, "jan kiszka" > , pbonz...@redhat.com, r...@twiddle.net > Sent: Tuesday, August 9,

Re: [Qemu-devel] [PATCH] checkpatch: fix break by renaming README

2016-07-21 Thread Peter Xu
On Thu, Jul 21, 2016 at 08:37:01AM -0600, Eric Blake wrote: > On 07/21/2016 04:15 AM, Peter Xu wrote: > > Without this, we cannot run checkpatch.pl under QEMU root directory. > > > > Signed-off-by: Peter Xu > > --- > > scripts/checkpatch.pl | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(

Re: [Qemu-devel] [PATCH] checkpatch: fix break by renaming README

2016-07-21 Thread Eric Blake
On 07/21/2016 04:15 AM, Peter Xu wrote: > Without this, we cannot run checkpatch.pl under QEMU root directory. > > Signed-off-by: Peter Xu > --- > scripts/checkpatch.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) NACK; see https://lists.gnu.org/archive/html/qemu-devel/2016-07/msg048

Re: [Qemu-devel] [PATCH] checkpatch: rename README to README.md

2016-07-21 Thread Eric Blake
On 07/20/2016 07:33 PM, Changlong Xie wrote: > Since commit e5dfc5e broke the logic of @top_of_kernel_tree > > Cc: Pranith Kumar > Cc: Paolo Bonzini > Cc: Stefan Hajnoczi > Signed-off-by: Changlong Xie > --- > scripts/checkpatch.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) NACK

[Qemu-devel] [PATCH] checkpatch: fix break by renaming README

2016-07-21 Thread Peter Xu
Without this, we cannot run checkpatch.pl under QEMU root directory. Signed-off-by: Peter Xu --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index afa7f79..8247305 100755 --- a/scripts/checkpatch.pl +++ b

  1   2   >