On Tue, Jun 11, 2013 at 4:44 PM,  <peter.crosthwa...@xilinx.com> wrote:
> From: Peter Crosthwaite <peter.crosthwa...@xilinx.com>
>
> Define and use standard QOM cast macro. Remove usages of DO_UPCAST
> and direct -> style upcasting.
>
> Signed-off-by: Peter Crosthwaite <peter.crosthwa...@xilinx.com>
> ---
>
>  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