qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, pbonzini@redhat.com, mdroth@linux.vnet.ibm.com,
	aliguori@amazon.com, lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 11/13] qapi: Clean up null checking in generated visitors
Date: Sat, 01 Mar 2014 06:38:05 -0700	[thread overview]
Message-ID: <5311E2BD.1000900@redhat.com> (raw)
In-Reply-To: <1393659639-12959-12-git-send-email-armbru@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 923 bytes --]

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:
> 
>     visit_start_optional(m, obj ? &(*obj)->has_name : NULL, "name", &err);
> 
> visit_start_optional() passes its second argument to Visitor method
> start_optional.  Three out of three methods dereference it
> unconditionally.
> 
> I fail to see how hits pointer could legitimately be null.

s/hits/this/

> 
> All this useless null checking is highly redundant, which Coverity
> duly reports.  About 200 times.
> 
> Remove the useless null checks.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>

Still stands.

-- 
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 --]

  reply	other threads:[~2014-03-01 13:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-01  7:40 [Qemu-devel] [PATCH v3 00/13] qapi: Test coverage & clean up generated code Markus Armbruster
2014-03-01  7:40 ` [Qemu-devel] [PATCH v3 01/13] tests/qapi-schema: Actually check successful QMP command response Markus Armbruster
2014-03-01  7:40 ` [Qemu-devel] [PATCH v3 02/13] tests/qapi-schema: Cover optional command arguments Markus Armbruster
2014-03-01  7:40 ` [Qemu-devel] [PATCH v3 03/13] tests/qapi-schema: Cover simple argument types Markus Armbruster
2014-03-01  7:40 ` [Qemu-devel] [PATCH v3 04/13] tests/qapi-schema: Cover anonymous union types Markus Armbruster
2014-03-01  7:40 ` [Qemu-devel] [PATCH v3 05/13] tests/qapi-schema: Cover complex types with base Markus Armbruster
2014-03-01  7:40 ` [Qemu-devel] [PATCH v3 06/13] tests/qapi-schema: Cover union " Markus Armbruster
2014-03-01  7:40 ` [Qemu-devel] [PATCH v3 07/13] tests/qapi-schema: Cover flat union types Markus Armbruster
2014-03-01  7:40 ` [Qemu-devel] [PATCH v3 08/13] qapi: Fix licensing of scripts Markus Armbruster
2014-03-01  7:40 ` [Qemu-devel] [PATCH v3 09/13] qapi: Drop nonsensical header guard in generated qapi-visit.c Markus Armbruster
2014-03-01  7:40 ` [Qemu-devel] [PATCH v3 10/13] qapi: Drop unused code in qapi-commands.py Markus Armbruster
2014-03-01  7:40 ` [Qemu-devel] [PATCH v3 11/13] qapi: Clean up null checking in generated visitors Markus Armbruster
2014-03-01 13:38   ` Eric Blake [this message]
2014-03-01  7:40 ` [Qemu-devel] [PATCH v3 12/13] qapi: Clean up superfluous null check in qapi_dealloc_type_str() Markus Armbruster
2014-03-01  7:40 ` [Qemu-devel] [PATCH v3 13/13] qapi: Add missing null check to opts_start_struct() Markus Armbruster
2014-03-03 16:21 ` [Qemu-devel] [PATCH v3 00/13] qapi: Test coverage & clean up generated code Luiz Capitulino

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=5311E2BD.1000900@redhat.com \
    --to=eblake@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).