From: Marc-André Lureau Date: Wed, 20 Nov 2019 13:42:01 +0000 (+0400) Subject: qdev: use g_strcmp0() instead of open-coding it X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3a87dde8a05978401fb846b6513503b9fd4186d9;p=qemu.git qdev: use g_strcmp0() instead of open-coding it Minor code simplification. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- 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; } }