From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLkm8-0006aj-1l for qemu-devel@nongnu.org; Tue, 19 Jan 2016 23:53:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLkm4-00028h-L1 for qemu-devel@nongnu.org; Tue, 19 Jan 2016 23:53:43 -0500 References: <1452859244-9500-1-git-send-email-david@gibson.dropbear.id.au> <1452859244-9500-8-git-send-email-david@gibson.dropbear.id.au> <569EBFA6.6090709@redhat.com> <569ED31D.1020307@ozlabs.ru> From: Eric Blake Message-ID: <569F12D2.60307@redhat.com> Date: Tue, 19 Jan 2016 21:53:38 -0700 MIME-Version: 1.0 In-Reply-To: <569ED31D.1020307@ozlabs.ru> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KH4Dts8VxlvCVH7BALcvujDrMT2jO7XNC" Subject: Re: [Qemu-devel] [PATCH 07/10] pseries: Clean up error handling in spapr_rtas_register() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy , David Gibson , armbru@redhat.com Cc: qemu-ppc@nongnu.org, mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KH4Dts8VxlvCVH7BALcvujDrMT2jO7XNC Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/19/2016 05:21 PM, Alexey Kardashevskiy wrote: >> You could drop the redundant () while touching this, as in: >=20 >=20 > Seriously? Why? I personally find it really annoying (but I stay silent= ) > when people omit braces in cases like this. >=20 >=20 >> assert(token >=3D RTAS_TOKEN_BASE && token < RTAS_TOKEN_MAX); Because it's the prevailing style. I estimate that less than 10% of qemu over-parenthesizes, mostly because && and || are well-known C operator precedence: $ git grep ' && ' | wc 6462 57034 482477 $ git grep ') && (' | wc 578 6151 48655 Of course, that's a rough estimate, as it has false positives on 'if (foo() && (b || c))', and false negatives on conditionals where there is a unary rather than binary operator on either side of &&; but I'm sure you could write a Coccinelle script if you wanted more accurate counting.= But you are equally right that as long as HACKING doesn't document it, and checkpatch.pl doesn't flag it, then you can over-parenthesize binary arguments to the short-circuiting operators to your aesthetic tastes. And for other operators, like '&' and '|', I definitely recommend the parenthesis, particularly if you manage to trigger a gcc or clang warning (in spite of the precedence being unambiguous) if you omit the parenthesis. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --KH4Dts8VxlvCVH7BALcvujDrMT2jO7XNC 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/ iQEcBAEBCAAGBQJWnxLSAAoJEKeha0olJ0NqNo8H/01QBQhH7cM5sAUpOUfMfy2L m2uxG337x6Bo5t7pDqc7RU61f6oRIm6Ps5Kp6KNixs5AwSwJT47xvZN6/93h+wY2 9K18vDojO9Wc6jCgZPmV3U9FFQ+kTNloA6GGHUM9JU2rNOVtxfyKlYXNySbkHa+F 2od9CRZ7ynjbitKqz/Uz9VnVfTCPlBL1my/x0TkM+vSSpliGIJFGB+Zy0WMBrzeg UBLMHfQSxfeuSWz3IzsSdbFSd7oaNzeg3CAyfVL0qxm1vgWFncFg/o/Tu24L5FGR 8QNKfIbOrDRB9KDn9NMBgxqEb9EfpLqmhtBKq4ko9HSrmNdj5ZbyLC8TrdlGXsw= =h1KP -----END PGP SIGNATURE----- --KH4Dts8VxlvCVH7BALcvujDrMT2jO7XNC--