diff mbox series

[10/63] vmgenid: Rename VMGENID_DEVICE to TYPE_VMGENID

Message ID 20200902224311.1321159-11-ehabkost@redhat.com
State Superseded
Headers show
Series qom: Rename macros for consistency | expand

Commit Message

Eduardo Habkost Sept. 2, 2020, 10:42 p.m. UTC
This will make the type name constant consistent with the name of
the type checking macro.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Cc: Ben Warren <ben@skyportsystems.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-devel@nongnu.org
---
 include/hw/acpi/vmgenid.h | 6 +++---
 hw/acpi/vmgenid.c         | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

Comments

Philippe Mathieu-Daudé Sept. 3, 2020, 12:51 p.m. UTC | #1
On 9/3/20 12:42 AM, Eduardo Habkost wrote:
> This will make the type name constant consistent with the name of
> the type checking macro.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
> Cc: Ben Warren <ben@skyportsystems.com>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: qemu-devel@nongnu.org
> ---
>  include/hw/acpi/vmgenid.h | 6 +++---
>  hw/acpi/vmgenid.c         | 6 +++---
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/include/hw/acpi/vmgenid.h b/include/hw/acpi/vmgenid.h
> index 86cd1da605..aff574df5f 100644
> --- a/include/hw/acpi/vmgenid.h
> +++ b/include/hw/acpi/vmgenid.h
> @@ -6,7 +6,7 @@
>  #include "qemu/uuid.h"
>  #include "qom/object.h"
>  
> -#define VMGENID_DEVICE           "vmgenid"
> +#define TYPE_VMGENID           "vmgenid"
>  #define VMGENID_GUID             "guid"
>  #define VMGENID_GUID_FW_CFG_FILE      "etc/vmgenid_guid"
>  #define VMGENID_ADDR_FW_CFG_FILE      "etc/vmgenid_addr"
> @@ -18,7 +18,7 @@
>  
>  typedef struct VmGenIdState VmGenIdState;
>  DECLARE_INSTANCE_CHECKER(VmGenIdState, VMGENID,
> -                         VMGENID_DEVICE)
> +                         TYPE_VMGENID)
>  
>  struct VmGenIdState {
>      DeviceClass parent_obj;
> @@ -29,7 +29,7 @@ struct VmGenIdState {
>  /* returns NULL unless there is exactly one device */
>  static inline Object *find_vmgenid_dev(void)
>  {
> -    return object_resolve_path_type("", VMGENID_DEVICE, NULL);
> +    return object_resolve_path_type("", TYPE_VMGENID, NULL);
>  }
>  
>  void vmgenid_build_acpi(VmGenIdState *vms, GArray *table_data, GArray *guid,
> diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c
> index 2df7623d74..53db6af75d 100644
> --- a/hw/acpi/vmgenid.c
> +++ b/hw/acpi/vmgenid.c
> @@ -198,7 +198,7 @@ static void vmgenid_realize(DeviceState *dev, Error **errp)
>  
>      if (!bios_linker_loader_can_write_pointer()) {
>          error_setg(errp, "%s requires DMA write support in fw_cfg, "
> -                   "which this machine type does not provide", VMGENID_DEVICE);
> +                   "which this machine type does not provide", TYPE_VMGENID);
>          return;
>      }
>  
> @@ -206,7 +206,7 @@ static void vmgenid_realize(DeviceState *dev, Error **errp)
>       * device. Check if there are several.
>       */
>      if (!find_vmgenid_dev()) {
> -        error_setg(errp, "at most one %s device is permitted", VMGENID_DEVICE);
> +        error_setg(errp, "at most one %s device is permitted", TYPE_VMGENID);
>          return;
>      }
>  
> @@ -232,7 +232,7 @@ static void vmgenid_device_class_init(ObjectClass *klass, void *data)
>  }
>  
>  static const TypeInfo vmgenid_device_info = {
> -    .name          = VMGENID_DEVICE,
> +    .name          = TYPE_VMGENID,
>      .parent        = TYPE_DEVICE,
>      .instance_size = sizeof(VmGenIdState),
>      .class_init    = vmgenid_device_class_init,
>
diff mbox series

Patch

diff --git a/include/hw/acpi/vmgenid.h b/include/hw/acpi/vmgenid.h
index 86cd1da605..aff574df5f 100644
--- a/include/hw/acpi/vmgenid.h
+++ b/include/hw/acpi/vmgenid.h
@@ -6,7 +6,7 @@ 
 #include "qemu/uuid.h"
 #include "qom/object.h"
 
-#define VMGENID_DEVICE           "vmgenid"
+#define TYPE_VMGENID           "vmgenid"
 #define VMGENID_GUID             "guid"
 #define VMGENID_GUID_FW_CFG_FILE      "etc/vmgenid_guid"
 #define VMGENID_ADDR_FW_CFG_FILE      "etc/vmgenid_addr"
@@ -18,7 +18,7 @@ 
 
 typedef struct VmGenIdState VmGenIdState;
 DECLARE_INSTANCE_CHECKER(VmGenIdState, VMGENID,
-                         VMGENID_DEVICE)
+                         TYPE_VMGENID)
 
 struct VmGenIdState {
     DeviceClass parent_obj;
@@ -29,7 +29,7 @@  struct VmGenIdState {
 /* returns NULL unless there is exactly one device */
 static inline Object *find_vmgenid_dev(void)
 {
-    return object_resolve_path_type("", VMGENID_DEVICE, NULL);
+    return object_resolve_path_type("", TYPE_VMGENID, NULL);
 }
 
 void vmgenid_build_acpi(VmGenIdState *vms, GArray *table_data, GArray *guid,
diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c
index 2df7623d74..53db6af75d 100644
--- a/hw/acpi/vmgenid.c
+++ b/hw/acpi/vmgenid.c
@@ -198,7 +198,7 @@  static void vmgenid_realize(DeviceState *dev, Error **errp)
 
     if (!bios_linker_loader_can_write_pointer()) {
         error_setg(errp, "%s requires DMA write support in fw_cfg, "
-                   "which this machine type does not provide", VMGENID_DEVICE);
+                   "which this machine type does not provide", TYPE_VMGENID);
         return;
     }
 
@@ -206,7 +206,7 @@  static void vmgenid_realize(DeviceState *dev, Error **errp)
      * device. Check if there are several.
      */
     if (!find_vmgenid_dev()) {
-        error_setg(errp, "at most one %s device is permitted", VMGENID_DEVICE);
+        error_setg(errp, "at most one %s device is permitted", TYPE_VMGENID);
         return;
     }
 
@@ -232,7 +232,7 @@  static void vmgenid_device_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo vmgenid_device_info = {
-    .name          = VMGENID_DEVICE,
+    .name          = TYPE_VMGENID,
     .parent        = TYPE_DEVICE,
     .instance_size = sizeof(VmGenIdState),
     .class_init    = vmgenid_device_class_init,