[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/20] don't use 'Yoda conditions'
From: |
Michael Tokarev |
Subject: |
[Qemu-devel] [PULL 10/20] don't use 'Yoda conditions' |
Date: |
Fri, 15 Aug 2014 19:15:01 +0400 |
From: Gonglei <address@hidden>
imitate nearby code about using '!value' or 'value == NULL'
Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
qdev-monitor.c | 2 +-
qemu-char.c | 2 +-
util/qemu-sockets.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/qdev-monitor.c b/qdev-monitor.c
index f87f3d8..81a4e9b 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 6964a2d..3dcc39a 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 74cf078..5d38395 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;
}
--
1.7.10.4
- [Qemu-devel] [PULL 19/20] l2cap: fix access to freed memory, (continued)
- [Qemu-devel] [PULL 19/20] l2cap: fix access to freed memory, Michael Tokarev, 2014/08/15
- [Qemu-devel] [PULL 14/20] qemu-options.hx: fix typo about l2tpv3, Michael Tokarev, 2014/08/15
- [Qemu-devel] [PULL 16/20] ssi: xilinx_spi: Initialise CS GPIOs as NULL, Michael Tokarev, 2014/08/15
- [Qemu-devel] [PULL 20/20] ivshmem: check the value returned by fstat(), Michael Tokarev, 2014/08/15
- [Qemu-devel] [PULL 12/20] vl: don't use 'Yoda conditions', Michael Tokarev, 2014/08/15
- [Qemu-devel] [PULL 11/20] spice: don't use 'Yoda conditions', Michael Tokarev, 2014/08/15
- [Qemu-devel] [PULL 04/20] pci-host: update obsolete reference about piix_pci.c, Michael Tokarev, 2014/08/15
- [Qemu-devel] [PULL 09/20] isa-bus: don't use 'Yoda conditions', Michael Tokarev, 2014/08/15
- [Qemu-devel] [PULL 03/20] qemu-options.hx: fix a typo of chardev, Michael Tokarev, 2014/08/15
- [Qemu-devel] [PULL 05/20] pci-host: update uncorresponding description, Michael Tokarev, 2014/08/15
- [Qemu-devel] [PULL 10/20] don't use 'Yoda conditions',
Michael Tokarev <=
- [Qemu-devel] [PULL 18/20] intc: i8259: Convert Array allocation to g_new0, Michael Tokarev, 2014/08/15
- [Qemu-devel] [PULL 17/20] ppc: convert g_new(qemu_irq usages to g_new0, Michael Tokarev, 2014/08/15
- [Qemu-devel] [PULL 15/20] vl: free err, Michael Tokarev, 2014/08/15
- Re: [Qemu-devel] [PULL 00/20] Trivial patches for 2014-08-15, Peter Maydell, 2014/08/18