Patchwork [RFC,v1,1/7] target-arm/cpu.c: delete un-needed instance/class sizes

login
register
mail settings
Submitter Peter Crosthwaite
Date June 18, 2013, 9:44 a.m.
Message ID <6e991961b746baaf40685a25eee20165ca587170.1371548267.git.peter.crosthwaite@xilinx.com>
Download mbox | patch
Permalink /patch/252204/
State New
Headers show

Comments

Peter Crosthwaite - June 18, 2013, 9:44 a.m.
From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>

QOM automatically inherits class and instance size from the parent
class. No need to redefine as the same value as the parent.

CC: qemu-trivial@nongnu.org

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
---

 target-arm/cpu.c | 2 --
 1 file changed, 2 deletions(-)
Andreas Färber - June 18, 2013, 9:58 a.m.
Am 18.06.2013 11:44, schrieb peter.crosthwaite@xilinx.com:
> From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> 
> QOM automatically inherits class and instance size from the parent
> class. No need to redefine as the same value as the parent.

It would be fair to mention since which commit because that was
originally not the case. :)

> 
> CC: qemu-trivial@nongnu.org
> 
> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>

Anyway,

Reviewed-by: Andreas Färber <afaerber@suse.de>

Andreas

> ---
> 
>  target-arm/cpu.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/target-arm/cpu.c b/target-arm/cpu.c
> index 496a59f..47a21ec 100644
> --- a/target-arm/cpu.c
> +++ b/target-arm/cpu.c
> @@ -821,9 +821,7 @@ static void cpu_register(const ARMCPUInfo *info)
>  {
>      TypeInfo type_info = {
>          .parent = TYPE_ARM_CPU,
> -        .instance_size = sizeof(ARMCPU),
>          .instance_init = info->initfn,
> -        .class_size = sizeof(ARMCPUClass),
>          .class_init = info->class_init,
>      };
>

Patch

diff --git a/target-arm/cpu.c b/target-arm/cpu.c
index 496a59f..47a21ec 100644
--- a/target-arm/cpu.c
+++ b/target-arm/cpu.c
@@ -821,9 +821,7 @@  static void cpu_register(const ARMCPUInfo *info)
 {
     TypeInfo type_info = {
         .parent = TYPE_ARM_CPU,
-        .instance_size = sizeof(ARMCPU),
         .instance_init = info->initfn,
-        .class_size = sizeof(ARMCPUClass),
         .class_init = info->class_init,
     };