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,
david@gibson.dropbear.id.au, alex.williamson@redhat.com
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 v4 8/8] hw/arm/sysbus-fdt: remove qemu_fdt_setprop returned value check
Date: Fri, 8 Jan 2016 09:32:05 +0000 [thread overview]
Message-ID: <1452245525-3886-9-git-send-email-eric.auger@linaro.org> (raw)
In-Reply-To: <1452245525-3886-1-git-send-email-eric.auger@linaro.org>
qemu_fdt_setprop self-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 75a4526..b511865 100644
--- a/hw/arm/sysbus-fdt.c
+++ b/hw/arm/sysbus-fdt.c
@@ -216,7 +216,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;
@@ -241,12 +241,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++) {
@@ -256,17 +252,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;
}
--
1.9.1
prev parent reply other threads:[~2016-01-08 9:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-08 9:31 [Qemu-devel] [PATCH v4 0/8] AMD XGBE KVM platform passthrough Eric Auger
2016-01-08 9:31 ` [Qemu-devel] [PATCH v4 1/8] hw/vfio/platform: amd-xgbe device Eric Auger
2016-01-08 9:31 ` [Qemu-devel] [PATCH v4 2/8] device_tree: introduce load_device_tree_from_sysfs Eric Auger
2016-01-08 9:32 ` [Qemu-devel] [PATCH v4 3/8] device_tree: introduce qemu_fdt_node_path Eric Auger
2016-01-08 9:32 ` [Qemu-devel] [PATCH v4 4/8] device_tree: qemu_fdt_getprop converted to use the error API Eric Auger
2016-01-12 3:58 ` Peter Crosthwaite
2016-01-08 9:32 ` [Qemu-devel] [PATCH v4 5/8] device_tree: qemu_fdt_getprop_cell " Eric Auger
2016-01-12 3:58 ` Peter Crosthwaite
2016-01-12 16:17 ` Eric Auger
2016-01-08 9:32 ` [Qemu-devel] [PATCH v4 6/8] hw/arm/sysbus-fdt: helpers for clock node generation Eric Auger
2016-01-08 9:32 ` [Qemu-devel] [PATCH v4 7/8] hw/arm/sysbus-fdt: enable amd-xgbe dynamic instantiation Eric Auger
2016-01-08 9:32 ` 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=1452245525-3886-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).