mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-14 21:52:18 -06:00
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>
This commit is contained in:
parent
e23ae617f6
commit
3a87dde8a0
1 changed files with 2 additions and 5 deletions
|
@ -394,11 +394,8 @@ static NamedGPIOList *qdev_get_named_gpio_list(DeviceState *dev,
|
||||||
NamedGPIOList *ngl;
|
NamedGPIOList *ngl;
|
||||||
|
|
||||||
QLIST_FOREACH(ngl, &dev->gpios, node) {
|
QLIST_FOREACH(ngl, &dev->gpios, node) {
|
||||||
/* NULL is a valid and matchable name, otherwise do a normal
|
/* NULL is a valid and matchable name. */
|
||||||
* strcmp match.
|
if (g_strcmp0(name, ngl->name) == 0) {
|
||||||
*/
|
|
||||||
if ((!ngl->name && !name) ||
|
|
||||||
(name && ngl->name && strcmp(name, ngl->name) == 0)) {
|
|
||||||
return ngl;
|
return ngl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue