Skip to content

Commit

Permalink
audio: don't use 'Yoda conditions'
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
gongleiarei authored and Michael Tokarev committed Aug 15, 2014
1 parent d0657b2 commit 2ab5bf6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion hw/audio/gus.c
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion hw/audio/hda-codec.c
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions hw/audio/sb16.c
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 2ab5bf6

Please sign in to comment.