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 v8 8/8] hw/arm/sysbus-fdt: remove qemu_fdt_setprop returned value check
Date: Fri, 19 Feb 2016 13:17:13 +0000 [thread overview]
Message-ID: <1455887833-7306-9-git-send-email-eric.auger@linaro.org> (raw)
In-Reply-To: <1455887833-7306-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>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
v6 -> v7:
- add Peter's R-b
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.8.3.2
prev parent reply other threads:[~2016-02-19 13:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-19 13:17 [Qemu-devel] [PATCH v8 0/8] AMD XGBE KVM platform passthrough Eric Auger
2016-02-19 13:17 ` [Qemu-devel] [PATCH v8 1/8] hw/vfio/platform: amd-xgbe device Eric Auger
2016-02-19 13:17 ` [Qemu-devel] [PATCH v8 2/8] device_tree: introduce load_device_tree_from_sysfs Eric Auger
2016-02-19 13:17 ` [Qemu-devel] [PATCH v8 3/8] device_tree: introduce qemu_fdt_node_path Eric Auger
2016-02-19 13:17 ` [Qemu-devel] [PATCH v8 4/8] device_tree: qemu_fdt_getprop converted to use the error API Eric Auger
2016-02-19 13:17 ` [Qemu-devel] [PATCH v8 5/8] device_tree: qemu_fdt_getprop_cell " Eric Auger
2016-02-19 13:17 ` [Qemu-devel] [PATCH v8 6/8] hw/arm/sysbus-fdt: helpers for clock node generation Eric Auger
2016-02-19 13:17 ` [Qemu-devel] [PATCH v8 7/8] hw/arm/sysbus-fdt: enable amd-xgbe dynamic instantiation Eric Auger
2016-02-19 13:17 ` Eric Auger [this message]
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=1455887833-7306-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).