[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 22/25] hw/timer/sh_timer: Rename sh_timer_state to SHTimerStat
From: |
BALATON Zoltan |
Subject: |
[PATCH v5 22/25] hw/timer/sh_timer: Rename sh_timer_state to SHTimerState |
Date: |
Fri, 29 Oct 2021 18:23:36 +0200 |
According to coding style types should be camel case, also remove
unneded casts from void *.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
The tmu012_state is left for now, that's the real exported object with
SHTimerState being an internal object for a single timer. I'll come
back to this when QOM-ifying so only handled SHTimerState in this patch.
hw/timer/sh_timer.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.c
index e1b6145df8..2038adfb0a 100644
--- a/hw/timer/sh_timer.c
+++ b/hw/timer/sh_timer.c
@@ -45,11 +45,11 @@ typedef struct {
int feat;
int enabled;
qemu_irq irq;
-} sh_timer_state;
+} SHTimerState;
/* Check all active timers, and schedule the next timer interrupt. */
-static void sh_timer_update(sh_timer_state *s)
+static void sh_timer_update(SHTimerState *s)
{
int new_level = s->int_level && (s->tcr & TIMER_TCR_UNIE);
@@ -62,7 +62,7 @@ static void sh_timer_update(sh_timer_state *s)
static uint32_t sh_timer_read(void *opaque, hwaddr offset)
{
- sh_timer_state *s = (sh_timer_state *)opaque;
+ SHTimerState *s = opaque;
switch (offset >> 2) {
case OFFSET_TCOR:
@@ -85,7 +85,7 @@ static uint32_t sh_timer_read(void *opaque, hwaddr offset)
static void sh_timer_write(void *opaque, hwaddr offset,
uint32_t value)
{
- sh_timer_state *s = (sh_timer_state *)opaque;
+ SHTimerState *s = opaque;
int freq;
switch (offset >> 2) {
@@ -200,7 +200,7 @@ static void sh_timer_write(void *opaque, hwaddr offset,
static void sh_timer_start_stop(void *opaque, int enable)
{
- sh_timer_state *s = (sh_timer_state *)opaque;
+ SHTimerState *s = opaque;
trace_sh_timer_start_stop(enable, s->enabled);
ptimer_transaction_begin(s->timer);
@@ -216,14 +216,14 @@ static void sh_timer_start_stop(void *opaque, int enable)
static void sh_timer_tick(void *opaque)
{
- sh_timer_state *s = (sh_timer_state *)opaque;
+ SHTimerState *s = opaque;
s->int_level = s->enabled;
sh_timer_update(s);
}
static void *sh_timer_init(uint32_t freq, int feat, qemu_irq irq)
{
- sh_timer_state *s;
+ SHTimerState *s;
s = g_malloc0(sizeof(*s));
s->freq = freq;
@@ -259,7 +259,7 @@ typedef struct {
static uint64_t tmu012_read(void *opaque, hwaddr offset,
unsigned size)
{
- tmu012_state *s = (tmu012_state *)opaque;
+ tmu012_state *s = opaque;
trace_sh_timer_read(offset);
if (offset >= 0x20) {
@@ -289,7 +289,7 @@ static uint64_t tmu012_read(void *opaque, hwaddr offset,
static void tmu012_write(void *opaque, hwaddr offset,
uint64_t value, unsigned size)
{
- tmu012_state *s = (tmu012_state *)opaque;
+ tmu012_state *s = opaque;
trace_sh_timer_write(offset, value);
if (offset >= 0x20) {
--
2.21.4
- [PATCH v5 19/25] hw/intc/sh_intc: Avoid using continue in loops, (continued)
- [PATCH v5 19/25] hw/intc/sh_intc: Avoid using continue in loops, BALATON Zoltan, 2021/10/29
- [PATCH v5 13/25] hw/intc/sh_intc: Drop another useless macro, BALATON Zoltan, 2021/10/29
- [PATCH v5 17/25] hw/intc/sh_intc: Inline and drop sh_intc_source() function, BALATON Zoltan, 2021/10/29
- [PATCH v5 12/25] hw/intc/sh_intc: Rename iomem region, BALATON Zoltan, 2021/10/29
- [PATCH v5 05/25] hw/char/sh_serial: Rename type sh_serial_state to SHSerialState, BALATON Zoltan, 2021/10/29
- [PATCH v5 11/25] hw/intc/sh_intc: Turn some defines into an enum, BALATON Zoltan, 2021/10/29
- [PATCH v5 08/25] hw/char/sh_serial: QOM-ify, BALATON Zoltan, 2021/10/29
- [PATCH v5 01/25] hw/sh4: Fix typos in a comment, BALATON Zoltan, 2021/10/29
- [PATCH v5 20/25] hw/intc/sh_intc: Simplify allocating sources array, BALATON Zoltan, 2021/10/29
- [PATCH v5 25/25] hw/timer/sh_timer: Remove use of hw_error, BALATON Zoltan, 2021/10/29
- [PATCH v5 22/25] hw/timer/sh_timer: Rename sh_timer_state to SHTimerState,
BALATON Zoltan <=
- [PATCH v5 07/25] hw/char/sh_serial: Split off sh_serial_reset() from sh_serial_init(), BALATON Zoltan, 2021/10/29
- [PATCH v5 09/25] hw/char/sh_serial: Add device id to trace output, BALATON Zoltan, 2021/10/29
- [PATCH v5 10/25] hw/intc/sh_intc: Use existing macro instead of local one, BALATON Zoltan, 2021/10/29
- [PATCH v5 15/25] hw/intc/sh_intc: Remove excessive parenthesis, BALATON Zoltan, 2021/10/29
- [PATCH v5 14/25] hw/intc/sh_intc: Move sh_intc_register() closer to its only user, BALATON Zoltan, 2021/10/29
- [PATCH v5 16/25] hw/intc/sh_intc: Use array index instead of pointer arithmetics, BALATON Zoltan, 2021/10/29
- [PATCH v5 21/25] hw/intc/sh_intc: Remove unneeded local variable initialisers, BALATON Zoltan, 2021/10/29
- [PATCH v5 24/25] hw/timer/sh_timer: Fix timer memory region size, BALATON Zoltan, 2021/10/29
- [PATCH v5 23/25] hw/timer/sh_timer: Do not wrap lines that are not too long, BALATON Zoltan, 2021/10/29