qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFT PATCH v1 06/30] scsi/megasas: QOM Upcast Sweep


From: Peter Crosthwaite
Subject: Re: [Qemu-devel] [RFT PATCH v1 06/30] scsi/megasas: QOM Upcast Sweep
Date: Mon, 24 Jun 2013 13:42:51 +1000

On Tue, Jun 11, 2013 at 4:44 PM,  <address@hidden> wrote:
> From: Peter Crosthwaite <address@hidden>
>
> Define and use standard QOM cast macro. Remove usages of DO_UPCAST
> and direct -> style upcasting.
>
> Signed-off-by: Peter Crosthwaite <address@hidden>
> ---
>
>  hw/scsi/megasas.c | 17 +++++++++++------
>  1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
> index fe6550c..21eaf4f 100644
> --- a/hw/scsi/megasas.c
> +++ b/hw/scsi/megasas.c
> @@ -108,6 +108,11 @@ typedef struct MegasasState {
>      SCSIBus bus;
>  } MegasasState;
>
> +#define TYPE_MEGASAS "megasas"
> +
> +#define MEGASAS(obj) \
> +    OBJECT_CHECK(MegasasState, (obj), TYPE_MEGASAS)
> +
>  #define MEGASAS_INTR_DISABLED_MASK 0xFFFFFFFF
>
>  static bool megasas_intr_enabled(MegasasState *s)
> @@ -2039,13 +2044,13 @@ static void megasas_soft_reset(MegasasState *s)
>
>  static void megasas_scsi_reset(DeviceState *dev)
>  {
> -    MegasasState *s = DO_UPCAST(MegasasState, dev.qdev, dev);
> +    MegasasState *s = MEGASAS(dev);
>
>      megasas_soft_reset(s);
>  }
>
>  static const VMStateDescription vmstate_megasas = {
> -    .name = "megasas",
> +    .name = TYPE_MEGASAS,

Will fix v2.

Regards,
Peter



reply via email to

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