aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGonglei <arei.gonglei@huawei.com>2014-08-11 21:00:55 +0800
committerMichael Tokarev <mjt@tls.msk.ru>2014-08-15 18:54:07 +0400
commit8108fd3e26236c14138b87e1081ec2b7b86e5132 (patch)
tree374263bdd5fbdb8102c271c0aa3b026a8e88ec12
parent337a3e5c7d3b5a5731f6e89f055e645ae6b9f40e (diff)
don't use 'Yoda conditions'
imitate nearby code about using '!value' or 'value == NULL' Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
-rw-r--r--qdev-monitor.c2
-rw-r--r--qemu-char.c2
-rw-r--r--util/qemu-sockets.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/qdev-monitor.c b/qdev-monitor.c
index f87f3d89cd..81a4e9b27f 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -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;
}
diff --git a/qemu-char.c b/qemu-char.c
index 6964a2d9fd..3dcc39adf8 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -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;
}
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index 74cf0786e5..5d38395f2d 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -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;
}