projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e23ae61
)
qdev: use g_strcmp0() instead of open-coding it
author
Marc-André Lureau
<marcandre.lureau@redhat.com>
Wed, 20 Nov 2019 13:42:01 +0000
(17:42 +0400)
committer
Marc-André Lureau
<marcandre.lureau@redhat.com>
Tue, 7 Jan 2020 13:24:29 +0000
(17:24 +0400)
Minor code simplification.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
hw/core/qdev.c
patch
|
blob
|
history
diff --git
a/hw/core/qdev.c
b/hw/core/qdev.c
index 501228ba08f196afed9626a2afeac5cb9ded350f..aa3ccbf2ecdbabb18033a6ad3c8dc6bcd2df3d78 100644
(file)
--- 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;
}
}