qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [qemu-s390x] [RFC PATCH 3/3] qdev: use device_class_set_p


From: Cornelia Huck
Subject: Re: [Qemu-ppc] [qemu-s390x] [RFC PATCH 3/3] qdev: use device_class_set_parent_realize/unrealize/reset()
Date: Mon, 15 Jan 2018 10:09:14 +0100

On Sat, 13 Jan 2018 23:04:12 -0300
Philippe Mathieu-Daudé <address@hidden> wrote:

> changes generated using the following Coccinelle patch:
> 
>   @@
>   type DeviceParentClass;
>   DeviceParentClass *pc;
>   DeviceClass *dc;
>   identifier parent_fn;
>   identifier child_fn;
>   @@
>   (
>   +device_class_set_parent_realize(dc, child_fn, &pc->parent_fn);
>   -pc->parent_fn = dc->realize;
>   ...
>   -dc->realize = child_fn;
>   |
>   +device_class_set_parent_unrealize(dc, child_fn, &pc->parent_fn);
>   -pc->parent_fn = dc->unrealize;
>   ...
>   -dc->unrealize = child_fn;
>   |
>   +device_class_set_parent_reset(dc, child_fn, &pc->parent_fn);
>   -pc->parent_fn = dc->reset;
>   ...
>   -dc->reset = child_fn;
>   )
> 
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
>  hw/i386/kvm/i8254.c                | 4 ++--
>  hw/i386/kvm/i8259.c                | 3 +--
>  hw/input/adb-kbd.c                 | 4 ++--
>  hw/input/adb-mouse.c               | 4 ++--
>  hw/intc/arm_gic.c                  | 3 +--
>  hw/intc/arm_gic_kvm.c              | 7 +++----
>  hw/intc/arm_gicv3.c                | 3 +--
>  hw/intc/arm_gicv3_its_kvm.c        | 3 +--
>  hw/intc/arm_gicv3_kvm.c            | 7 +++----
>  hw/intc/i8259.c                    | 3 +--
>  hw/net/vmxnet3.c                   | 4 ++--
>  hw/pci-bridge/gen_pcie_root_port.c | 3 +--
>  hw/scsi/vmw_pvscsi.c               | 4 ++--
>  hw/timer/i8254.c                   | 3 +--
>  hw/vfio/amd-xgbe.c                 | 4 ++--
>  hw/vfio/calxeda-xgmac.c            | 4 ++--
>  hw/virtio/virtio-pci.c             | 4 ++--
>  target/alpha/cpu.c                 | 4 ++--
>  target/arm/cpu.c                   | 4 ++--
>  target/cris/cpu.c                  | 4 ++--
>  target/hppa/cpu.c                  | 4 ++--
>  target/i386/cpu.c                  | 8 ++++----
>  target/lm32/cpu.c                  | 5 ++---
>  target/m68k/cpu.c                  | 5 ++---
>  target/microblaze/cpu.c            | 5 ++---
>  target/mips/cpu.c                  | 5 ++---
>  target/moxie/cpu.c                 | 5 ++---
>  target/nios2/cpu.c                 | 4 ++--
>  target/openrisc/cpu.c              | 5 ++---
>  target/ppc/translate_init.c        | 8 ++++----
>  target/s390x/cpu.c                 | 4 ++--
>  target/sh4/cpu.c                   | 4 ++--
>  target/sparc/cpu.c                 | 4 ++--
>  target/tilegx/cpu.c                | 4 ++--
>  target/tricore/cpu.c               | 4 ++--
>  target/unicore32/cpu.c             | 4 ++--
>  target/xtensa/cpu.c                | 4 ++--
>  37 files changed, 73 insertions(+), 88 deletions(-)

> diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
> index ae3cee91a2..4c068cedff 100644
> --- a/target/s390x/cpu.c
> +++ b/target/s390x/cpu.c
> @@ -463,8 +463,8 @@ static void s390_cpu_class_init(ObjectClass *oc, void 
> *data)
>      CPUClass *cc = CPU_CLASS(scc);
>      DeviceClass *dc = DEVICE_CLASS(oc);
>  
> -    scc->parent_realize = dc->realize;
> -    dc->realize = s390_cpu_realizefn;
> +    device_class_set_parent_realize(dc, s390_cpu_realizefn,
> +                                    &scc->parent_realize);
>      dc->props = s390x_cpu_properties;
>      dc->user_creatable = true;
>  

s390x change:

Acked-by: Cornelia Huck <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]