qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 11/13] qapi: Clean up null checking in genera


From: Eric Blake
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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

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 <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>

Still stands.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]