util:  refactor function to simplify and remove label
util:  refactor function to simplify and remove label

Once the DIR* in virPCIGetName() was made g_autoptr, the cleanup:
label just had a "return ret;", but the rest of the function was more
compilcated than it needed to be, doing funky things with the value of
ret inside multi-level conditionals and a while loop that might exit
early via a break with ret == 0 or exit early via a goto cleanup with
ret == -1.

It really didn't need to be nearly as complicated. After doing the
trivial replacements of "goto cleanup" with appropriate direct
returns, it became obvious that:

1) the outermost level of the nested conditional at the end of the
   function ("if (ret < 0)") was now redundant, since ret is now
   *always* < 0 by that point (otherwise the function has returned).

2) by switching the sense of the next level of the conditional (making
   it "if (!physPortID)", the "else" (which is now just "return 0;"
   becomes the "if", and the new "else" no longer needs to be inside
   the conditional.

3) the value of firstEntryName can be moved into *netname with
   g_steal_pointer()

Once that is all done, ret is no longer used and can be removed.

Signed-off-by: Laine Stump <c23361c43fbf79fed83e8b76173707b083d6caf5@redhat.com>
Reviewed-by: Daniel Henrique Barboza <627b089ad62deae9aaf06ccfa2c9056df28927e0@gmail.com>

jfehlig/libvirt,crobinso/libvirt,olafhering/libvirt,zippy2/libvirt,olafhering/libvirt,libvirt/libvirt,zippy2/libvirt,libvirt/libvirt,nertpinx/libvirt,jfehlig/libvirt,jfehlig/libvirt,zippy2/libvirt,nertpinx/libvirt,nertpinx/libvirt,libvirt/libvirt,olafhering/libvirt,nertpinx/libvirt,jfehlig/libvirt,crobinso/libvirt,crobinso/libvirt,libvirt/libvirt,zippy2/libvirt,olafhering/libvirt,nertpinx/libvirt,crobinso/libvirt