summaryrefslogtreecommitdiffstats
path: root/hw/usb
diff options
context:
space:
mode:
authorGonglei2014-08-11 15:00:52 +0200
committerMichael Tokarev2014-08-15 16:54:06 +0200
commitd0657b2aab6f2a342aae2897e41d10061a9a6992 (patch)
tree089fa37202d2689061295f0228db7ec1ad17737d /hw/usb
parentCODING_STYLE: Section about conditional statement (diff)
downloadqemu-d0657b2aab6f2a342aae2897e41d10061a9a6992.tar.gz
qemu-d0657b2aab6f2a342aae2897e41d10061a9a6992.tar.xz
qemu-d0657b2aab6f2a342aae2897e41d10061a9a6992.zip
usb: 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>
Diffstat (limited to 'hw/usb')
-rw-r--r--hw/usb/dev-audio.c2
-rw-r--r--hw/usb/dev-mtp.c4
-rw-r--r--hw/usb/hcd-ehci.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c
index bfebfe90f3..7b9957b3c3 100644
--- a/hw/usb/dev-audio.c
+++ b/hw/usb/dev-audio.c
@@ -371,7 +371,7 @@ static void output_callback(void *opaque, int avail)
return;
}
data = streambuf_get(&s->out.buf);
- if (NULL == data) {
+ if (!data) {
return;
}
AUD_write(s->out.voice, data, USBAUDIO_PACKET_SIZE);
diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 384d4a5ac5..0820046906 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -832,7 +832,7 @@ static void usb_mtp_command(MTPState *s, MTPControl *c)
return;
}
data_in = usb_mtp_get_object(s, c, o);
- if (NULL == data_in) {
+ if (data_in == NULL) {
usb_mtp_queue_result(s, RES_GENERAL_ERROR,
c->trans, 0, 0, 0);
return;
@@ -851,7 +851,7 @@ static void usb_mtp_command(MTPState *s, MTPControl *c)
return;
}
data_in = usb_mtp_get_partial_object(s, c, o);
- if (NULL == data_in) {
+ if (data_in == NULL) {
usb_mtp_queue_result(s, RES_GENERAL_ERROR,
c->trans, 0, 0, 0);
return;
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index a00a93c3eb..448e0073dd 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -1596,7 +1596,7 @@ static EHCIQueue *ehci_state_fetchqh(EHCIState *ehci, int async)
entry = ehci_get_fetch_addr(ehci, async);
q = ehci_find_queue_by_qh(ehci, entry, async);
- if (NULL == q) {
+ if (q == NULL) {
q = ehci_alloc_queue(ehci, entry, async);
}