From ac7bc031408491cf17da0a46e3fe34e34a1c1b85 Mon Sep 17 00:00:00 2001 From: Mao Zhongyi Date: Mon, 14 Aug 2017 11:33:10 +0800 Subject: net/rocker: Fix the unusual macro name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: jasowang@redhat.com Cc: jiri@resnulli.us Cc: armbru@redhat.com Cc: f4bug@amsat.org Suggested-by: Markus Armbruster Signed-off-by: Mao Zhongyi Reviewed-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Jason Wang --- hw/net/rocker/rocker.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'hw') diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c index bb38cba..9273473 100644 --- a/hw/net/rocker/rocker.c +++ b/hw/net/rocker/rocker.c @@ -69,10 +69,10 @@ struct rocker { QLIST_ENTRY(rocker) next; }; -#define ROCKER "rocker" +#define TYPE_ROCKER "rocker" -#define to_rocker(obj) \ - OBJECT_CHECK(Rocker, (obj), ROCKER) +#define ROCKER(obj) \ + OBJECT_CHECK(Rocker, (obj), TYPE_ROCKER) static QLIST_HEAD(, rocker) rockers; @@ -1285,7 +1285,7 @@ static World *rocker_world_type_by_name(Rocker *r, const char *name) static void pci_rocker_realize(PCIDevice *dev, Error **errp) { - Rocker *r = to_rocker(dev); + Rocker *r = ROCKER(dev); const MACAddr zero = { .a = { 0, 0, 0, 0, 0, 0 } }; const MACAddr dflt = { .a = { 0x52, 0x54, 0x00, 0x12, 0x35, 0x01 } }; static int sw_index; @@ -1331,7 +1331,7 @@ static void pci_rocker_realize(PCIDevice *dev, Error **errp) /* validate switch properties */ if (!r->name) { - r->name = g_strdup(ROCKER); + r->name = g_strdup(TYPE_ROCKER); } if (rocker_find(r->name)) { @@ -1427,7 +1427,7 @@ err_world_type_by_name: static void pci_rocker_uninit(PCIDevice *dev) { - Rocker *r = to_rocker(dev); + Rocker *r = ROCKER(dev); int i; QLIST_REMOVE(r, next); @@ -1460,7 +1460,7 @@ static void pci_rocker_uninit(PCIDevice *dev) static void rocker_reset(DeviceState *dev) { - Rocker *r = to_rocker(dev); + Rocker *r = ROCKER(dev); int i; for (i = 0; i < ROCKER_WORLD_TYPE_MAX; i++) { @@ -1498,7 +1498,7 @@ static Property rocker_properties[] = { }; static const VMStateDescription rocker_vmsd = { - .name = ROCKER, + .name = TYPE_ROCKER, .unmigratable = 1, }; @@ -1521,7 +1521,7 @@ static void rocker_class_init(ObjectClass *klass, void *data) } static const TypeInfo rocker_info = { - .name = ROCKER, + .name = TYPE_ROCKER, .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(Rocker), .class_init = rocker_class_init, -- cgit v1.1