[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 28/37] qdev: use g_strcmp0() instead of open-coding it
From: |
Marc-André Lureau |
Subject: |
[PATCH v5 28/37] qdev: use g_strcmp0() instead of open-coding it |
Date: |
Fri, 20 Dec 2019 17:45:52 +0400 |
Minor code simplification.
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/core/qdev.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 82d3ee590a..98e786c50f 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -394,11 +394,8 @@ static NamedGPIOList *qdev_get_named_gpio_list(DeviceState
*dev,
NamedGPIOList *ngl;
QLIST_FOREACH(ngl, &dev->gpios, node) {
- /* NULL is a valid and matchable name, otherwise do a normal
- * strcmp match.
- */
- if ((!ngl->name && !name) ||
- (name && ngl->name && strcmp(name, ngl->name) == 0)) {
+ /* NULL is a valid and matchable name. */
+ if (g_strcmp0(name, ngl->name) == 0) {
return ngl;
}
}
--
2.24.0.308.g228f53135a
- [PATCH v5 18/37] mips: baudbase is 115200 by default, (continued)
- [PATCH v5 18/37] mips: baudbase is 115200 by default, Marc-André Lureau, 2019/12/20
- [PATCH v5 19/37] mips: use sysbus_add_io(), Marc-André Lureau, 2019/12/20
- [PATCH v5 20/37] mips: use sysbus_mmio_get_region() instead of internal fields, Marc-André Lureau, 2019/12/20
- [PATCH v5 21/37] sm501: make SerialMM a child, export chardev property, Marc-André Lureau, 2019/12/20
- [PATCH v5 22/37] vmmouse: replace PROP_PTR with PROP_LINK, Marc-André Lureau, 2019/12/20
- [PATCH v5 23/37] lance: replace PROP_PTR with PROP_LINK, Marc-André Lureau, 2019/12/20
- [PATCH v5 24/37] etraxfs: remove PROP_PTR usage, Marc-André Lureau, 2019/12/20
- [PATCH v5 25/37] dp8393x: replace PROP_PTR with PROP_LINK, Marc-André Lureau, 2019/12/20
- [PATCH v5 26/37] leon3: use qemu_irq framework instead of callback as property, Marc-André Lureau, 2019/12/20
- [PATCH v5 27/37] leon3: use qdev gpio facilities for the PIL, Marc-André Lureau, 2019/12/20
- [PATCH v5 28/37] qdev: use g_strcmp0() instead of open-coding it,
Marc-André Lureau <=
- [PATCH v5 29/37] mips/cps: fix setting saar property, Marc-André Lureau, 2019/12/20
- [PATCH v5 30/37] cris: improve passing PIC interrupt vector to the CPU, Marc-André Lureau, 2019/12/20
- [PATCH v5 31/37] smbus-eeprom: remove PROP_PTR, Marc-André Lureau, 2019/12/20
- [PATCH v5 32/37] omap-intc: remove PROP_PTR, Marc-André Lureau, 2019/12/20
- [PATCH v5 33/37] omap-i2c: remove PROP_PTR, Marc-André Lureau, 2019/12/20
- [PATCH v5 34/37] omap-gpio: remove PROP_PTR, Marc-André Lureau, 2019/12/20
- [PATCH v5 35/37] qdev: remove PROP_MEMORY_REGION, Marc-André Lureau, 2019/12/20
- [PATCH v5 36/37] qdev: remove QDEV_PROP_PTR, Marc-André Lureau, 2019/12/20
- [PATCH v5 37/37] qdev/qom: remove some TODO limitations now that PROP_PTR is gone, Marc-André Lureau, 2019/12/20