From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSnI8-0000QZ-8U for qemu-devel@nongnu.org; Thu, 28 Jul 2016 11:32:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSnI4-00045p-2q for qemu-devel@nongnu.org; Thu, 28 Jul 2016 11:32:07 -0400 References: <1469703004-14800-1-git-send-email-caoj.fnst@cn.fujitsu.com> From: Eric Blake Message-ID: <579A2571.9060101@redhat.com> Date: Thu, 28 Jul 2016 09:32:01 -0600 MIME-Version: 1.0 In-Reply-To: <1469703004-14800-1-git-send-email-caoj.fnst@cn.fujitsu.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="m8Gw44EG5A9U8avRbKK3ahUwu1CAHxvdf" Subject: Re: [Qemu-devel] [PATCH] util/qemu-sockets: revert Yoda Conditions to normal List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cao jin , qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Paolo Bonzini , Gerd Hoffmann This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --m8Gw44EG5A9U8avRbKK3ahUwu1CAHxvdf From: Eric Blake To: Cao jin , qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Paolo Bonzini , Gerd Hoffmann Message-ID: <579A2571.9060101@redhat.com> Subject: Re: [Qemu-devel] [PATCH] util/qemu-sockets: revert Yoda Conditions to normal References: <1469703004-14800-1-git-send-email-caoj.fnst@cn.fujitsu.com> In-Reply-To: <1469703004-14800-1-git-send-email-caoj.fnst@cn.fujitsu.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/28/2016 04:50 AM, Cao jin wrote: > Follow CODING_STYLE >=20 > Cc: Daniel P. Berrange > Cc: Gerd Hoffmann > Cc: Paolo Bonzini >=20 > Signed-off-by: Cao jin > --- > util/qemu-sockets.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) >=20 > Daniel P. Berrange make me realized there is Yoda Conditions in this fi= le, > this file is mixed with both style, since I just touched this file, so,= > reverting it is handy to me. >=20 > diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c > index 5e08723..a07acc5 100644 > --- a/util/qemu-sockets.c > +++ b/util/qemu-sockets.c > @@ -386,7 +386,7 @@ static int inet_dgram_saddr(InetSocketAddress *srad= dr, > goto err; > } > =20 > - if (0 !=3D (rc =3D getaddrinfo(addr, port, &ai, &peer))) { > + if ((rc =3D getaddrinfo(addr, port, &ai, &peer)) !=3D 0) { CODING_STYLE is currently silent on whether assignment in conditionals is appropriate, so maybe that should be patched. But most of our code prefers: rc =3D getaddrinfo(); if (rc !=3D 0) { rather than assignments in the conditional. I don't have any strong opinions on whether that would require a respin or whether your patch is fine as is. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --m8Gw44EG5A9U8avRbKK3ahUwu1CAHxvdf 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/ iQEcBAEBCAAGBQJXmiVyAAoJEKeha0olJ0NqmUEH/jJ0xzh9gpBiuk+mDZvnehO2 pdooPgd/F9PZhPs+qbJZMwXpTmQRXfPyLPpiwy2uPNJw6Ip0MEzpV5PCrNWbDcCB jegAbe+heajLoEoiXETOjezG5wsUizMGGzT/38GKz33kBKv6Is5ynDDzhBc6B5+U 5MtwNIOhDw6bq4A8y4+WYQKJPTAoTDD0MVFnQyOdv/vmo34t4UHu50PI0NArKXaD RPjvTQyKRWb+TJdyP/uxN5WdqQqHXJCs569LgwPmpqPTkqqPIPR53sGRKwb9eh2G MQJvv3NQfqPrY0XAuPuqwVkMNGwMemZuqf+pscMnCcPe2hthOmJtDYUZNyMsuF4= =j876 -----END PGP SIGNATURE----- --m8Gw44EG5A9U8avRbKK3ahUwu1CAHxvdf--