[PATCH v7 03/10] qemu_extdevice.c: remove unneeded 'ret' variable

Ján Tomko jtomko at redhat.com
Tue Jun 23 13:17:36 UTC 2020


On a Wednesday in 2020, Daniel Henrique Barboza wrote:
>qemuExtDevicesInitPaths() does not need 'ret'.
>
>Tested-by: Satheesh Rajendran <sathnaga at linux.vnet.ibm.com>
>Reviewed-by: Stefan Berger <stefanb at linux.ibm.com>
>Signed-off-by: Daniel Henrique Barboza <danielhb413 at gmail.com>
>---
> src/qemu/qemu_extdevice.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
>diff --git a/src/qemu/qemu_extdevice.c b/src/qemu/qemu_extdevice.c
>index dc188e6042..8f1bd9311e 100644
>--- a/src/qemu/qemu_extdevice.c
>+++ b/src/qemu/qemu_extdevice.c
>@@ -73,12 +73,10 @@ static int
> qemuExtDevicesInitPaths(virQEMUDriverPtr driver,
>                         virDomainDefPtr def)
> {
>-    int ret = 0;
>-
>     if (def->tpm)
>-        ret = qemuExtTPMInitPaths(driver, def);
>+        return qemuExtTPMInitPaths(driver, def);

Neither the old nor the new pattern allows for easily extending
this function.

if (tpm) {
     if (InitPaths() < 0)
          return -1;
}

But we probably aren't going to need it.
Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200623/4279e2db/attachment-0001.sig>


More information about the libvir-list mailing list