summary refs log tree commit diff stats
path: root/hw/core/qdev.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-11-20 17:42:01 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2020-01-07 17:24:29 +0400
commit3a87dde8a05978401fb846b6513503b9fd4186d9 (patch)
tree8a6697740f60b575a062da1032e21343bd2ef211 /hw/core/qdev.c
parente23ae617f68420248a978c1040686658a34a7f95 (diff)
downloadfocaccia-qemu-3a87dde8a05978401fb846b6513503b9fd4186d9.tar.gz
focaccia-qemu-3a87dde8a05978401fb846b6513503b9fd4186d9.zip
qdev: use g_strcmp0() instead of open-coding it
Minor code simplification.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'hw/core/qdev.c')
-rw-r--r--hw/core/qdev.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 501228ba08..aa3ccbf2ec 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;
         }
     }