summaryrefslogtreecommitdiffstats
path: root/hw/display/sm501.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé2020-05-12 09:00:20 +0200
committerMarkus Armbruster2020-05-15 07:08:52 +0200
commit8e5c952b370b57beb642826882c80e1b66a9cf12 (patch)
tree1fad74d43f0e2e8a6424df685757d67cfbbae02e /hw/display/sm501.c
parentvarious: Remove unnecessary OBJECT() cast (diff)
downloadqemu-8e5c952b370b57beb642826882c80e1b66a9cf12.tar.gz
qemu-8e5c952b370b57beb642826882c80e1b66a9cf12.tar.xz
qemu-8e5c952b370b57beb642826882c80e1b66a9cf12.zip
hw: Remove unnecessary DEVICE() cast
The DEVICE() macro is defined as: #define DEVICE(obj) OBJECT_CHECK(DeviceState, (obj), TYPE_DEVICE) which expands to: ((DeviceState *)object_dynamic_cast_assert((Object *)(obj), (name), __FILE__, __LINE__, __func__)) This assertion can only fail when @obj points to something other than its stated type, i.e. when we're in undefined behavior country. Remove the unnecessary DEVICE() casts when we already know the pointer is of DeviceState type. Patch created mechanically using spatch with this script: @@ typedef DeviceState; DeviceState *s; @@ - DEVICE(s) + s Acked-by: David Gibson <david@gibson.dropbear.id.au> Acked-by: Paul Durrant <paul@xen.org> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Acked-by: John Snow <jsnow@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20200512070020.22782-4-f4bug@amsat.org>
Diffstat (limited to 'hw/display/sm501.c')
-rw-r--r--hw/display/sm501.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index 296cd56c4a..acc692531a 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -1839,7 +1839,7 @@ static void sm501_init(SM501State *s, DeviceState *dev,
&s->twoD_engine_region);
/* create qemu graphic console */
- s->con = graphic_console_init(DEVICE(dev), 0, &sm501_ops, s);
+ s->con = graphic_console_init(dev, 0, &sm501_ops, s);
}
static const VMStateDescription vmstate_sm501_state = {