[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 05/25] hw/char/sh_serial: Rename type sh_serial_state to SHSer
From: |
BALATON Zoltan |
Subject: |
[PATCH v5 05/25] hw/char/sh_serial: Rename type sh_serial_state to SHSerialState |
Date: |
Fri, 29 Oct 2021 18:23:36 +0200 |
Coding style says types should be camel case.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
hw/char/sh_serial.c | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.c
index 2d6ea0042e..bc5e0c4404 100644
--- a/hw/char/sh_serial.c
+++ b/hw/char/sh_serial.c
@@ -73,9 +73,9 @@ typedef struct {
qemu_irq txi;
qemu_irq tei;
qemu_irq bri;
-} sh_serial_state;
+} SHSerialState;
-static void sh_serial_clear_fifo(sh_serial_state *s)
+static void sh_serial_clear_fifo(SHSerialState *s)
{
memset(s->rx_fifo, 0, SH_RX_FIFO_LENGTH);
s->rx_cnt = 0;
@@ -86,7 +86,7 @@ static void sh_serial_clear_fifo(sh_serial_state *s)
static void sh_serial_write(void *opaque, hwaddr offs,
uint64_t val, unsigned size)
{
- sh_serial_state *s = opaque;
+ SHSerialState *s = opaque;
unsigned char ch;
trace_sh_serial_write(size, offs, val);
@@ -204,7 +204,7 @@ static void sh_serial_write(void *opaque, hwaddr offs,
static uint64_t sh_serial_read(void *opaque, hwaddr offs,
unsigned size)
{
- sh_serial_state *s = opaque;
+ SHSerialState *s = opaque;
uint32_t ret = UINT32_MAX;
#if 0
@@ -309,12 +309,12 @@ static uint64_t sh_serial_read(void *opaque, hwaddr offs,
return ret;
}
-static int sh_serial_can_receive(sh_serial_state *s)
+static int sh_serial_can_receive(SHSerialState *s)
{
return s->scr & (1 << 4);
}
-static void sh_serial_receive_break(sh_serial_state *s)
+static void sh_serial_receive_break(SHSerialState *s)
{
if (s->feat & SH_SERIAL_FEAT_SCIF) {
s->sr |= (1 << 4);
@@ -323,13 +323,13 @@ static void sh_serial_receive_break(sh_serial_state *s)
static int sh_serial_can_receive1(void *opaque)
{
- sh_serial_state *s = opaque;
+ SHSerialState *s = opaque;
return sh_serial_can_receive(s);
}
static void sh_serial_timeout_int(void *opaque)
{
- sh_serial_state *s = opaque;
+ SHSerialState *s = opaque;
s->flags |= SH_SERIAL_FLAG_RDF;
if (s->scr & (1 << 6) && s->rxi) {
@@ -339,7 +339,7 @@ static void sh_serial_timeout_int(void *opaque)
static void sh_serial_receive1(void *opaque, const uint8_t *buf, int size)
{
- sh_serial_state *s = opaque;
+ SHSerialState *s = opaque;
if (s->feat & SH_SERIAL_FEAT_SCIF) {
int i;
@@ -369,7 +369,7 @@ static void sh_serial_receive1(void *opaque, const uint8_t
*buf, int size)
static void sh_serial_event(void *opaque, QEMUChrEvent event)
{
- sh_serial_state *s = opaque;
+ SHSerialState *s = opaque;
if (event == CHR_EVENT_BREAK) {
sh_serial_receive_break(s);
}
@@ -390,9 +390,7 @@ void sh_serial_init(MemoryRegion *sysmem,
qemu_irq tei_source,
qemu_irq bri_source)
{
- sh_serial_state *s;
-
- s = g_malloc0(sizeof(sh_serial_state));
+ SHSerialState *s = g_malloc0(sizeof(*s));
s->feat = feat;
s->flags = SH_SERIAL_FLAG_TEND | SH_SERIAL_FLAG_TDE;
--
2.21.4
- [PATCH v5 00/25] More SH4 clean ups, BALATON Zoltan, 2021/10/29
- [PATCH v5 04/25] hw/char/sh_serial: Do not abort on invalid access, BALATON Zoltan, 2021/10/29
- [PATCH v5 02/25] hw/sh4: Change debug printfs to traces, BALATON Zoltan, 2021/10/29
- [PATCH v5 06/25] hw/char/sh_serial: Embed QEMUTimer in state struct, BALATON Zoltan, 2021/10/29
- [PATCH v5 03/25] hw/sh4/r2d: Use error_report instead of fprintf to stderr, BALATON Zoltan, 2021/10/29
- [PATCH v5 18/25] hw/intc/sh_intc: Replace abort() with g_assert_not_reached(), BALATON Zoltan, 2021/10/29
- [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 <=
- [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, 2021/10/29
- [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