Re: [Qemu-devel] [PATCH] hw/display/tcx: Remove superfluous OBJECT() typecasts

2015-10-29 Thread Michael Tokarev
15.10.2015 11:54, Thomas Huth wrote:
> The tcx_initfn() function is already supplied with an
> Object *obj pointer, so there is no need to cast the
> state pointer back to an Object pointer all over the
> place. And while we're at it, also remove the superfluous
> "return;" statement in this function.

Applied to -trivial, thank you!

/mjt



Re: [Qemu-devel] [PATCH] hw/display/tcx: Remove superfluous OBJECT() typecasts

2015-10-19 Thread Markus Armbruster
Mark Cave-Ayland  writes:

> On 15/10/15 09:54, Thomas Huth wrote:
>
>> The tcx_initfn() function is already supplied with an
>> Object *obj pointer, so there is no need to cast the
>> state pointer back to an Object pointer all over the
>> place. And while we're at it, also remove the superfluous
>> "return;" statement in this function.
>> 
>> Signed-off-by: Thomas Huth 
[...]
> Acked-by: Mark Cave-Ayland 
>
> Note that I'm in the process of moving and therefore connectivity is
> going to be poor for the next week and a bit - happy for this to go via
> -trivial if that works for everyone?

Sure!



Re: [Qemu-devel] [PATCH] hw/display/tcx: Remove superfluous OBJECT() typecasts

2015-10-18 Thread Mark Cave-Ayland
On 15/10/15 09:54, Thomas Huth wrote:

> The tcx_initfn() function is already supplied with an
> Object *obj pointer, so there is no need to cast the
> state pointer back to an Object pointer all over the
> place. And while we're at it, also remove the superfluous
> "return;" statement in this function.
> 
> Signed-off-by: Thomas Huth 
> ---
>  hw/display/tcx.c | 26 --
>  1 file changed, 12 insertions(+), 14 deletions(-)
> 
> diff --git a/hw/display/tcx.c b/hw/display/tcx.c
> index bf119bc..d720ea6 100644
> --- a/hw/display/tcx.c
> +++ b/hw/display/tcx.c
> @@ -944,57 +944,55 @@ static void tcx_initfn(Object *obj)
>  SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
>  TCXState *s = TCX(obj);
>  
> -memory_region_init_ram(>rom, OBJECT(s), "tcx.prom", 
> FCODE_MAX_ROM_SIZE,
> +memory_region_init_ram(>rom, obj, "tcx.prom", FCODE_MAX_ROM_SIZE,
> _fatal);
>  memory_region_set_readonly(>rom, true);
>  sysbus_init_mmio(sbd, >rom);
>  
>  /* 2/STIP : Stippler */
> -memory_region_init_io(>stip, OBJECT(s), _stip_ops, s, "tcx.stip",
> +memory_region_init_io(>stip, obj, _stip_ops, s, "tcx.stip",
>TCX_STIP_NREGS);
>  sysbus_init_mmio(sbd, >stip);
>  
>  /* 3/BLIT : Blitter */
> -memory_region_init_io(>blit, OBJECT(s), _blit_ops, s, "tcx.blit",
> +memory_region_init_io(>blit, obj, _blit_ops, s, "tcx.blit",
>TCX_BLIT_NREGS);
>  sysbus_init_mmio(sbd, >blit);
>  
>  /* 5/RSTIP : Raw Stippler */
> -memory_region_init_io(>rstip, OBJECT(s), _rstip_ops, s, 
> "tcx.rstip",
> +memory_region_init_io(>rstip, obj, _rstip_ops, s, "tcx.rstip",
>TCX_RSTIP_NREGS);
>  sysbus_init_mmio(sbd, >rstip);
>  
>  /* 6/RBLIT : Raw Blitter */
> -memory_region_init_io(>rblit, OBJECT(s), _rblit_ops, s, 
> "tcx.rblit",
> +memory_region_init_io(>rblit, obj, _rblit_ops, s, "tcx.rblit",
>TCX_RBLIT_NREGS);
>  sysbus_init_mmio(sbd, >rblit);
>  
>  /* 7/TEC : ??? */
> -memory_region_init_io(>tec, OBJECT(s), _dummy_ops, s,
> -  "tcx.tec", TCX_TEC_NREGS);
> +memory_region_init_io(>tec, obj, _dummy_ops, s, "tcx.tec",
> +  TCX_TEC_NREGS);
>  sysbus_init_mmio(sbd, >tec);
>  
>  /* 8/CMAP : DAC */
> -memory_region_init_io(>dac, OBJECT(s), _dac_ops, s,
> -  "tcx.dac", TCX_DAC_NREGS);
> +memory_region_init_io(>dac, obj, _dac_ops, s, "tcx.dac",
> +  TCX_DAC_NREGS);
>  sysbus_init_mmio(sbd, >dac);
>  
>  /* 9/THC : Cursor */
> -memory_region_init_io(>thc, OBJECT(s), _thc_ops, s, "tcx.thc",
> +memory_region_init_io(>thc, obj, _thc_ops, s, "tcx.thc",
>TCX_THC_NREGS);
>  sysbus_init_mmio(sbd, >thc);
>  
>  /* 11/DHC : ??? */
> -memory_region_init_io(>dhc, OBJECT(s), _dummy_ops, s, "tcx.dhc",
> +memory_region_init_io(>dhc, obj, _dummy_ops, s, "tcx.dhc",
>TCX_DHC_NREGS);
>  sysbus_init_mmio(sbd, >dhc);
>  
>  /* 12/ALT : ??? */
> -memory_region_init_io(>alt, OBJECT(s), _dummy_ops, s, "tcx.alt",
> +memory_region_init_io(>alt, obj, _dummy_ops, s, "tcx.alt",
>TCX_ALT_NREGS);
>  sysbus_init_mmio(sbd, >alt);
> -
> -return;
>  }
>  
>  static void tcx_realizefn(DeviceState *dev, Error **errp)

Acked-by: Mark Cave-Ayland 

Note that I'm in the process of moving and therefore connectivity is
going to be poor for the next week and a bit - happy for this to go via
-trivial if that works for everyone?


ATB,

Mark.




[Qemu-devel] [PATCH] hw/display/tcx: Remove superfluous OBJECT() typecasts

2015-10-15 Thread Thomas Huth
The tcx_initfn() function is already supplied with an
Object *obj pointer, so there is no need to cast the
state pointer back to an Object pointer all over the
place. And while we're at it, also remove the superfluous
"return;" statement in this function.

Signed-off-by: Thomas Huth 
---
 hw/display/tcx.c | 26 --
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/hw/display/tcx.c b/hw/display/tcx.c
index bf119bc..d720ea6 100644
--- a/hw/display/tcx.c
+++ b/hw/display/tcx.c
@@ -944,57 +944,55 @@ static void tcx_initfn(Object *obj)
 SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
 TCXState *s = TCX(obj);
 
-memory_region_init_ram(>rom, OBJECT(s), "tcx.prom", FCODE_MAX_ROM_SIZE,
+memory_region_init_ram(>rom, obj, "tcx.prom", FCODE_MAX_ROM_SIZE,
_fatal);
 memory_region_set_readonly(>rom, true);
 sysbus_init_mmio(sbd, >rom);
 
 /* 2/STIP : Stippler */
-memory_region_init_io(>stip, OBJECT(s), _stip_ops, s, "tcx.stip",
+memory_region_init_io(>stip, obj, _stip_ops, s, "tcx.stip",
   TCX_STIP_NREGS);
 sysbus_init_mmio(sbd, >stip);
 
 /* 3/BLIT : Blitter */
-memory_region_init_io(>blit, OBJECT(s), _blit_ops, s, "tcx.blit",
+memory_region_init_io(>blit, obj, _blit_ops, s, "tcx.blit",
   TCX_BLIT_NREGS);
 sysbus_init_mmio(sbd, >blit);
 
 /* 5/RSTIP : Raw Stippler */
-memory_region_init_io(>rstip, OBJECT(s), _rstip_ops, s, "tcx.rstip",
+memory_region_init_io(>rstip, obj, _rstip_ops, s, "tcx.rstip",
   TCX_RSTIP_NREGS);
 sysbus_init_mmio(sbd, >rstip);
 
 /* 6/RBLIT : Raw Blitter */
-memory_region_init_io(>rblit, OBJECT(s), _rblit_ops, s, "tcx.rblit",
+memory_region_init_io(>rblit, obj, _rblit_ops, s, "tcx.rblit",
   TCX_RBLIT_NREGS);
 sysbus_init_mmio(sbd, >rblit);
 
 /* 7/TEC : ??? */
-memory_region_init_io(>tec, OBJECT(s), _dummy_ops, s,
-  "tcx.tec", TCX_TEC_NREGS);
+memory_region_init_io(>tec, obj, _dummy_ops, s, "tcx.tec",
+  TCX_TEC_NREGS);
 sysbus_init_mmio(sbd, >tec);
 
 /* 8/CMAP : DAC */
-memory_region_init_io(>dac, OBJECT(s), _dac_ops, s,
-  "tcx.dac", TCX_DAC_NREGS);
+memory_region_init_io(>dac, obj, _dac_ops, s, "tcx.dac",
+  TCX_DAC_NREGS);
 sysbus_init_mmio(sbd, >dac);
 
 /* 9/THC : Cursor */
-memory_region_init_io(>thc, OBJECT(s), _thc_ops, s, "tcx.thc",
+memory_region_init_io(>thc, obj, _thc_ops, s, "tcx.thc",
   TCX_THC_NREGS);
 sysbus_init_mmio(sbd, >thc);
 
 /* 11/DHC : ??? */
-memory_region_init_io(>dhc, OBJECT(s), _dummy_ops, s, "tcx.dhc",
+memory_region_init_io(>dhc, obj, _dummy_ops, s, "tcx.dhc",
   TCX_DHC_NREGS);
 sysbus_init_mmio(sbd, >dhc);
 
 /* 12/ALT : ??? */
-memory_region_init_io(>alt, OBJECT(s), _dummy_ops, s, "tcx.alt",
+memory_region_init_io(>alt, obj, _dummy_ops, s, "tcx.alt",
   TCX_ALT_NREGS);
 sysbus_init_mmio(sbd, >alt);
-
-return;
 }
 
 static void tcx_realizefn(DeviceState *dev, Error **errp)
-- 
1.8.3.1




Re: [Qemu-devel] [PATCH] hw/display/tcx: Remove superfluous OBJECT() typecasts

2015-10-15 Thread Markus Armbruster
Thomas Huth  writes:

> The tcx_initfn() function is already supplied with an
> Object *obj pointer, so there is no need to cast the
> state pointer back to an Object pointer all over the
> place. And while we're at it, also remove the superfluous
> "return;" statement in this function.
>
> Signed-off-by: Thomas Huth 

Reviewed-by: Markus Armbruster