From: Eric Blake <eblake@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: Blue Swirl <blauwirbel@gmail.com>,
Paolo Bonzini <pbonzini@redhat.com>,
patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH] scripts/checkpatch.pl: Don't allow special cases of unspaced operators
Date: Fri, 18 Dec 2015 08:31:18 -0700 [thread overview]
Message-ID: <567426C6.8090809@redhat.com> (raw)
In-Reply-To: <1450443571-14621-1-git-send-email-peter.maydell@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 1896 bytes --]
On 12/18/2015 05:59 AM, Peter Maydell wrote:
> The checkpatch.pl script has a special case to permit the following
> operators to have no spaces around them:
> << >> & ^ | + - * / %
>
> QEMU style prefers all operators to consistently have spacing around
> them, so remove this special case handling. This avoids reviewers
> having to manually note it during code review.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> I actually thought failing to point out the lack of spaces was
> a checkpatch parsing bug until I looked in the source and found it
> was deliberate...
>
> I say "QEMU style prefers", but possibly what I actually mean is
> "I prefer" ? Does anybody want to defend the unspaced versions?
I'm in favor of this patch; it only affects new code, and explains why I
have been spotting unspaced operators in new code that didn't trigger
checkpatch noise.
>
> scripts/checkpatch.pl | 13 -------------
> 1 file changed, 13 deletions(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index b0f6e11..efca817 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1890,19 +1890,6 @@ sub process {
> ERROR("space prohibited after that '$op' $at\n" . $hereptr);
> }
>
> -
> - # << and >> may either have or not have spaces both sides
> - } elsif ($op eq '<<' or $op eq '>>' or
> - $op eq '&' or $op eq '^' or $op eq '|' or
> - $op eq '+' or $op eq '-' or
> - $op eq '*' or $op eq '/' or
> - $op eq '%')
> - {
What's weird is that the comment wasn't even correct. Probably one
person special-cased << and >>, and another then extended to
special-case all operators.
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2015-12-18 15:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-18 12:59 [Qemu-devel] [PATCH] scripts/checkpatch.pl: Don't allow special cases of unspaced operators Peter Maydell
2015-12-18 13:03 ` Paolo Bonzini
2015-12-18 13:08 ` [Qemu-trivial] " Stefan Weil
2015-12-18 13:08 ` Stefan Weil
2015-12-18 15:31 ` Eric Blake [this message]
2016-01-11 8:12 ` [Qemu-trivial] " Michael Tokarev
2016-01-11 8:12 ` [Qemu-devel] " Michael Tokarev
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=567426C6.8090809@redhat.com \
--to=eblake@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=patches@linaro.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.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.