qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 12/30] virtio/vmware_vga: QOM casting sweep


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v2 12/30] virtio/vmware_vga: QOM casting sweep
Date: Sun, 30 Jun 2013 10:41:09 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6

"display/vmware_vga: ..." obviously.

Am 24.06.2013 08:58, schrieb address@hidden:
> From: Peter Crosthwaite <address@hidden>
> 
> Define and use standard QOM cast macro. Remove usages of DO_UPCAST and
> direct -> style casting.
> 
> Signed-off-by: Peter Crosthwaite <address@hidden>
> ---
> 
>  hw/display/vmware_vga.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
> index fd3569d..0e2aa3f 100644
> --- a/hw/display/vmware_vga.c
> +++ b/hw/display/vmware_vga.c
> @@ -81,6 +81,11 @@ struct vmsvga_state_s {
>      int redraw_fifo_first, redraw_fifo_last;
>  };
>  
> +#define TYPE_VM_SVGA "vmware-svga"
> +
> +#define VM_SVGA(obj) \
> +    OBJECT_CHECK(struct pci_vmsvga_state_s, (obj), TYPE_VM_SVGA)

Let's use VMWARE_VGA for uniqueness. Thanks, applied to qom-next:
https://github.com/afaerber/qemu-cpu/commits/qom-next

Andreas

> +
>  struct pci_vmsvga_state_s {
>      PCIDevice card;
>      struct vmsvga_state_s chip;
> @@ -1092,8 +1097,7 @@ static void vmsvga_update_display(void *opaque)
>  
>  static void vmsvga_reset(DeviceState *dev)
>  {
> -    struct pci_vmsvga_state_s *pci =
> -        DO_UPCAST(struct pci_vmsvga_state_s, card.qdev, dev);
> +    struct pci_vmsvga_state_s *pci = VM_SVGA(dev);
>      struct vmsvga_state_s *s = &pci->chip;
>  
>      s->index = 0;
> @@ -1246,8 +1250,7 @@ static const MemoryRegionOps vmsvga_io_ops = {
>  
>  static int pci_vmsvga_initfn(PCIDevice *dev)
>  {
> -    struct pci_vmsvga_state_s *s =
> -        DO_UPCAST(struct pci_vmsvga_state_s, card, dev);
> +    struct pci_vmsvga_state_s *s = VM_SVGA(dev);
>  
>      s->card.config[PCI_CACHE_LINE_SIZE] = 0x08;         /* Cache line size */
>      s->card.config[PCI_LATENCY_TIMER] = 0x40;           /* Latency timer */
> @@ -1299,7 +1302,7 @@ static void vmsvga_class_init(ObjectClass *klass, void 
> *data)
>  }
>  
>  static const TypeInfo vmsvga_info = {
> -    .name          = "vmware-svga",
> +    .name          = TYPE_VM_SVGA,
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(struct pci_vmsvga_state_s),
>      .class_init    = vmsvga_class_init,
> 


-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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