From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJk8K-0006aS-M4 for qemu-devel@nongnu.org; Sat, 01 Mar 2014 08:39:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WJk8F-0002Ix-Ou for qemu-devel@nongnu.org; Sat, 01 Mar 2014 08:39:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJk8F-0002Iq-Fh for qemu-devel@nongnu.org; Sat, 01 Mar 2014 08:39:11 -0500 Message-ID: <5311E2BD.1000900@redhat.com> Date: Sat, 01 Mar 2014 06:38:05 -0700 From: Eric Blake MIME-Version: 1.0 References: <1393659639-12959-1-git-send-email-armbru@redhat.com> <1393659639-12959-12-git-send-email-armbru@redhat.com> In-Reply-To: <1393659639-12959-12-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bIVKrOMidCATjup7p0M6DTIk4wrCvXVAm" Subject: Re: [Qemu-devel] [PATCH v3 11/13] qapi: Clean up null checking in generated visitors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, mdroth@linux.vnet.ibm.com, aliguori@amazon.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --bIVKrOMidCATjup7p0M6DTIk4wrCvXVAm Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/01/2014 12:40 AM, Markus Armbruster wrote: > Visitors get passed a pointer to the visited object. The generated > visitors try to cope with this pointer being null in some places, for > instance like this: >=20 > visit_start_optional(m, obj ? &(*obj)->has_name : NULL, "name", &er= r); >=20 > visit_start_optional() passes its second argument to Visitor method > start_optional. Three out of three methods dereference it > unconditionally. >=20 > I fail to see how hits pointer could legitimately be null. s/hits/this/ >=20 > All this useless null checking is highly redundant, which Coverity > duly reports. About 200 times. >=20 > Remove the useless null checks. >=20 > Signed-off-by: Markus Armbruster > Reviewed-by: Eric Blake Still stands. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --bIVKrOMidCATjup7p0M6DTIk4wrCvXVAm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTEeK+AAoJEKeha0olJ0Nqr+kH/2tg4v7W+WCiYpHrF1TuG64k T2d2oBNv0IK4k9WHgdwaPEn9MHN4EUUAgATDvDeU5UT0MDRZSDZmAHmpGKdVwegR u4ccLODljoyGKKqeZIo+5hKcXjlKu1gb2aiDkfal5Ln5LZp8zLNm1VDiCfbuPQUl pHkNcKVsksopKcOIxjme4coTbDBSCyIa/wY+I+/pM3SNtEAvuDoNgjJYxQifoE/R 1JJJIyE4aM1Lg2RQGkbaY/MCAVRrBLPaCcanSbn8gfHUCuhly2FEN+yf6pENVu6t ZWPulfgXYBqS5kQ2VOGFJi0M+yLjj9VQobj1bM7JQC6A8JkZHmM9TFqZWfjHZNk= =DEbA -----END PGP SIGNATURE----- --bIVKrOMidCATjup7p0M6DTIk4wrCvXVAm--