[libvirt PATCH 23/24] tests: vir: remove pointless labels

Laine Stump laine at redhat.com
Mon Sep 6 19:42:37 UTC 2021


On 9/4/21 4:44 PM, Ján Tomko wrote:

> @@ -319,9 +308,9 @@ testFileIsSharedFSType(const void *opaque G_GNUC_UNUSED)
>       return EXIT_AM_SKIP;
>   #else
>       const struct testFileIsSharedFSType *data = opaque;
> +    int ret = -1;
>       g_autofree char *mtabFile = NULL;
>       bool actual;
> -    int ret = -1;

unrelated (well, only peripherally related) code movement.

[...]


> @@ -199,15 +195,15 @@ testVirPCIDeviceReattach(const void *opaque G_GNUC_UNUSED)
>   
>       for (i = 0; i < nDev; i++) {
>           if (virPCIDeviceReattach(dev[i], activeDevs, inactiveDevs) < 0)
> -            goto cleanup;
> +            return -1;
>   
>           CHECK_LIST_COUNT(activeDevs, 0);
>           CHECK_LIST_COUNT(inactiveDevs, nDev - i - 1);
>       }
>   
> -    ret = 0;
> +    return 0;
>    cleanup:
> -    return ret;
> +    return -1;
>   }


Oops. You forgot one! cleanup is no longer referenced, but you didn't 
remove it (or the dead code "return -1;" following it)




More information about the libvir-list mailing list