aboutsummaryrefslogtreecommitdiff
path: root/hw/timer
diff options
context:
space:
mode:
authorBALATON Zoltan <balaton@eik.bme.hu>2021-10-29 23:02:09 +0200
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2021-10-30 11:46:40 +0200
commitac3c9e74c1ee1071e5be692a611c5ee261b9b581 (patch)
treec64ce8e8b2af3087b414f16a6b16ad916d5d85e1 /hw/timer
parentf94bff1337ff525e2ff458b8e4cd57f9561acde3 (diff)
downloadqemu-ac3c9e74c1ee1071e5be692a611c5ee261b9b581.zip
qemu-ac3c9e74c1ee1071e5be692a611c5ee261b9b581.tar.gz
qemu-ac3c9e74c1ee1071e5be692a611c5ee261b9b581.tar.bz2
hw/sh4: Coding style: Add missing braces
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Yoshinori Sato <ysato@users.sourceforge.jp> Message-Id: <b53a8cbcf57207fbd6408db1007b3e82008d60f7.1635541329.git.balaton@eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'hw/timer')
-rw-r--r--hw/timer/sh_timer.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.c
index 01afcbd..68c109e 100644
--- a/hw/timer/sh_timer.c
+++ b/hw/timer/sh_timer.c
@@ -54,9 +54,9 @@ static void sh_timer_update(sh_timer_state *s)
{
int new_level = s->int_level && (s->tcr & TIMER_TCR_UNIE);
- if (new_level != s->old_level)
+ if (new_level != s->old_level) {
qemu_set_irq(s->irq, new_level);
-
+ }
s->old_level = s->int_level;
s->int_level = new_level;
}
@@ -73,8 +73,9 @@ static uint32_t sh_timer_read(void *opaque, hwaddr offset)
case OFFSET_TCR:
return s->tcr | (s->int_level ? TIMER_TCR_UNF : 0);
case OFFSET_TCPR:
- if (s->feat & TIMER_FEAT_CAPT)
+ if (s->feat & TIMER_FEAT_CAPT) {
return s->tcpr;
+ }
/* fall through */
default:
hw_error("sh_timer_read: Bad offset %x\n", (int)offset);
@@ -279,17 +280,18 @@ static uint64_t tmu012_read(void *opaque, hwaddr offset,
return sh_timer_read(s->timer[2], offset - 0x20);
}
- if (offset >= 0x14)
+ if (offset >= 0x14) {
return sh_timer_read(s->timer[1], offset - 0x14);
-
- if (offset >= 0x08)
+ }
+ if (offset >= 0x08) {
return sh_timer_read(s->timer[0], offset - 0x08);
-
- if (offset == 4)
+ }
+ if (offset == 4) {
return s->tstr;
-
- if ((s->feat & TMU012_FEAT_TOCR) && offset == 0)
+ }
+ if ((s->feat & TMU012_FEAT_TOCR) && offset == 0) {
return s->tocr;
+ }
hw_error("tmu012_write: Bad offset %x\n", (int)offset);
return 0;