From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9x0D-0004IW-05 for qemu-devel@nongnu.org; Fri, 18 Dec 2015 10:31:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9x08-0001ow-VR for qemu-devel@nongnu.org; Fri, 18 Dec 2015 10:31:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9x08-0001os-PE for qemu-devel@nongnu.org; Fri, 18 Dec 2015 10:31:24 -0500 References: <1450443571-14621-1-git-send-email-peter.maydell@linaro.org> From: Eric Blake Message-ID: <567426C6.8090809@redhat.com> Date: Fri, 18 Dec 2015 08:31:18 -0700 MIME-Version: 1.0 In-Reply-To: <1450443571-14621-1-git-send-email-peter.maydell@linaro.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4MukHWcNGEPC7e5X54EkOrgqoOtDnVpbo" Subject: Re: [Qemu-devel] [PATCH] scripts/checkpatch.pl: Don't allow special cases of unspaced operators List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org Cc: Blue Swirl , Paolo Bonzini , patches@linaro.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4MukHWcNGEPC7e5X54EkOrgqoOtDnVpbo Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: > << >> & ^ | + - * / % >=20 > 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. >=20 > Signed-off-by: Peter Maydell > --- > 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... >=20 > 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. >=20 > scripts/checkpatch.pl | 13 ------------- > 1 file changed, 13 deletions(-) >=20 > 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); > } > =20 > - > - # << 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 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --4MukHWcNGEPC7e5X54EkOrgqoOtDnVpbo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWdCbHAAoJEKeha0olJ0NqK9sH/iCo407ucADI66A8pz2IhPBA IIq43SYbsfswmSbJEIuzW4mIIT/OhnwvQ+zkbXysx2iRBP+dWFPN2REKaowmcT7w nKiONxmvgjMCrs6aDtKVysWqvkLixKGTX4I3GcoBSTFimaJx1sjQobpxxk3xIouT 8AEq5EEA6yilgKK4JhSKFtzhoTr+zfKPhbRw+F4BkRstm9fkfpowAXNZcIEayJaD vh2bsYYw82zXj35P4qaLwpcy/DsdhmkKoxkrkUBe5EmmwYss8Y9Le3W4B6XO/9HM xxYtjH0d8+Gr1nJTQ4WIaq1l3t+LBfgTU/yoKCzjoDYcLYxleK1cDxaFoKv62Yg= =mXPS -----END PGP SIGNATURE----- --4MukHWcNGEPC7e5X54EkOrgqoOtDnVpbo--