From: Markus Armbruster <armbru@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, richard.henderson@linaro.org
Subject: Re: [Qemu-devel] [PATCH correct] checkpatch: allow space in more places before a bracket
Date: Fri, 17 Aug 2018 15:09:25 +0200 [thread overview]
Message-ID: <87efex16nu.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20180817105157.7486-1-pbonzini@redhat.com> (Paolo Bonzini's message of "Fri, 17 Aug 2018 12:51:57 +0200")
Paolo Bonzini <pbonzini@redhat.com> writes:
> From: Heinrich Schuchardt <xypron.glpk@gmx.de>
>
> Allow a space between a colon and subsequent opening bracket. This
> sequence may occur in inline assembler statements like
>
> asm(
> "ldr %[out], [%[in]]\n\t"
> : [out] "=r" (ret)
> : [in] "r" (addr)
> );
>
> Allow a space between a comma and subsequent opening bracket. This
> sequence may occur in designated initializers.
>
> To ease backporting the patch, I am also changing the comma-bracket
> detection (added in QEMU by commit 409db6eb7199af7a2f09f746bd1b793e9daefe5f)
> to use the same regex as brackets and colons (as done independently
> by Linux commit daebc534ac15f991961a5bb433e515988220e9bf).
>
> Link: http://lkml.kernel.org/r/20180403191655.23700-1-xypron.glpk@gmx.de
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Acked-by: Joe Perches <joe@perches.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> scripts/checkpatch.pl | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 52ab18bfce..33b5771120 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1977,9 +1977,8 @@ sub process {
> my ($where, $prefix) = ($-[1], $1);
> if ($prefix !~ /$Type\s+$/ &&
> ($where != 0 || $prefix !~ /^.\s+$/) &&
> - $prefix !~ /{\s+$/ &&
> $prefix !~ /\#\s*define[^(]*\([^)]*\)\s+$/ &&
> - $prefix !~ /,\s+$/) {
> + $prefix !~ /[,{:]\s+$/) {
> ERROR("space prohibited before open square bracket '['\n" . $herecurr);
> }
> }
Reviewed-by: Markus Armbruster <armbru@redhat.com>
prev parent reply other threads:[~2018-08-17 13:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-17 10:51 [Qemu-devel] [PATCH correct] checkpatch: allow space in more places before a bracket Paolo Bonzini
2018-08-17 13:09 ` Markus Armbruster [this message]
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=87efex16nu.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.