All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Auger <eric.auger@linaro.org>
To: eric.auger@st.com, eric.auger@linaro.org, qemu-devel@nongnu.org,
	qemu-arm@nongnu.org, peter.maydell@linaro.org,
	alex.williamson@redhat.com, david@gibson.dropbear.id.au
Cc: thomas.lendacky@amd.com, thuth@redhat.com,
	b.reynal@virtualopensystems.com, patches@linaro.org,
	crosthwaitepeter@gmail.com, suravee.suthikulpanit@amd.com,
	pbonzini@redhat.com, alex.bennee@linaro.org,
	christoffer.dall@linaro.org
Subject: [Qemu-devel] [PATCH v6 8/8] hw/arm/sysbus-fdt: remove qemu_fdt_setprop returned value check
Date: Mon,  1 Feb 2016 13:51:52 +0000	[thread overview]
Message-ID: <1454334712-12360-9-git-send-email-eric.auger@linaro.org> (raw)
In-Reply-To: <1454334712-12360-1-git-send-email-eric.auger@linaro.org>

qemu_fdt_setprop asserts in case of error hence no need to check
the returned value.

Signed-off-by: Eric Auger <eric.auger@linaro.org>

---

v3 -> v4: fix returned value
---
 hw/arm/sysbus-fdt.c | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/hw/arm/sysbus-fdt.c b/hw/arm/sysbus-fdt.c
index 9920388..04afeae 100644
--- a/hw/arm/sysbus-fdt.c
+++ b/hw/arm/sysbus-fdt.c
@@ -217,7 +217,7 @@ static int add_calxeda_midway_xgmac_fdt_node(SysBusDevice *sbdev, void *opaque)
     PlatformBusDevice *pbus = data->pbus;
     void *fdt = data->fdt;
     const char *parent_node = data->pbus_node_name;
-    int compat_str_len, i, ret = -1;
+    int compat_str_len, i;
     char *nodename;
     uint32_t *irq_attr, *reg_attr;
     uint64_t mmio_base, irq_number;
@@ -242,12 +242,8 @@ static int add_calxeda_midway_xgmac_fdt_node(SysBusDevice *sbdev, void *opaque)
         reg_attr[2 * i + 1] = cpu_to_be32(
                                 memory_region_size(&vdev->regions[i]->mem));
     }
-    ret = qemu_fdt_setprop(fdt, nodename, "reg", reg_attr,
-                           vbasedev->num_regions * 2 * sizeof(uint32_t));
-    if (ret) {
-        error_report("could not set reg property of node %s", nodename);
-        goto fail_reg;
-    }
+    qemu_fdt_setprop(fdt, nodename, "reg", reg_attr,
+                     vbasedev->num_regions * 2 * sizeof(uint32_t));
 
     irq_attr = g_new(uint32_t, vbasedev->num_irqs * 3);
     for (i = 0; i < vbasedev->num_irqs; i++) {
@@ -257,17 +253,12 @@ static int add_calxeda_midway_xgmac_fdt_node(SysBusDevice *sbdev, void *opaque)
         irq_attr[3 * i + 1] = cpu_to_be32(irq_number);
         irq_attr[3 * i + 2] = cpu_to_be32(GIC_FDT_IRQ_FLAGS_LEVEL_HI);
     }
-    ret = qemu_fdt_setprop(fdt, nodename, "interrupts",
+    qemu_fdt_setprop(fdt, nodename, "interrupts",
                      irq_attr, vbasedev->num_irqs * 3 * sizeof(uint32_t));
-    if (ret) {
-        error_report("could not set interrupts property of node %s",
-                     nodename);
-    }
     g_free(irq_attr);
-fail_reg:
     g_free(reg_attr);
     g_free(nodename);
-    return ret;
+    return 0;
 }
 
 /* AMD xgbe properties whose values are copied/pasted from host */
-- 
1.9.1

  parent reply	other threads:[~2016-02-01 13:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-01 13:51 [Qemu-devel] [PATCH v6 0/8] AMD XGBE KVM platform passthrough Eric Auger
2016-02-01 13:51 ` [Qemu-devel] [PATCH v6 1/8] hw/vfio/platform: amd-xgbe device Eric Auger
2016-02-01 13:51 ` [Qemu-devel] [PATCH v6 2/8] device_tree: introduce load_device_tree_from_sysfs Eric Auger
2016-02-01 16:15   ` Rob Herring
2016-02-01 16:22     ` Eric Auger
2016-02-01 16:27       ` Rob Herring
2016-02-01 16:31         ` Eric Auger
2016-02-16 18:37   ` Peter Maydell
2016-02-01 13:51 ` [Qemu-devel] [PATCH v6 3/8] device_tree: introduce qemu_fdt_node_path Eric Auger
2016-02-16 18:38   ` Peter Maydell
2016-02-01 13:51 ` [Qemu-devel] [PATCH v6 4/8] device_tree: qemu_fdt_getprop converted to use the error API Eric Auger
2016-02-01 13:51 ` [Qemu-devel] [PATCH v6 5/8] device_tree: qemu_fdt_getprop_cell " Eric Auger
2016-02-01 13:51 ` [Qemu-devel] [PATCH v6 6/8] hw/arm/sysbus-fdt: helpers for clock node generation Eric Auger
2016-02-01 13:51 ` [Qemu-devel] [PATCH v6 7/8] hw/arm/sysbus-fdt: enable amd-xgbe dynamic instantiation Eric Auger
2016-02-16 18:34   ` Peter Maydell
2016-02-01 13:51 ` Eric Auger [this message]
2016-02-16 18:40   ` [Qemu-devel] [PATCH v6 8/8] hw/arm/sysbus-fdt: remove qemu_fdt_setprop returned value check Peter Maydell
2016-02-16 18:40 ` [Qemu-devel] [PATCH v6 0/8] AMD XGBE KVM platform passthrough Peter Maydell
2016-02-17 19:59   ` Alex Williamson
2016-02-18 17:59     ` Eric Auger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1454334712-12360-9-git-send-email-eric.auger@linaro.org \
    --to=eric.auger@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=alex.williamson@redhat.com \
    --cc=b.reynal@virtualopensystems.com \
    --cc=christoffer.dall@linaro.org \
    --cc=crosthwaitepeter@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=eric.auger@st.com \
    --cc=patches@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=thomas.lendacky@amd.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.