Re: [PATCH 1/2] Consistent function names for sifive uart read and write function

2021-05-11 Thread Bin Meng
Hi Lukas,

On Wed, May 5, 2021 at 12:49 AM Lukas Jünger
 wrote:
>

While we are here, could we make other functions sifive_ prefixed?

Also the commit title should include a tag of "hw/char: sifive_uart"

> Signed-off-by: Lukas Jünger 
> ---
>  hw/char/sifive_uart.c | 14 +++---
>  1 file changed, 7 insertions(+), 7 deletions(-)
>

Regards,
Bin



Re: [PATCH 1/2] Consistent function names for sifive uart read and write function

2021-05-11 Thread Luc Michel

On 5/4/21 5:34 PM, Lukas Jünger wrote:

Signed-off-by: Lukas Jünger 


Reviewed-by: Luc Michel 


---
  hw/char/sifive_uart.c | 14 +++---
  1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/hw/char/sifive_uart.c b/hw/char/sifive_uart.c
index 3a00ba7f00..cb70374ead 100644
--- a/hw/char/sifive_uart.c
+++ b/hw/char/sifive_uart.c
@@ -65,7 +65,7 @@ static void update_irq(SiFiveUARTState *s)
  }
  
  static uint64_t

-uart_read(void *opaque, hwaddr addr, unsigned int size)
+sifive_uart_read(void *opaque, hwaddr addr, unsigned int size)
  {
  SiFiveUARTState *s = opaque;
  unsigned char r;
@@ -101,8 +101,8 @@ uart_read(void *opaque, hwaddr addr, unsigned int size)
  }
  
  static void

-uart_write(void *opaque, hwaddr addr,
-   uint64_t val64, unsigned int size)
+sifive_uart_write(void *opaque, hwaddr addr,
+  uint64_t val64, unsigned int size)
  {
  SiFiveUARTState *s = opaque;
  uint32_t value = val64;
@@ -131,9 +131,9 @@ uart_write(void *opaque, hwaddr addr,
__func__, (int)addr, (int)value);
  }
  
-static const MemoryRegionOps uart_ops = {

-.read = uart_read,
-.write = uart_write,
+static const MemoryRegionOps sifive_uart_ops = {
+.read = sifive_uart_read,
+.write = sifive_uart_write,
  .endianness = DEVICE_NATIVE_ENDIAN,
  .valid = {
  .min_access_size = 4,
@@ -187,7 +187,7 @@ SiFiveUARTState *sifive_uart_create(MemoryRegion 
*address_space, hwaddr base,
  qemu_chr_fe_init(>chr, chr, _abort);
  qemu_chr_fe_set_handlers(>chr, uart_can_rx, uart_rx, uart_event,
  uart_be_change, s, NULL, true);
-memory_region_init_io(>mmio, NULL, _ops, s,
+memory_region_init_io(>mmio, NULL, _uart_ops, s,
TYPE_SIFIVE_UART, SIFIVE_UART_MAX);
  memory_region_add_subregion(address_space, base, >mmio);
  return s;





Re: [PATCH 1/2] Consistent function names for sifive uart read and write function

2021-05-05 Thread Alistair Francis
On Wed, May 5, 2021 at 2:50 AM Lukas Jünger  wrote:
>
> Signed-off-by: Lukas Jünger 

Reviewed-by: Alistair Francis 

Alistair

> ---
>  hw/char/sifive_uart.c | 14 +++---
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/hw/char/sifive_uart.c b/hw/char/sifive_uart.c
> index 3a00ba7f00..cb70374ead 100644
> --- a/hw/char/sifive_uart.c
> +++ b/hw/char/sifive_uart.c
> @@ -65,7 +65,7 @@ static void update_irq(SiFiveUARTState *s)
>  }
>
>  static uint64_t
> -uart_read(void *opaque, hwaddr addr, unsigned int size)
> +sifive_uart_read(void *opaque, hwaddr addr, unsigned int size)
>  {
>  SiFiveUARTState *s = opaque;
>  unsigned char r;
> @@ -101,8 +101,8 @@ uart_read(void *opaque, hwaddr addr, unsigned int size)
>  }
>
>  static void
> -uart_write(void *opaque, hwaddr addr,
> -   uint64_t val64, unsigned int size)
> +sifive_uart_write(void *opaque, hwaddr addr,
> +  uint64_t val64, unsigned int size)
>  {
>  SiFiveUARTState *s = opaque;
>  uint32_t value = val64;
> @@ -131,9 +131,9 @@ uart_write(void *opaque, hwaddr addr,
>__func__, (int)addr, (int)value);
>  }
>
> -static const MemoryRegionOps uart_ops = {
> -.read = uart_read,
> -.write = uart_write,
> +static const MemoryRegionOps sifive_uart_ops = {
> +.read = sifive_uart_read,
> +.write = sifive_uart_write,
>  .endianness = DEVICE_NATIVE_ENDIAN,
>  .valid = {
>  .min_access_size = 4,
> @@ -187,7 +187,7 @@ SiFiveUARTState *sifive_uart_create(MemoryRegion 
> *address_space, hwaddr base,
>  qemu_chr_fe_init(>chr, chr, _abort);
>  qemu_chr_fe_set_handlers(>chr, uart_can_rx, uart_rx, uart_event,
>  uart_be_change, s, NULL, true);
> -memory_region_init_io(>mmio, NULL, _ops, s,
> +memory_region_init_io(>mmio, NULL, _uart_ops, s,
>TYPE_SIFIVE_UART, SIFIVE_UART_MAX);
>  memory_region_add_subregion(address_space, base, >mmio);
>  return s;
> --
> 2.30.2
>
>



[PATCH 1/2] Consistent function names for sifive uart read and write function

2021-05-04 Thread Lukas Jünger
Signed-off-by: Lukas Jünger 
---
 hw/char/sifive_uart.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/hw/char/sifive_uart.c b/hw/char/sifive_uart.c
index 3a00ba7f00..cb70374ead 100644
--- a/hw/char/sifive_uart.c
+++ b/hw/char/sifive_uart.c
@@ -65,7 +65,7 @@ static void update_irq(SiFiveUARTState *s)
 }
 
 static uint64_t
-uart_read(void *opaque, hwaddr addr, unsigned int size)
+sifive_uart_read(void *opaque, hwaddr addr, unsigned int size)
 {
 SiFiveUARTState *s = opaque;
 unsigned char r;
@@ -101,8 +101,8 @@ uart_read(void *opaque, hwaddr addr, unsigned int size)
 }
 
 static void
-uart_write(void *opaque, hwaddr addr,
-   uint64_t val64, unsigned int size)
+sifive_uart_write(void *opaque, hwaddr addr,
+  uint64_t val64, unsigned int size)
 {
 SiFiveUARTState *s = opaque;
 uint32_t value = val64;
@@ -131,9 +131,9 @@ uart_write(void *opaque, hwaddr addr,
   __func__, (int)addr, (int)value);
 }
 
-static const MemoryRegionOps uart_ops = {
-.read = uart_read,
-.write = uart_write,
+static const MemoryRegionOps sifive_uart_ops = {
+.read = sifive_uart_read,
+.write = sifive_uart_write,
 .endianness = DEVICE_NATIVE_ENDIAN,
 .valid = {
 .min_access_size = 4,
@@ -187,7 +187,7 @@ SiFiveUARTState *sifive_uart_create(MemoryRegion 
*address_space, hwaddr base,
 qemu_chr_fe_init(>chr, chr, _abort);
 qemu_chr_fe_set_handlers(>chr, uart_can_rx, uart_rx, uart_event,
 uart_be_change, s, NULL, true);
-memory_region_init_io(>mmio, NULL, _ops, s,
+memory_region_init_io(>mmio, NULL, _uart_ops, s,
   TYPE_SIFIVE_UART, SIFIVE_UART_MAX);
 memory_region_add_subregion(address_space, base, >mmio);
 return s;
-- 
2.30.2