mirror_qemu/hw/sh4
Philippe Mathieu-Daudé 8e5c952b37 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>
2020-05-15 07:08:52 +02:00
..
Kconfig hw/usb/hcd-ohci: Move PCI-related code into a separate file 2019-05-02 08:42:17 +02:00
Makefile.objs hw/sh4/Makefile.objs: New CONFIG_* varibales created for sh4 boards and device 2019-02-05 16:50:20 +01:00
r2d.c sm501: make SerialMM a child, export chardev property 2020-01-07 17:24:29 +04:00
sh7750.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
sh7750_regnames.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
sh7750_regnames.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
sh7750_regs.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
sh_pci.c hw: Remove unnecessary DEVICE() cast 2020-05-15 07:08:52 +02:00
shix.c hw/sh4: Use memory_region_init_rom() with read-only regions 2020-03-17 15:18:47 +01:00