NetBSD-Bugs archive

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

kern/53821: src/sys/dev/pci/if_wm.c: some possibly pointless tests ?



>Number:         53821
>Category:       kern
>Synopsis:       src/sys/dev/pci/if_wm.c: some possibly pointless tests ?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 31 16:10:00 +0000 2018
>Originator:     David Binderman
>Release:        20181231
>Organization:
>Environment:
>Description:
[src/sys/dev/pci/if_wm.c:14616] -> [src/sys/dev/pci/if_wm.c:14640]: (warning) Identical condition 'rv!=0', second condition is always false


Source code is

                        sc->phy.readreg_locked(dev, 1, I217_MEMPWR, &phy_reg);
                        if (rv != 0)
                                goto release;

Maybe better code

                        rv = sc->phy.readreg_locked(dev, 1, I217_MEMPWR, &phy_reg);
                        if (rv != 0)
                                goto release;

[src/sys/dev/pci/if_wm.c:14616] -> [src/sys/dev/pci/if_wm.c:14650]: (warning) Identical condition 'rv!=0', second condition is always false

Duplicate.

>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index