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

Daniel Henrique Barboza posted 10 patches 4 years, 6 months ago
There is a newer version of this series
[PATCH v4 03/10] qemu_extdevice.c: remove unneeded 'ret' variable
Posted by Daniel Henrique Barboza 4 years, 6 months ago
qemuExtDevicesInitPaths() does not need 'ret'.

Signed-off-by: Daniel Henrique Barboza <danielhb413@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 2096272761..2ff3f68f5d 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);
 
-    return ret;
+    return 0;
 }
 
 
-- 
2.26.2

Re: [PATCH v4 03/10] qemu_extdevice.c: remove unneeded 'ret' variable
Posted by Stefan Berger 4 years, 6 months ago
On 5/15/20 6:24 PM, Daniel Henrique Barboza wrote:
> qemuExtDevicesInitPaths() does not need 'ret'.
>
> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>

Reviewed-by: Stefan Berger <stefanb@linux.ibm.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 2096272761..2ff3f68f5d 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);
>   
> -    return ret;
> +    return 0;
>   }
>   
>