aboutsummaryrefslogtreecommitdiff
path: root/hw/misc/cbus.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2022-09-23 14:00:24 +0200
committerLaurent Vivier <laurent@vivier.eu>2022-10-22 23:15:40 +0200
commit0a553c12c71d5627abf223a926ab9688a5573f54 (patch)
tree95184e811f9e92c0b734e83e2af3a57a80d18536 /hw/misc/cbus.c
parent4bb5923605b2b8994f933df23aa948efe7ba545c (diff)
downloadqemu-0a553c12c71d5627abf223a926ab9688a5573f54.zip
qemu-0a553c12c71d5627abf223a926ab9688a5573f54.tar.gz
qemu-0a553c12c71d5627abf223a926ab9688a5573f54.tar.bz2
Drop useless casts from g_malloc() & friends to pointer
These memory allocation functions return void *, and casting to another pointer type is useless clutter. Drop these casts. If you really want another pointer type, consider g_new(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20220923120025.448759-3-armbru@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'hw/misc/cbus.c')
-rw-r--r--hw/misc/cbus.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/misc/cbus.c b/hw/misc/cbus.c
index 3c3721a..653e8dd 100644
--- a/hw/misc/cbus.c
+++ b/hw/misc/cbus.c
@@ -133,7 +133,7 @@ static void cbus_sel(void *opaque, int line, int level)
CBus *cbus_init(qemu_irq dat)
{
- CBusPriv *s = (CBusPriv *) g_malloc0(sizeof(*s));
+ CBusPriv *s = g_malloc0(sizeof(*s));
s->dat_out = dat;
s->cbus.clk = qemu_allocate_irq(cbus_clk, s, 0);
@@ -388,7 +388,7 @@ static void retu_io(void *opaque, int rw, int reg, uint16_t *val)
void *retu_init(qemu_irq irq, int vilma)
{
- CBusRetu *s = (CBusRetu *) g_malloc0(sizeof(*s));
+ CBusRetu *s = g_malloc0(sizeof(*s));
s->irq = irq;
s->irqen = 0xffff;
@@ -604,7 +604,7 @@ static void tahvo_io(void *opaque, int rw, int reg, uint16_t *val)
void *tahvo_init(qemu_irq irq, int betty)
{
- CBusTahvo *s = (CBusTahvo *) g_malloc0(sizeof(*s));
+ CBusTahvo *s = g_malloc0(sizeof(*s));
s->irq = irq;
s->irqen = 0xffff;