mirror of https://gitlab.com/qemu-project/qemu
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>
This commit is contained in:
parent
2bb0020cf9
commit
d0657b2aab
|
@ -371,7 +371,7 @@ static void output_callback(void *opaque, int avail)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
data = streambuf_get(&s->out.buf);
|
data = streambuf_get(&s->out.buf);
|
||||||
if (NULL == data) {
|
if (!data) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AUD_write(s->out.voice, data, USBAUDIO_PACKET_SIZE);
|
AUD_write(s->out.voice, data, USBAUDIO_PACKET_SIZE);
|
||||||
|
|
|
@ -832,7 +832,7 @@ static void usb_mtp_command(MTPState *s, MTPControl *c)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
data_in = usb_mtp_get_object(s, c, o);
|
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,
|
usb_mtp_queue_result(s, RES_GENERAL_ERROR,
|
||||||
c->trans, 0, 0, 0);
|
c->trans, 0, 0, 0);
|
||||||
return;
|
return;
|
||||||
|
@ -851,7 +851,7 @@ static void usb_mtp_command(MTPState *s, MTPControl *c)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
data_in = usb_mtp_get_partial_object(s, c, o);
|
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,
|
usb_mtp_queue_result(s, RES_GENERAL_ERROR,
|
||||||
c->trans, 0, 0, 0);
|
c->trans, 0, 0, 0);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1596,7 +1596,7 @@ static EHCIQueue *ehci_state_fetchqh(EHCIState *ehci, int async)
|
||||||
|
|
||||||
entry = ehci_get_fetch_addr(ehci, async);
|
entry = ehci_get_fetch_addr(ehci, async);
|
||||||
q = ehci_find_queue_by_qh(ehci, entry, async);
|
q = ehci_find_queue_by_qh(ehci, entry, async);
|
||||||
if (NULL == q) {
|
if (q == NULL) {
|
||||||
q = ehci_alloc_queue(ehci, entry, async);
|
q = ehci_alloc_queue(ehci, entry, async);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue