From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
"Markus Armbruster" <armbru@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Alistair Francis" <alistair@alistair23.me>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH 2/8] hw/char/pl011: Un-inline pl011_create()
Date: Mon, 20 Feb 2023 12:51:08 +0100 [thread overview]
Message-ID: <20230220115114.25237-3-philmd@linaro.org> (raw)
In-Reply-To: <20230220115114.25237-1-philmd@linaro.org>
pl011_create() is only used in DeviceRealize handlers,
not a hot-path. Inlining is not justified.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/char/pl011.c | 17 +++++++++++++++++
include/hw/char/pl011.h | 19 +------------------
2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/hw/char/pl011.c b/hw/char/pl011.c
index c15cb7af20..77bbc2a982 100644
--- a/hw/char/pl011.c
+++ b/hw/char/pl011.c
@@ -19,10 +19,12 @@
*/
#include "qemu/osdep.h"
+#include "qapi/error.h"
#include "hw/char/pl011.h"
#include "hw/irq.h"
#include "hw/sysbus.h"
#include "hw/qdev-clock.h"
+#include "hw/qdev-properties.h"
#include "hw/qdev-properties-system.h"
#include "migration/vmstate.h"
#include "chardev/char-fe.h"
@@ -31,6 +33,21 @@
#include "qemu/module.h"
#include "trace.h"
+DeviceState *pl011_create(hwaddr addr, qemu_irq irq, Chardev *chr)
+{
+ DeviceState *dev;
+ SysBusDevice *s;
+
+ dev = qdev_new("pl011");
+ s = SYS_BUS_DEVICE(dev);
+ qdev_prop_set_chr(dev, "chardev", chr);
+ sysbus_realize_and_unref(s, &error_fatal);
+ sysbus_mmio_map(s, 0, addr);
+ sysbus_connect_irq(s, 0, irq);
+
+ return dev;
+}
+
#define PL011_INT_TX 0x20
#define PL011_INT_RX 0x10
diff --git a/include/hw/char/pl011.h b/include/hw/char/pl011.h
index 926322e242..d82870c006 100644
--- a/include/hw/char/pl011.h
+++ b/include/hw/char/pl011.h
@@ -15,10 +15,8 @@
#ifndef HW_PL011_H
#define HW_PL011_H
-#include "hw/qdev-properties.h"
#include "hw/sysbus.h"
#include "chardev/char-fe.h"
-#include "qapi/error.h"
#include "qom/object.h"
#define TYPE_PL011 "pl011"
@@ -57,22 +55,7 @@ struct PL011State {
const unsigned char *id;
};
-static inline DeviceState *pl011_create(hwaddr addr,
- qemu_irq irq,
- Chardev *chr)
-{
- DeviceState *dev;
- SysBusDevice *s;
-
- dev = qdev_new("pl011");
- s = SYS_BUS_DEVICE(dev);
- qdev_prop_set_chr(dev, "chardev", chr);
- sysbus_realize_and_unref(s, &error_fatal);
- sysbus_mmio_map(s, 0, addr);
- sysbus_connect_irq(s, 0, irq);
-
- return dev;
-}
+DeviceState *pl011_create(hwaddr addr, qemu_irq irq, Chardev *chr);
static inline DeviceState *pl011_luminary_create(hwaddr addr,
qemu_irq irq,
--
2.38.1
next prev parent reply other threads:[~2023-02-20 11:52 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-20 11:51 [PATCH 0/8] hw/arm: Cleanups around QOM style Philippe Mathieu-Daudé
2023-02-20 11:51 ` [PATCH 1/8] hw/gpio/max7310: Simplify max7310_realize() Philippe Mathieu-Daudé
2023-02-20 18:49 ` Richard Henderson
2023-02-20 11:51 ` Philippe Mathieu-Daudé [this message]
2023-02-20 15:30 ` [PATCH 2/8] hw/char/pl011: Un-inline pl011_create() Alex Bennée
2023-02-20 18:50 ` Richard Henderson
2023-02-20 11:51 ` [PATCH 3/8] hw/char/pl011: Open-code pl011_luminary_create() Philippe Mathieu-Daudé
2023-02-20 15:31 ` Alex Bennée
2023-02-20 18:51 ` Richard Henderson
2023-02-20 11:51 ` [PATCH 4/8] hw/char/xilinx_uartlite: Expose XILINX_UARTLITE QOM type Philippe Mathieu-Daudé
2023-02-20 15:32 ` Alex Bennée
2023-02-20 18:53 ` Richard Henderson
2023-02-20 11:51 ` [PATCH 5/8] hw/char/xilinx_uartlite: Open-code xilinx_uartlite_create() Philippe Mathieu-Daudé
2023-02-20 15:32 ` Alex Bennée
2023-02-20 18:56 ` Richard Henderson
2023-02-20 11:51 ` [PATCH 6/8] hw/char/cmsdk-apb-uart: Open-code cmsdk_apb_uart_create() Philippe Mathieu-Daudé
2023-02-20 15:33 ` Alex Bennée
2023-02-21 16:49 ` Peter Maydell
2023-02-20 11:51 ` [PATCH 7/8] hw/timer/cmsdk-apb-timer: Remove unused 'qdev-properties.h' header Philippe Mathieu-Daudé
2023-02-20 15:34 ` Alex Bennée
2023-02-20 11:51 ` [PATCH 8/8] hw/intc/armv7m_nvic: Use QOM cast CPU() macro Philippe Mathieu-Daudé
2023-02-20 15:34 ` Alex Bennée
2023-02-21 17:45 ` [PATCH 0/8] hw/arm: Cleanups around QOM style Peter Maydell
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=20230220115114.25237-3-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=alistair@alistair23.me \
--cc=armbru@redhat.com \
--cc=edgar.iglesias@gmail.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).