qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: BALATON Zoltan <balaton@eik.bme.hu>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Richard Henderson <richard.henderson@linaro.org>,
	Magnus Damm <magnus.damm@gmail.com>,
	Yoshinori Sato <ysato@users.sourceforge.jp>
Subject: [PATCH v6 10/30] hw/char/sh_serial: Rename type sh_serial_state to SHSerialState
Date: Fri, 29 Oct 2021 23:02:09 +0200	[thread overview]
Message-ID: <0f185653528c99eeeb2b4e4afb8b818d93298c20.1635541329.git.balaton@eik.bme.hu> (raw)
In-Reply-To: <cover.1635541329.git.balaton@eik.bme.hu>

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



  parent reply	other threads:[~2021-10-29 21:47 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-29 21:02 [PATCH v6 00/30] More SH4 clean ups (including code style series) BALATON Zoltan
2021-10-29 21:02 ` [PATCH v6 13/30] hw/char/sh_serial: QOM-ify BALATON Zoltan
2021-10-29 22:36   ` Philippe Mathieu-Daudé
2021-10-29 23:44     ` BALATON Zoltan
2021-10-29 21:02 ` [PATCH v6 23/30] hw/intc/sh_intc: Replace abort() with g_assert_not_reached() BALATON Zoltan
2021-10-29 21:02 ` [PATCH v6 06/30] hw/sh4: Fix typos in a comment BALATON Zoltan
2021-10-29 21:02 ` [PATCH v6 02/30] hw/sh4: Coding style: Fix multi-line comments BALATON Zoltan
2021-10-29 21:02 ` [PATCH v6 29/30] hw/timer/sh_timer: Fix timer memory region size BALATON Zoltan
2021-10-29 22:26   ` Philippe Mathieu-Daudé
2021-10-29 23:36     ` BALATON Zoltan
2021-10-30  9:41       ` Philippe Mathieu-Daudé
2021-10-29 23:27   ` [PATCH v7 " BALATON Zoltan
2021-10-30  9:42     ` Philippe Mathieu-Daudé
2021-10-29 21:02 ` [PATCH v6 11/30] hw/char/sh_serial: Embed QEMUTimer in state struct BALATON Zoltan
2021-10-29 22:00   ` Philippe Mathieu-Daudé
2021-10-29 21:02 ` [PATCH v6 01/30] hw/sh4: Coding style: Remove tabs BALATON Zoltan
2021-10-29 21:02 ` [PATCH v6 08/30] hw/sh4/r2d: Use error_report instead of fprintf to stderr BALATON Zoltan
2021-10-29 21:02 ` [PATCH v6 04/30] hw/sh4: Coding style: Add missing braces BALATON Zoltan
2021-10-29 21:02 ` [PATCH v6 16/30] hw/intc/sh_intc: Turn some defines into an enum BALATON Zoltan
2021-10-30 10:42   ` Philippe Mathieu-Daudé
2021-10-29 21:02 ` [PATCH v6 26/30] hw/intc/sh_intc: Remove unneeded local variable initialisers BALATON Zoltan
2021-10-29 22:28   ` Philippe Mathieu-Daudé
2021-10-29 21:02 ` [PATCH v6 17/30] hw/intc/sh_intc: Rename iomem region BALATON Zoltan
2021-10-29 21:02 ` [PATCH v6 21/30] hw/intc/sh_intc: Use array index instead of pointer arithmetics BALATON Zoltan
2021-10-29 21:02 ` [PATCH v6 03/30] hw/sh4: Coding style: White space fixes BALATON Zoltan
2021-10-29 21:02 ` [PATCH v6 05/30] hw/sh4: Coding style: Remove unnecessary casts BALATON Zoltan
2021-10-29 21:02 ` [PATCH v6 09/30] hw/char/sh_serial: Do not abort on invalid access BALATON Zoltan
2021-10-29 21:02 ` [PATCH v6 14/30] hw/char/sh_serial: Add device id to trace output BALATON Zoltan
2021-10-29 21:02 ` [PATCH v6 30/30] hw/timer/sh_timer: Remove use of hw_error BALATON Zoltan
2021-10-29 22:06   ` Philippe Mathieu-Daudé
2021-10-29 23:39     ` BALATON Zoltan
2021-10-29 21:02 ` [PATCH v6 07/30] hw/sh4: Change debug printfs to traces BALATON Zoltan
2021-10-30 14:11   ` Philippe Mathieu-Daudé
2021-10-29 21:02 ` [PATCH v6 18/30] hw/intc/sh_intc: Drop another useless macro BALATON Zoltan
2021-10-29 21:02 ` [PATCH v6 24/30] hw/intc/sh_intc: Avoid using continue in loops BALATON Zoltan
2021-10-29 21:02 ` BALATON Zoltan [this message]
2021-10-29 21:02 ` [PATCH v6 27/30] hw/timer/sh_timer: Rename sh_timer_state to SHTimerState BALATON Zoltan
2021-10-29 21:02 ` [PATCH v6 20/30] hw/intc/sh_intc: Remove excessive parenthesis BALATON Zoltan
2021-10-29 21:02 ` [PATCH v6 19/30] hw/intc/sh_intc: Move sh_intc_register() closer to its only user BALATON Zoltan
2021-10-29 21:02 ` [PATCH v6 28/30] hw/timer/sh_timer: Do not wrap lines that are not too long BALATON Zoltan
2021-10-29 21:02 ` [PATCH v6 22/30] hw/intc/sh_intc: Inline and drop sh_intc_source() function BALATON Zoltan
2021-10-29 22:45   ` Philippe Mathieu-Daudé
2021-10-29 23:48     ` BALATON Zoltan
2021-10-30  9:45       ` Philippe Mathieu-Daudé
2021-10-29 21:02 ` [PATCH v6 12/30] hw/char/sh_serial: Split off sh_serial_reset() from sh_serial_init() BALATON Zoltan
2021-10-29 22:01   ` Philippe Mathieu-Daudé
2021-10-29 21:02 ` [PATCH v6 25/30] hw/intc/sh_intc: Simplify allocating sources array BALATON Zoltan
2021-10-29 22:06   ` Philippe Mathieu-Daudé
2021-10-29 21:02 ` [PATCH v6 15/30] hw/intc/sh_intc: Use existing macro instead of local one BALATON Zoltan
2021-10-29 21:57 ` [PATCH v6 00/30] More SH4 clean ups (including code style series) Philippe Mathieu-Daudé
2021-10-29 23:52   ` BALATON Zoltan
2021-10-30 10:05 ` Philippe Mathieu-Daudé
2021-10-30 11:50   ` BALATON Zoltan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0f185653528c99eeeb2b4e4afb8b818d93298c20.1635541329.git.balaton@eik.bme.hu \
    --to=balaton@eik.bme.hu \
    --cc=magnus.damm@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=ysato@users.sourceforge.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).