qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/display/tcx: Remove superfluous OBJECT() typecasts
@ 2015-10-15  8:54 Thomas Huth
  2015-10-15 15:25 ` Markus Armbruster
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Thomas Huth @ 2015-10-15  8:54 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial; +Cc: blauwirbel, pbonzini, mark.cave-ayland, armbru

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 <thuth@redhat.com>
---
 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(&s->rom, OBJECT(s), "tcx.prom", FCODE_MAX_ROM_SIZE,
+    memory_region_init_ram(&s->rom, obj, "tcx.prom", FCODE_MAX_ROM_SIZE,
                            &error_fatal);
     memory_region_set_readonly(&s->rom, true);
     sysbus_init_mmio(sbd, &s->rom);
 
     /* 2/STIP : Stippler */
-    memory_region_init_io(&s->stip, OBJECT(s), &tcx_stip_ops, s, "tcx.stip",
+    memory_region_init_io(&s->stip, obj, &tcx_stip_ops, s, "tcx.stip",
                           TCX_STIP_NREGS);
     sysbus_init_mmio(sbd, &s->stip);
 
     /* 3/BLIT : Blitter */
-    memory_region_init_io(&s->blit, OBJECT(s), &tcx_blit_ops, s, "tcx.blit",
+    memory_region_init_io(&s->blit, obj, &tcx_blit_ops, s, "tcx.blit",
                           TCX_BLIT_NREGS);
     sysbus_init_mmio(sbd, &s->blit);
 
     /* 5/RSTIP : Raw Stippler */
-    memory_region_init_io(&s->rstip, OBJECT(s), &tcx_rstip_ops, s, "tcx.rstip",
+    memory_region_init_io(&s->rstip, obj, &tcx_rstip_ops, s, "tcx.rstip",
                           TCX_RSTIP_NREGS);
     sysbus_init_mmio(sbd, &s->rstip);
 
     /* 6/RBLIT : Raw Blitter */
-    memory_region_init_io(&s->rblit, OBJECT(s), &tcx_rblit_ops, s, "tcx.rblit",
+    memory_region_init_io(&s->rblit, obj, &tcx_rblit_ops, s, "tcx.rblit",
                           TCX_RBLIT_NREGS);
     sysbus_init_mmio(sbd, &s->rblit);
 
     /* 7/TEC : ??? */
-    memory_region_init_io(&s->tec, OBJECT(s), &tcx_dummy_ops, s,
-                          "tcx.tec", TCX_TEC_NREGS);
+    memory_region_init_io(&s->tec, obj, &tcx_dummy_ops, s, "tcx.tec",
+                          TCX_TEC_NREGS);
     sysbus_init_mmio(sbd, &s->tec);
 
     /* 8/CMAP : DAC */
-    memory_region_init_io(&s->dac, OBJECT(s), &tcx_dac_ops, s,
-                          "tcx.dac", TCX_DAC_NREGS);
+    memory_region_init_io(&s->dac, obj, &tcx_dac_ops, s, "tcx.dac",
+                          TCX_DAC_NREGS);
     sysbus_init_mmio(sbd, &s->dac);
 
     /* 9/THC : Cursor */
-    memory_region_init_io(&s->thc, OBJECT(s), &tcx_thc_ops, s, "tcx.thc",
+    memory_region_init_io(&s->thc, obj, &tcx_thc_ops, s, "tcx.thc",
                           TCX_THC_NREGS);
     sysbus_init_mmio(sbd, &s->thc);
 
     /* 11/DHC : ??? */
-    memory_region_init_io(&s->dhc, OBJECT(s), &tcx_dummy_ops, s, "tcx.dhc",
+    memory_region_init_io(&s->dhc, obj, &tcx_dummy_ops, s, "tcx.dhc",
                           TCX_DHC_NREGS);
     sysbus_init_mmio(sbd, &s->dhc);
 
     /* 12/ALT : ??? */
-    memory_region_init_io(&s->alt, OBJECT(s), &tcx_dummy_ops, s, "tcx.alt",
+    memory_region_init_io(&s->alt, obj, &tcx_dummy_ops, s, "tcx.alt",
                           TCX_ALT_NREGS);
     sysbus_init_mmio(sbd, &s->alt);
-
-    return;
 }
 
 static void tcx_realizefn(DeviceState *dev, Error **errp)
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/display/tcx: Remove superfluous OBJECT() typecasts
  2015-10-15  8:54 [Qemu-devel] [PATCH] hw/display/tcx: Remove superfluous OBJECT() typecasts Thomas Huth
@ 2015-10-15 15:25 ` Markus Armbruster
  2015-10-18 13:55 ` Mark Cave-Ayland
  2015-10-29  7:32 ` Michael Tokarev
  2 siblings, 0 replies; 5+ messages in thread
From: Markus Armbruster @ 2015-10-15 15:25 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-trivial, blauwirbel, mark.cave-ayland, qemu-devel, pbonzini

Thomas Huth <thuth@redhat.com> 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 <thuth@redhat.com>

Reviewed-by: Markus Armbruster <armbru@redhat.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/display/tcx: Remove superfluous OBJECT() typecasts
  2015-10-15  8:54 [Qemu-devel] [PATCH] hw/display/tcx: Remove superfluous OBJECT() typecasts Thomas Huth
  2015-10-15 15:25 ` Markus Armbruster
@ 2015-10-18 13:55 ` Mark Cave-Ayland
  2015-10-19  7:10   ` Markus Armbruster
  2015-10-29  7:32 ` Michael Tokarev
  2 siblings, 1 reply; 5+ messages in thread
From: Mark Cave-Ayland @ 2015-10-18 13:55 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel, qemu-trivial; +Cc: blauwirbel, pbonzini, armbru

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 <thuth@redhat.com>
> ---
>  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(&s->rom, OBJECT(s), "tcx.prom", FCODE_MAX_ROM_SIZE,
> +    memory_region_init_ram(&s->rom, obj, "tcx.prom", FCODE_MAX_ROM_SIZE,
>                             &error_fatal);
>      memory_region_set_readonly(&s->rom, true);
>      sysbus_init_mmio(sbd, &s->rom);
>  
>      /* 2/STIP : Stippler */
> -    memory_region_init_io(&s->stip, OBJECT(s), &tcx_stip_ops, s, "tcx.stip",
> +    memory_region_init_io(&s->stip, obj, &tcx_stip_ops, s, "tcx.stip",
>                            TCX_STIP_NREGS);
>      sysbus_init_mmio(sbd, &s->stip);
>  
>      /* 3/BLIT : Blitter */
> -    memory_region_init_io(&s->blit, OBJECT(s), &tcx_blit_ops, s, "tcx.blit",
> +    memory_region_init_io(&s->blit, obj, &tcx_blit_ops, s, "tcx.blit",
>                            TCX_BLIT_NREGS);
>      sysbus_init_mmio(sbd, &s->blit);
>  
>      /* 5/RSTIP : Raw Stippler */
> -    memory_region_init_io(&s->rstip, OBJECT(s), &tcx_rstip_ops, s, "tcx.rstip",
> +    memory_region_init_io(&s->rstip, obj, &tcx_rstip_ops, s, "tcx.rstip",
>                            TCX_RSTIP_NREGS);
>      sysbus_init_mmio(sbd, &s->rstip);
>  
>      /* 6/RBLIT : Raw Blitter */
> -    memory_region_init_io(&s->rblit, OBJECT(s), &tcx_rblit_ops, s, "tcx.rblit",
> +    memory_region_init_io(&s->rblit, obj, &tcx_rblit_ops, s, "tcx.rblit",
>                            TCX_RBLIT_NREGS);
>      sysbus_init_mmio(sbd, &s->rblit);
>  
>      /* 7/TEC : ??? */
> -    memory_region_init_io(&s->tec, OBJECT(s), &tcx_dummy_ops, s,
> -                          "tcx.tec", TCX_TEC_NREGS);
> +    memory_region_init_io(&s->tec, obj, &tcx_dummy_ops, s, "tcx.tec",
> +                          TCX_TEC_NREGS);
>      sysbus_init_mmio(sbd, &s->tec);
>  
>      /* 8/CMAP : DAC */
> -    memory_region_init_io(&s->dac, OBJECT(s), &tcx_dac_ops, s,
> -                          "tcx.dac", TCX_DAC_NREGS);
> +    memory_region_init_io(&s->dac, obj, &tcx_dac_ops, s, "tcx.dac",
> +                          TCX_DAC_NREGS);
>      sysbus_init_mmio(sbd, &s->dac);
>  
>      /* 9/THC : Cursor */
> -    memory_region_init_io(&s->thc, OBJECT(s), &tcx_thc_ops, s, "tcx.thc",
> +    memory_region_init_io(&s->thc, obj, &tcx_thc_ops, s, "tcx.thc",
>                            TCX_THC_NREGS);
>      sysbus_init_mmio(sbd, &s->thc);
>  
>      /* 11/DHC : ??? */
> -    memory_region_init_io(&s->dhc, OBJECT(s), &tcx_dummy_ops, s, "tcx.dhc",
> +    memory_region_init_io(&s->dhc, obj, &tcx_dummy_ops, s, "tcx.dhc",
>                            TCX_DHC_NREGS);
>      sysbus_init_mmio(sbd, &s->dhc);
>  
>      /* 12/ALT : ??? */
> -    memory_region_init_io(&s->alt, OBJECT(s), &tcx_dummy_ops, s, "tcx.alt",
> +    memory_region_init_io(&s->alt, obj, &tcx_dummy_ops, s, "tcx.alt",
>                            TCX_ALT_NREGS);
>      sysbus_init_mmio(sbd, &s->alt);
> -
> -    return;
>  }
>  
>  static void tcx_realizefn(DeviceState *dev, Error **errp)

Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/display/tcx: Remove superfluous OBJECT() typecasts
  2015-10-18 13:55 ` Mark Cave-Ayland
@ 2015-10-19  7:10   ` Markus Armbruster
  0 siblings, 0 replies; 5+ messages in thread
From: Markus Armbruster @ 2015-10-19  7:10 UTC (permalink / raw)
  To: Mark Cave-Ayland
  Cc: qemu-trivial, blauwirbel, Thomas Huth, qemu-devel, pbonzini

Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> 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 <thuth@redhat.com>
[...]
> Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>
> 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!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/display/tcx: Remove superfluous OBJECT() typecasts
  2015-10-15  8:54 [Qemu-devel] [PATCH] hw/display/tcx: Remove superfluous OBJECT() typecasts Thomas Huth
  2015-10-15 15:25 ` Markus Armbruster
  2015-10-18 13:55 ` Mark Cave-Ayland
@ 2015-10-29  7:32 ` Michael Tokarev
  2 siblings, 0 replies; 5+ messages in thread
From: Michael Tokarev @ 2015-10-29  7:32 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel, qemu-trivial
  Cc: blauwirbel, pbonzini, mark.cave-ayland, armbru

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-29  7:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-15  8:54 [Qemu-devel] [PATCH] hw/display/tcx: Remove superfluous OBJECT() typecasts Thomas Huth
2015-10-15 15:25 ` Markus Armbruster
2015-10-18 13:55 ` Mark Cave-Ayland
2015-10-19  7:10   ` Markus Armbruster
2015-10-29  7:32 ` Michael Tokarev

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).