[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>
- Re: [PATCH v1 37/59] s390x/event-facility.c: remove unneeded labels, (continued)
- [PATCH v1 40/59] hsb/hcd-ehci.c: remove unneeded labels, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 43/59] i386/amd_iommu.c: remove unneeded label in amdvi_int_remap_msi(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 50/59] rdma/rdma_backend.c: remove unneeded label in rdma_backend_init(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 16/59] block/gluster.c: remove unneeded 'exit' label, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 21/59] block/backup.c remove unneeded 'out' label in backup_run(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 22/59] block/vmdk.c: remove unneeded labels, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 28/59] qga/commands-win32.c: remove 'out' label in get_pci_info, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 30/59] util/module.c: remove unneeded label in module_load_file(), Daniel Henrique Barboza, 2020/01/06
- Re: [PATCH v1 30/59] util/module.c: remove unneeded label in module_load_file(),
Thomas Huth <=
- Re: [PATCH v1 00/59] trivial unneeded labels cleanup, Max Reitz, 2020/01/07
- Re: [PATCH v1 00/59] trivial unneeded labels cleanup, Eric Blake, 2020/01/10