提交 8108fd3e 编写于 作者: G Gonglei 提交者: Michael Tokarev

don't use 'Yoda conditions'

imitate nearby code about using '!value' or 'value == NULL'
Signed-off-by: NGonglei <arei.gonglei@huawei.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
上级 337a3e5c
......@@ -694,7 +694,7 @@ void qmp_device_del(const char *id, Error **errp)
DeviceState *dev;
dev = qdev_find_recursive(sysbus_get_default(), id);
if (NULL == dev) {
if (!dev) {
error_set(errp, QERR_DEVICE_NOT_FOUND, id);
return;
}
......
......@@ -4121,7 +4121,7 @@ void qmp_chardev_remove(const char *id, Error **errp)
CharDriverState *chr;
chr = qemu_chr_find(id);
if (NULL == chr) {
if (chr == NULL) {
error_setg(errp, "Chardev '%s' not found", id);
return;
}
......
......@@ -732,7 +732,7 @@ int unix_connect_opts(QemuOpts *opts, Error **errp,
ConnectState *connect_state = NULL;
int sock, rc;
if (NULL == path) {
if (path == NULL) {
error_setg(errp, "unix connect: no path specified");
return -1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册