[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/8] hw/audio/es1370: block structure coding style fixes
From: |
Volker Rümelin |
Subject: |
[PATCH 6/8] hw/audio/es1370: block structure coding style fixes |
Date: |
Sun, 17 Sep 2023 08:58:11 +0200 |
Change the block structure according to the QEMU Coding Style
documentation.
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
---
hw/audio/es1370.c | 36 ++++++++++++++++--------------------
1 file changed, 16 insertions(+), 20 deletions(-)
diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
index e1ca6a4cd5..86a869d4da 100644
--- a/hw/audio/es1370.c
+++ b/hw/audio/es1370.c
@@ -309,8 +309,7 @@ static void es1370_update_status (ES1370State *s, uint32_t
new_status)
if (level) {
s->status = new_status | STAT_INTR;
- }
- else {
+ } else {
s->status = new_status & ~STAT_INTR;
}
pci_set_irq(&s->dev, !!level);
@@ -333,8 +332,7 @@ static void es1370_reset (ES1370State *s)
if (i == ADC_CHANNEL) {
AUD_close_in (&s->card, s->adc_voice);
s->adc_voice = NULL;
- }
- else {
+ } else {
AUD_close_out (&s->card, s->dac_voice[i]);
s->dac_voice[i] = NULL;
}
@@ -421,8 +419,7 @@ static void es1370_update_voices (ES1370State *s, uint32_t
ctl, uint32_t sctl)
es1370_adc_callback,
&as
);
- }
- else {
+ } else {
s->dac_voice[i] =
AUD_open_out (
&s->card,
@@ -442,8 +439,7 @@ static void es1370_update_voices (ES1370State *s, uint32_t
ctl, uint32_t sctl)
if (i == ADC_CHANNEL) {
AUD_set_active_in (s->adc_voice, on);
- }
- else {
+ } else {
AUD_set_active_out (s->dac_voice[i], on);
}
}
@@ -456,8 +452,9 @@ static void es1370_update_voices (ES1370State *s, uint32_t
ctl, uint32_t sctl)
static inline uint32_t es1370_fixup (ES1370State *s, uint32_t addr)
{
addr &= 0xff;
- if (addr >= 0x30 && addr <= 0x3f)
+ if (addr >= 0x30 && addr <= 0x3f) {
addr |= s->mempage << 8;
+ }
return addr;
}
@@ -630,8 +627,9 @@ static void es1370_transfer_audio (ES1370State *s, struct
chan *d, int loop_sel,
to_copy = MIN ((size_t) temp, sizeof (tmpbuf));
acquired = AUD_read (s->adc_voice, tmpbuf, to_copy);
- if (!acquired)
+ if (!acquired) {
break;
+ }
pci_dma_write (&s->dev, addr, tmpbuf, acquired);
@@ -639,8 +637,7 @@ static void es1370_transfer_audio (ES1370State *s, struct
chan *d, int loop_sel,
addr += acquired;
transferred += acquired;
}
- }
- else {
+ } else {
SWVoiceOut *voice = s->dac_voice[index];
while (temp > 0) {
@@ -649,8 +646,9 @@ static void es1370_transfer_audio (ES1370State *s, struct
chan *d, int loop_sel,
to_copy = MIN ((size_t) temp, sizeof (tmpbuf));
pci_dma_read (&s->dev, addr, tmpbuf, to_copy);
copied = AUD_write (voice, tmpbuf, to_copy);
- if (!copied)
+ if (!copied) {
break;
+ }
temp -= copied;
addr += copied;
transferred += copied;
@@ -660,8 +658,7 @@ static void es1370_transfer_audio (ES1370State *s, struct
chan *d, int loop_sel,
if (csc_bytes == transferred) {
*irq = 1;
d->scount = sc | (sc << 16);
- }
- else {
+ } else {
*irq = 0;
d->scount = sc | (((csc_bytes - transferred - 1) >> d->shift) << 16);
}
@@ -672,12 +669,12 @@ static void es1370_transfer_audio (ES1370State *s, struct
chan *d, int loop_sel,
/* Bah, how stupid is that having a 0 represent true value?
i just spent few hours on this shit */
AUD_log ("es1370: warning", "non looping mode\n");
- }
- else {
+ } else {
d->frame_cnt = size;
- if ((uint32_t) cnt <= d->frame_cnt)
+ if ((uint32_t) cnt <= d->frame_cnt) {
d->frame_cnt |= cnt << 16;
+ }
}
d->leftover = (transferred + d->leftover) & 3;
@@ -778,8 +775,7 @@ static int es1370_post_load (void *opaque, int version_id)
AUD_close_in (&s->card, s->adc_voice);
s->adc_voice = NULL;
}
- }
- else {
+ } else {
if (s->dac_voice[i]) {
AUD_close_out (&s->card, s->dac_voice[i]);
s->dac_voice[i] = NULL;
--
2.35.3
- [PATCH 0/8] hw/audio/es1370: bug fix, Volker Rümelin, 2023/09/17
- [PATCH 1/8] hw/audio/es1370: reset current sample counter, Volker Rümelin, 2023/09/17
- [PATCH 2/8] hw/audio/es1370: replace bit-rotted code with tracepoints, Volker Rümelin, 2023/09/17
- [PATCH 5/8] hw/audio/es1370: remove #ifdef ES1370_VERBOSE to avoid bit rot, Volker Rümelin, 2023/09/17
- [PATCH 3/8] hw/audio/es1370: remove unused dolog macro, Volker Rümelin, 2023/09/17
- [PATCH 4/8] hw/audio/es1370: remove #ifdef ES1370_DEBUG to avoid bit rot, Volker Rümelin, 2023/09/17
- [PATCH 6/8] hw/audio/es1370: block structure coding style fixes,
Volker Rümelin <=
- [PATCH 8/8] hw/audio/es1370: trace lost interrupts, Volker Rümelin, 2023/09/17
- [PATCH 7/8] hw/audio/es1370: change variable type and name, Volker Rümelin, 2023/09/17
- Re: [PATCH 0/8] hw/audio/es1370: bug fix, Marc-André Lureau, 2023/09/18