From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: Alexander Graf <agraf@suse.de>,
Scott Wood <scottwood@freescale.com>,
qemu-ppc@nongnu.org, Fabien Chouteau <chouteau@adacore.com>,
Jason Wang <jasowang@redhat.com>
Subject: [Qemu-devel] [PATCH for-2.10 1/2] etsec: Rename (TYPE_)ETSEC_COMMON to (TYPE_)ETSEC
Date: Fri, 31 Mar 2017 16:27:23 -0300 [thread overview]
Message-ID: <20170331192724.14339-2-ehabkost@redhat.com> (raw)
In-Reply-To: <20170331192724.14339-1-ehabkost@redhat.com>
Types named *_COMMON are normally used when there's a common
parent class for multiple classes. We have only one eTSEC type,
so rename the TYPE_ETSEC_COMMON and ETSEC_COMMON macros to
TYPE_ETSEC and TYPE_ETSEC_COMMON.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
hw/net/fsl_etsec/etsec.h | 6 +++---
hw/net/fsl_etsec/etsec.c | 6 +++---
hw/ppc/e500.c | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/hw/net/fsl_etsec/etsec.h b/hw/net/fsl_etsec/etsec.h
index 30c828e241..3da412e733 100644
--- a/hw/net/fsl_etsec/etsec.h
+++ b/hw/net/fsl_etsec/etsec.h
@@ -149,9 +149,9 @@ typedef struct eTSEC {
bool need_flush;
} eTSEC;
-#define TYPE_ETSEC_COMMON "eTSEC"
-#define ETSEC_COMMON(obj) \
- OBJECT_CHECK(eTSEC, (obj), TYPE_ETSEC_COMMON)
+#define TYPE_ETSEC "eTSEC"
+#define ETSEC(obj) \
+ OBJECT_CHECK(eTSEC, (obj), TYPE_ETSEC)
#define eTSEC_TRANSMIT 1
#define eTSEC_RECEIVE 2
diff --git a/hw/net/fsl_etsec/etsec.c b/hw/net/fsl_etsec/etsec.c
index aa2b0d5a85..ddefaf560c 100644
--- a/hw/net/fsl_etsec/etsec.c
+++ b/hw/net/fsl_etsec/etsec.c
@@ -303,7 +303,7 @@ static void etsec_timer_hit(void *opaque)
static void etsec_reset(DeviceState *d)
{
- eTSEC *etsec = ETSEC_COMMON(d);
+ eTSEC *etsec = ETSEC(d);
int i = 0;
int reg_index = 0;
@@ -378,7 +378,7 @@ static NetClientInfo net_etsec_info = {
static void etsec_realize(DeviceState *dev, Error **errp)
{
- eTSEC *etsec = ETSEC_COMMON(dev);
+ eTSEC *etsec = ETSEC(dev);
etsec->nic = qemu_new_nic(&net_etsec_info, &etsec->conf,
object_get_typename(OBJECT(dev)), dev->id, etsec);
@@ -392,7 +392,7 @@ static void etsec_realize(DeviceState *dev, Error **errp)
static void etsec_instance_init(Object *obj)
{
- eTSEC *etsec = ETSEC_COMMON(obj);
+ eTSEC *etsec = ETSEC(obj);
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
memory_region_init_io(&etsec->io_area, OBJECT(etsec), &etsec_ops, etsec,
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index f7df2388c1..f6478b3a68 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -161,7 +161,7 @@ typedef struct PlatformDevtreeData {
static int create_devtree_etsec(SysBusDevice *sbdev, PlatformDevtreeData *data)
{
- eTSEC *etsec = ETSEC_COMMON(sbdev);
+ eTSEC *etsec = ETSEC(sbdev);
PlatformBusDevice *pbus = data->pbus;
hwaddr mmio0 = platform_bus_get_mmio_addr(pbus, sbdev, 0);
int irq0 = platform_bus_get_irqn(pbus, sbdev, 0);
@@ -201,7 +201,7 @@ static void sysbus_device_create_devtree(SysBusDevice *sbdev, void *opaque)
PlatformDevtreeData *data = opaque;
bool matched = false;
- if (object_dynamic_cast(OBJECT(sbdev), TYPE_ETSEC_COMMON)) {
+ if (object_dynamic_cast(OBJECT(sbdev), TYPE_ETSEC)) {
create_devtree_etsec(sbdev, data);
matched = true;
}
--
2.11.0.259.g40922b1
next prev parent reply other threads:[~2017-03-31 19:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-31 19:27 [Qemu-devel] [PATCH for-2.10 0/2] etsec: (TYPE_)ETSEC_COMMON macro cleanup Eduardo Habkost
2017-03-31 19:27 ` Eduardo Habkost [this message]
2017-03-31 19:27 ` [Qemu-devel] [PATCH for-2.10 2/2] etsec: Use TYPE_ETSEC macro when registering/creating device Eduardo Habkost
2017-04-02 12:42 ` [Qemu-devel] [PATCH for-2.10 0/2] etsec: (TYPE_)ETSEC_COMMON macro cleanup Philippe Mathieu-Daudé
2017-04-03 9:48 ` Fabien Chouteau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170331192724.14339-2-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=agraf@suse.de \
--cc=chouteau@adacore.com \
--cc=jasowang@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=scottwood@freescale.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).