From d0657b2aab6f2a342aae2897e41d10061a9a6992 Mon Sep 17 00:00:00 2001 From: Gonglei Date: Mon, 11 Aug 2014 21:00:52 +0800 Subject: usb: don't use 'Yoda conditions' imitate nearby code about using '!value' or 'value == NULL' Signed-off-by: Gonglei Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- hw/usb/dev-audio.c | 2 +- hw/usb/dev-mtp.c | 4 ++-- hw/usb/hcd-ehci.c | 2 +- 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); } -- cgit v1.2.1