From: Paolo Bonzini <pbonzini@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: peter.maydell@linaro.org, famz@redhat.com, mst@redhat.com,
somlo@cmu.edu, qemu-devel@nongnu.org,
Markus Armbruster <armbru@redhat.com>,
michael@walle.cc, qemu-arm@nongnu.org, kraxel@redhat.com,
zhaoshenglong@huawei.com, imammedo@redhat.com, lersek@redhat.com
Subject: Re: [Qemu-arm] checkpatch.pl false positive (was Re: [PATCH v4 0/7] q35: add negotiable broadcast SMI)
Date: Wed, 21 Dec 2016 19:08:29 +0100 [thread overview]
Message-ID: <e45bb195-578f-6afc-8617-f75e7775193e@redhat.com> (raw)
In-Reply-To: <20161221180155.GI3808@thinpad.lan.raisama.net>
On 21/12/2016 19:01, Eduardo Habkost wrote:
> The following code replaces the whole "{ .driver = ... }" block
> with "1":
>
> # Flatten any parentheses and braces
> while ($dstat =~ s/\([^\(\)]*\)/1/ ||
> $dstat =~ s/\{[^\{\}]*\}/1/ ||
> $dstat =~ s/\[[^\{\}]*\]/1/)
> {
> }
Maybe change it like
- $dstat =~ s/\{[^\{\}]*\}/1/ ||
+ $dstat =~ s/\{[^\{\}]*;[^\{\}]*\}/1;/ ||
so that it requires a statement? It would have a false positive on
strings containing a semicolon, but that's not a big deal (or could be
fixed by similarly turning strings into just "").
Paolo
> The following change fixes the bug, but I don't know if it has
> unwanted side-effects:
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index f084542..0aab3ac 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2200,6 +2200,10 @@ sub process {
> $dstat =~ s/^\s*//s;
> $dstat =~ s/\s*$//s;
>
> + # remove braces that cover the whole block, if any:
> + $dstat =~ s/^\{//;
> + $dstat =~ s/\}$//;
> +
> # Flatten any parentheses and braces
> while ($dstat =~ s/\([^\(\)]*\)/1/ ||
> $dstat =~ s/\{[^\{\}]*\}/1/ ||
Paolo
next prev parent reply other threads:[~2016-12-21 18:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-01 17:06 [Qemu-arm] [PATCH v4 0/7] q35: add negotiable broadcast SMI Laszlo Ersek
2016-12-01 17:06 ` [Qemu-arm] [PATCH v4 1/7] fw-cfg: support writeable blobs Laszlo Ersek
2016-12-20 15:58 ` [Qemu-arm] [Qemu-devel] " Marcel Apfelbaum
2017-01-10 13:33 ` Laszlo Ersek
2016-12-20 23:01 ` [Qemu-arm] [Qemu-devel] [PATCH v4 0/7] q35: add negotiable broadcast SMI no-reply
2016-12-21 15:22 ` [Qemu-arm] checkpatch.pl false positive (was Re: [Qemu-devel] [PATCH v4 0/7] q35: add negotiable broadcast SMI) Eduardo Habkost
2016-12-21 15:22 ` [Qemu-devel] checkpatch.pl false positive (was " Eduardo Habkost
2016-12-21 17:47 ` [Qemu-arm] " Paolo Bonzini
2016-12-21 18:01 ` Eduardo Habkost
2016-12-21 18:08 ` Paolo Bonzini [this message]
2016-12-21 18:19 ` [Qemu-devel] " Eduardo Habkost
2017-01-10 15:06 ` [Qemu-arm] [PATCH v4 0/7] q35: add negotiable broadcast SMI Michael S. Tsirkin
2017-01-10 15:23 ` Laszlo Ersek
2017-01-10 16:05 ` Michael S. Tsirkin
2017-01-10 16:19 ` [Qemu-devel] " Laszlo Ersek
2017-01-10 16:21 ` [Qemu-arm] " Igor Mammedov
2017-01-10 16:30 ` Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e45bb195-578f-6afc-8617-f75e7775193e@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=ehabkost@redhat.com \
--cc=famz@redhat.com \
--cc=imammedo@redhat.com \
--cc=kraxel@redhat.com \
--cc=lersek@redhat.com \
--cc=michael@walle.cc \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=somlo@cmu.edu \
--cc=zhaoshenglong@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).