[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/58] util/qemu-sockets: revert Yoda Conditions to n
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 02/58] util/qemu-sockets: revert Yoda Conditions to normal |
Date: |
Tue, 13 Sep 2016 19:15:33 +0200 |
From: Cao jin <address@hidden>
Follow CODING_STYLE
Cc: Daniel P. Berrange <address@hidden>
Cc: Gerd Hoffmann <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Signed-off-by: Cao jin <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
util/qemu-sockets.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index 2aed799..9fa0156 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -491,7 +491,7 @@ static int inet_dgram_saddr(InetSocketAddress *sraddr,
goto err;
}
- if (0 != (rc = getaddrinfo(addr, port, &ai, &peer))) {
+ if ((rc = getaddrinfo(addr, port, &ai, &peer)) != 0) {
error_setg(errp, "address resolution failed for %s:%s: %s", addr, port,
gai_strerror(rc));
goto err;
@@ -517,7 +517,7 @@ static int inet_dgram_saddr(InetSocketAddress *sraddr,
port = "0";
}
- if (0 != (rc = getaddrinfo(addr, port, &ai, &local))) {
+ if ((rc = getaddrinfo(addr, port, &ai, &local)) != 0) {
error_setg(errp, "address resolution failed for %s:%s: %s", addr, port,
gai_strerror(rc));
goto err;
@@ -573,20 +573,20 @@ InetSocketAddress *inet_parse(const char *str, Error
**errp)
if (str[0] == ':') {
/* no host given */
host[0] = '\0';
- if (1 != sscanf(str, ":%32[^,]%n", port, &pos)) {
+ if (sscanf(str, ":%32[^,]%n", port, &pos) != 1) {
error_setg(errp, "error parsing port in address '%s'", str);
goto fail;
}
} else if (str[0] == '[') {
/* IPv6 addr */
- if (2 != sscanf(str, "[%64[^]]]:%32[^,]%n", host, port, &pos)) {
+ if (sscanf(str, "[%64[^]]]:%32[^,]%n", host, port, &pos) != 2) {
error_setg(errp, "error parsing IPv6 address '%s'", str);
goto fail;
}
addr->ipv6 = addr->has_ipv6 = true;
} else {
/* hostname or IPv4 addr */
- if (2 != sscanf(str, "%64[^:]:%32[^,]%n", host, port, &pos)) {
+ if (sscanf(str, "%64[^:]:%32[^,]%n", host, port, &pos) != 2) {
error_setg(errp, "error parsing address '%s'", str);
goto fail;
}
--
1.8.3.1
- [Qemu-devel] [PULL 00/58] First round of misc patches for QEMU 2.8, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 01/58] qtail: clean up direct access to tqe_prev field, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 04/58] tcg: Pass last_tb by value to tb_find_fast(), Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 03/58] util: fix some coding style issue, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 05/58] tcg: Prepare safe tb_jmp_cache lookup out of tb_lock, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 08/58] tcg: set up tb->page_addr before insertion, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 02/58] util/qemu-sockets: revert Yoda Conditions to normal,
Paolo Bonzini <=
- [Qemu-devel] [PULL 07/58] tcg: Prepare TB invalidation for lockless TB lookup, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 11/58] tcg: Merge tb_find_slow() and tb_find_fast(), Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 09/58] tcg: cpu-exec: remove tb_lock from the hot-path, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 12/58] tcg: rename tb_find_physical(), Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 06/58] tcg: Prepare safe access to tb_flushed out of tb_lock, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 10/58] tcg: Avoid bouncing tb_lock between tb_gen_code() and tb_add_jump(), Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 13/58] rules.mak: Don't extract libs from .mo-libs in link command, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 14/58] timer: update comments, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 15/58] cpus: rename local variable to meaningful one, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 21/58] lsi: never set DMA FIFO Empty (DFE) bit in DSTAT register, Paolo Bonzini, 2016/09/13