aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Le Goater <clg@redhat.com>2024-05-02 15:15:33 +0200
committerThomas Huth <thuth@redhat.com>2024-05-10 06:23:56 +0200
commit3d9836e46dbe1e46c39fe76a62d3085a71ddbf7a (patch)
treecf74619dee535c7c1da064b9740c54a80cfdd8c1
parentaf4a3e32f3e1284662ebc1fd50a8c5e1776ebece (diff)
downloadqemu-3d9836e46dbe1e46c39fe76a62d3085a71ddbf7a.zip
qemu-3d9836e46dbe1e46c39fe76a62d3085a71ddbf7a.tar.gz
qemu-3d9836e46dbe1e46c39fe76a62d3085a71ddbf7a.tar.bz2
s390x/sclp: Simplify get_sclp_device()
get_sclp_device() scans the whole machine to find a TYPE_SCLP object. Now that the SCLPDevice instance is available under the machine state, use it to simplify the lookup. While at it, remove the inline to let the compiler decide on how to optimize. Signed-off-by: Cédric Le Goater <clg@redhat.com> Message-ID: <20240502131533.377719-4-clg@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
-rw-r--r--hw/s390x/sclp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
index d236dba..e725dcd 100644
--- a/hw/s390x/sclp.c
+++ b/hw/s390x/sclp.c
@@ -21,13 +21,14 @@
#include "hw/s390x/s390-pci-bus.h"
#include "hw/s390x/ipl.h"
#include "hw/s390x/cpu-topology.h"
+#include "hw/s390x/s390-virtio-ccw.h"
-static inline SCLPDevice *get_sclp_device(void)
+static SCLPDevice *get_sclp_device(void)
{
static SCLPDevice *sclp;
if (!sclp) {
- sclp = SCLP(object_resolve_path_type("", TYPE_SCLP, NULL));
+ sclp = S390_CCW_MACHINE(qdev_get_machine())->sclp;
}
return sclp;
}