qemu-trivial
[Top][All Lists]
Advanced

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

Re: [PATCH v1 30/59] util/module.c: remove unneeded label in module_load


From: Thomas Huth
Subject: Re: [PATCH v1 30/59] util/module.c: remove unneeded label in module_load_file()
Date: Tue, 7 Jan 2020 12:26:22 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

On 06/01/2020 19.23, Daniel Henrique Barboza wrote:
> 'out' can be replaced by the apropriate return values set
> in 'ret' for each case.
> 
> CC: Paolo Bonzini <address@hidden>
> Signed-off-by: Daniel Henrique Barboza <address@hidden>
> ---
>  util/module.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/util/module.c b/util/module.c
> index e9fe3e5422..9b5453f878 100644
> --- a/util/module.c
> +++ b/util/module.c
> @@ -111,12 +111,10 @@ static int module_load_file(const char *fname)
>  
>      if (len <= suf_len || strcmp(&fname[len - suf_len], dsosuf)) {
>          /* wrong suffix */
> -        ret = -EINVAL;
> -        goto out;
> +        return -EINVAL;
>      }
>      if (access(fname, F_OK)) {
> -        ret = -ENOENT;
> -        goto out;
> +        return -ENOENT;
>      }
>  
>      assert(QTAILQ_EMPTY(&dso_init_list));
> @@ -125,8 +123,7 @@ static int module_load_file(const char *fname)
>      if (!g_module) {
>          fprintf(stderr, "Failed to open module: %s\n",
>                  g_module_error());
> -        ret = -EINVAL;
> -        goto out;
> +        return -EINVAL;
>      }
>      if (!g_module_symbol(g_module, DSO_STAMP_FUN_STR, (gpointer *)&sym)) {
>          fprintf(stderr, "Failed to initialize module: %s\n",
> @@ -151,7 +148,7 @@ static int module_load_file(const char *fname)
>          QTAILQ_REMOVE(&dso_init_list, e, node);
>          g_free(e);
>      }
> -out:
> +
>      return ret;
>  }
>  #endif
> 

Reviewed-by: Thomas Huth <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]