[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PULL 08/20] audio: don't use 'Yoda conditions'
From: |
Michael Tokarev |
Subject: |
[Qemu-trivial] [PULL 08/20] audio: don't use 'Yoda conditions' |
Date: |
Fri, 15 Aug 2014 19:14:59 +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>
---
hw/audio/gus.c | 2 +-
hw/audio/hda-codec.c | 3 ++-
hw/audio/sb16.c | 6 +++---
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/hw/audio/gus.c b/hw/audio/gus.c
index bba6840..4a43ce7 100644
--- a/hw/audio/gus.c
+++ b/hw/audio/gus.c
@@ -212,7 +212,7 @@ static int GUS_read_DMA (void *opaque, int nchan, int
dma_pos, int dma_len)
pos += copied;
}
- if (0 == ((mode >> 4) & 1)) {
+ if (((mode >> 4) & 1) == 0) {
DMA_release_DREQ (s->emu.gusdma);
}
return dma_len;
diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c
index cbcf521..3c03ff5 100644
--- a/hw/audio/hda-codec.c
+++ b/hw/audio/hda-codec.c
@@ -489,8 +489,9 @@ static int hda_audio_init(HDACodecDevice *hda, const struct
desc_codec *desc)
for (i = 0; i < a->desc->nnodes; i++) {
node = a->desc->nodes + i;
param = hda_codec_find_param(node, AC_PAR_AUDIO_WIDGET_CAP);
- if (NULL == param)
+ if (param == NULL) {
continue;
+ }
type = (param->val & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;
switch (type) {
case AC_WID_AUD_OUT:
diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c
index 60c4b3b..bda26d0 100644
--- a/hw/audio/sb16.c
+++ b/hw/audio/sb16.c
@@ -928,7 +928,7 @@ static IO_WRITE_PROTO (dsp_write)
/* if (s->highspeed) */
/* break; */
- if (0 == s->needed_bytes) {
+ if (s->needed_bytes == 0) {
command (s, val);
#if 0
if (0 == s->needed_bytes) {
@@ -1212,7 +1212,7 @@ static int SB_read_DMA (void *opaque, int nchan, int
dma_pos, int dma_len)
#endif
if (till <= copy) {
- if (0 == s->dma_auto) {
+ if (s->dma_auto == 0) {
copy = till;
}
}
@@ -1224,7 +1224,7 @@ static int SB_read_DMA (void *opaque, int nchan, int
dma_pos, int dma_len)
if (s->left_till_irq <= 0) {
s->mixer_regs[0x82] |= (nchan & 4) ? 2 : 1;
qemu_irq_raise (s->pic);
- if (0 == s->dma_auto) {
+ if (s->dma_auto == 0) {
control (s, 0);
speaker (s, 0);
}
--
1.7.10.4
- [Qemu-trivial] [PULL 00/20] Trivial patches for 2014-08-15, Michael Tokarev, 2014/08/15
- [Qemu-trivial] [PULL 08/20] audio: don't use 'Yoda conditions',
Michael Tokarev <=
- [Qemu-trivial] [PULL 02/20] memory: Update obsolete comment about AddrRange field type, Michael Tokarev, 2014/08/15
- [Qemu-trivial] [PULL 01/20] apic: Fix reported DFR content, Michael Tokarev, 2014/08/15
- [Qemu-trivial] [PULL 07/20] usb: don't use 'Yoda conditions', Michael Tokarev, 2014/08/15
- [Qemu-trivial] [PULL 06/20] CODING_STYLE: Section about conditional statement, Michael Tokarev, 2014/08/15
- [Qemu-trivial] [PULL 13/20] vmxnet3: don't use 'Yoda conditions', Michael Tokarev, 2014/08/15
- [Qemu-trivial] [PULL 19/20] l2cap: fix access to freed memory, Michael Tokarev, 2014/08/15
- [Qemu-trivial] [PULL 16/20] ssi: xilinx_spi: Initialise CS GPIOs as NULL, Michael Tokarev, 2014/08/15
- [Qemu-trivial] [PULL 14/20] qemu-options.hx: fix typo about l2tpv3, Michael Tokarev, 2014/08/15
- [Qemu-trivial] [PULL 20/20] ivshmem: check the value returned by fstat(), Michael Tokarev, 2014/08/15
- [Qemu-trivial] [PULL 12/20] vl: don't use 'Yoda conditions', Michael Tokarev, 2014/08/15