Re: [PATCH] qemu: Resolve Coverity DEADCODE

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

 



On Mon, Apr 27, 2015 at 07:33:06 -0400, John Ferlan wrote:
> Coverity notes taht the switch() used to check 'connected' values has
> two DEADCODE paths (_DEFAULT & _LAST).  Since 'connected' is a boolean
> it can only be one or the other (CONNECTED or DISCONNECTED), so it just
> seems pointless to use a switch to get "all" values.  Convert to if-else

Well, if you add a new state to the VIR_DOMAIN_CHR_DEVICE_STATE_* enum,
the compiler won't warn you that you need to check yet another place if
you use the if-else statement. That is the exact reason to use switch here.

I hate coverity for this and I hope it will not bite me once I'll have
to touch the code.

Against-will ACK.

Peter

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]