Re: [libvirt] Dead code vs. XXX comment: remove or not?

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

 



On Thu, Sep 03, 2009 at 06:28:13PM +0200, Jim Meyering wrote:
> clang reported that this assignment to type is a dead store,
> since type is never used after this point.
> 
> This is xm_internal.c, line 1074:
> 
>             /* XXX Forcing to pretend its a bridge */
>             if (type == -1) {
>                 type = 1;
>             }
> 
> Normally I'd just remove the whole if block, but the XXX comment
> makes me think someone has plans for this code.
> 
> I'll wait for a second opinion.

  Seems to me we used to expect type would be used to keep the trace
of the type of the vif, but we never use that variable, only for that
test. I would just kill it from that block

    list = virConfGetValue(conf, "vif");
    if (list && list->type == VIR_CONF_LIST) {
        list = list->list;
        while (list) {
            int type = -1;

  since we never use the value anywhere !

Daniel


-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

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