提交 f8687bab 编写于 作者: S Stefan Weil 提交者: malc

es1370: Fix debug code

When DEBUG_ES1370 is defined, the compiler shows these warnings:

hw/es1370.c: In function ?es1370_update_voices?:
hw/es1370.c:414: warning: format ?%d? expects type ?int?, but argument 3 has type ?size_t?
hw/es1370.c: In function ?es1370_writel?:
hw/es1370.c:582: warning: format ?%d? expects type ?int?, but argument 3 has type ?long int?
hw/es1370.c:592: warning: format ?%d? expects type ?int?, but argument 3 has type ?long int?
hw/es1370.c:609: warning: format ?%d? expects type ?int?, but argument 3 has type ?long int?
hw/es1370.c: In function ?es1370_readl?:
hw/es1370.c:751: warning: suggest braces around empty body in an ?if? statement

Fix the format strings and add the missing braces.
Signed-off-by: NStefan Weil <sw@weilnetz.de>
Signed-off-by: Nmalc <av1474@comtv.ru>
上级 c48b0c80
...@@ -410,7 +410,7 @@ static void es1370_update_voices (ES1370State *s, uint32_t ctl, uint32_t sctl) ...@@ -410,7 +410,7 @@ static void es1370_update_voices (ES1370State *s, uint32_t ctl, uint32_t sctl)
if ((old_fmt != new_fmt) || (old_freq != new_freq)) { if ((old_fmt != new_fmt) || (old_freq != new_freq)) {
d->shift = (new_fmt & 1) + (new_fmt >> 1); d->shift = (new_fmt & 1) + (new_fmt >> 1);
ldebug ("channel %d, freq = %d, nchannels %d, fmt %d, shift %d\n", ldebug ("channel %zu, freq = %d, nchannels %d, fmt %d, shift %d\n",
i, i,
new_freq, new_freq,
1 << (new_fmt & 1), 1 << (new_fmt & 1),
...@@ -578,7 +578,7 @@ IO_WRITE_PROTO (es1370_writel) ...@@ -578,7 +578,7 @@ IO_WRITE_PROTO (es1370_writel)
d++; d++;
case ES1370_REG_DAC1_SCOUNT: case ES1370_REG_DAC1_SCOUNT:
d->scount = (val & 0xffff) | (d->scount & ~0xffff); d->scount = (val & 0xffff) | (d->scount & ~0xffff);
ldebug ("chan %d CURR_SAMP_CT %d, SAMP_CT %d\n", ldebug ("chan %td CURR_SAMP_CT %d, SAMP_CT %d\n",
d - &s->chan[0], val >> 16, (val & 0xffff)); d - &s->chan[0], val >> 16, (val & 0xffff));
break; break;
...@@ -588,7 +588,7 @@ IO_WRITE_PROTO (es1370_writel) ...@@ -588,7 +588,7 @@ IO_WRITE_PROTO (es1370_writel)
d++; d++;
case ES1370_REG_DAC1_FRAMEADR: case ES1370_REG_DAC1_FRAMEADR:
d->frame_addr = val; d->frame_addr = val;
ldebug ("chan %d frame address %#x\n", d - &s->chan[0], val); ldebug ("chan %td frame address %#x\n", d - &s->chan[0], val);
break; break;
case ES1370_REG_PHANTOM_FRAMECNT: case ES1370_REG_PHANTOM_FRAMECNT:
...@@ -605,7 +605,7 @@ IO_WRITE_PROTO (es1370_writel) ...@@ -605,7 +605,7 @@ IO_WRITE_PROTO (es1370_writel)
case ES1370_REG_DAC1_FRAMECNT: case ES1370_REG_DAC1_FRAMECNT:
d->frame_cnt = val; d->frame_cnt = val;
d->leftover = 0; d->leftover = 0;
ldebug ("chan %d frame count %d, buffer size %d\n", ldebug ("chan %td frame count %d, buffer size %d\n",
d - &s->chan[0], val >> 16, val & 0xffff); d - &s->chan[0], val >> 16, val & 0xffff);
break; break;
...@@ -745,9 +745,10 @@ IO_READ_PROTO (es1370_readl) ...@@ -745,9 +745,10 @@ IO_READ_PROTO (es1370_readl)
{ {
uint32_t size = ((d->frame_cnt & 0xffff) + 1) << 2; uint32_t size = ((d->frame_cnt & 0xffff) + 1) << 2;
uint32_t curr = ((d->frame_cnt >> 16) + 1) << 2; uint32_t curr = ((d->frame_cnt >> 16) + 1) << 2;
if (curr > size) if (curr > size) {
dolog ("read framecnt curr %d, size %d %d\n", curr, size, dolog ("read framecnt curr %d, size %d %d\n", curr, size,
curr > size); curr > size);
}
} }
#endif #endif
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册