[libvirt] [PATCH] qemu_driver.c: remove useless, warning-provoking test
Chris Lalancette
clalance at redhat.com
Tue Jan 5 15:56:26 UTC 2010
On 01/05/2010 10:37 AM, Jim Meyering wrote:
> Tools like coverity and maybe clang notice that we dereference
> uri_out, and then (later) test whether uri_out is NULL.
> Obviously one or the other must go.
>
> Presuming that we will always pass a non-NULL uri_out arg to
> this function, I chose to mark that parameter as ATTRIBUTE_NONNULL.
> I removed the unnecessary test, too.
>
> If anyone is concerned that a non-NULL (non-literal)
> value will be passed, I can also add an assertion.
The change you make below is correct. uri_out can never be NULL
in the code we have today, so the additional check is useless.
ACK
--
Chris Lalancette
More information about the libvir-list
mailing list