qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] hpet: fix build with CONFIG_HPET off
@ 2013-12-11  0:50 Michael S. Tsirkin
  2013-12-11  0:50 ` [Qemu-devel] [PATCH 2/2] pc: use macro for HPET type Michael S. Tsirkin
  0 siblings, 1 reply; 2+ messages in thread
From: Michael S. Tsirkin @ 2013-12-11  0:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable

make hpet_find inline so we don't need
to build hpet.c to check if hpet is enabled.

Fixes link error with CONFIG_HPET off.

Cc: qemu-stable@nongnu.org
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/hw/timer/hpet.h | 10 +++++++++-
 hw/timer/hpet.c         |  6 ------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/include/hw/timer/hpet.h b/include/hw/timer/hpet.h
index ab44bd3..773953b 100644
--- a/include/hw/timer/hpet.h
+++ b/include/hw/timer/hpet.h
@@ -13,6 +13,8 @@
 #ifndef QEMU_HPET_EMUL_H
 #define QEMU_HPET_EMUL_H
 
+#include "qom/object.h"
+
 #define HPET_BASE               0xfed00000
 #define HPET_CLK_PERIOD         10000000ULL /* 10000000 femtoseconds == 10ns*/
 
@@ -72,5 +74,11 @@ struct hpet_fw_config
 
 extern struct hpet_fw_config hpet_cfg;
 
-bool hpet_find(void);
+#define TYPE_HPET "hpet"
+
+static inline bool hpet_find(void)
+{
+    return object_resolve_path_type("", TYPE_HPET, NULL);
+}
+
 #endif
diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
index 0ec440e..bb3bf98 100644
--- a/hw/timer/hpet.c
+++ b/hw/timer/hpet.c
@@ -42,7 +42,6 @@
 
 #define HPET_MSI_SUPPORT        0
 
-#define TYPE_HPET "hpet"
 #define HPET(obj) OBJECT_CHECK(HPETState, (obj), TYPE_HPET)
 
 struct HPETState;
@@ -772,11 +771,6 @@ static void hpet_device_class_init(ObjectClass *klass, void *data)
     dc->props = hpet_device_properties;
 }
 
-bool hpet_find(void)
-{
-    return object_resolve_path_type("", TYPE_HPET, NULL);
-}
-
 static const TypeInfo hpet_device_info = {
     .name          = TYPE_HPET,
     .parent        = TYPE_SYS_BUS_DEVICE,
-- 
MST

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Qemu-devel] [PATCH 2/2] pc: use macro for HPET type
  2013-12-11  0:50 [Qemu-devel] [PATCH 1/2] hpet: fix build with CONFIG_HPET off Michael S. Tsirkin
@ 2013-12-11  0:50 ` Michael S. Tsirkin
  0 siblings, 0 replies; 2+ messages in thread
From: Michael S. Tsirkin @ 2013-12-11  0:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori

avoid hard-coding strings

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/i386/pc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 29c325e..50de724 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1331,7 +1331,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
      */
     if (!no_hpet && (!kvm_irqchip_in_kernel() || kvm_has_pit_state2())) {
         /* In order to set property, here not using sysbus_try_create_simple */
-        hpet = qdev_try_create(NULL, "hpet");
+        hpet = qdev_try_create(NULL, TYPE_HPET);
         if (hpet) {
             /* For pc-piix-*, hpet's intcap is always IRQ2. For pc-q35-1.7
              * and earlier, use IRQ2 for compat. Otherwise, use IRQ16~23,
-- 
MST

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-12-11  0:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-11  0:50 [Qemu-devel] [PATCH 1/2] hpet: fix build with CONFIG_HPET off Michael S. Tsirkin
2013-12-11  0:50 ` [Qemu-devel] [PATCH 2/2] pc: use macro for HPET type Michael S. Tsirkin

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).