qemu/hw/i2c
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
..
aspeed_i2c.c aspeed/i2c: Prevent uninitialized warning 2020-02-06 11:13:24 +01:00
bitbang_i2c.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
core.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
exynos4210_i2c.c Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
imx_i2c.c hw: Remove unnecessary DEVICE() cast 2020-05-15 07:08:52 +02:00
Kconfig hw/arm: Express dependencies of realview, versatile and vexpress with Kconfig 2019-05-13 09:36:31 +02:00
Makefile.objs hw/*/Makefile.objs: Move many .o files to common-objs 2020-02-04 09:00:57 +01:00
microbit_i2c.c hw/arm/nrf51: Add NRF51_PERIPHERAL_SIZE definition 2020-05-11 11:05:11 +01:00
mpc_i2c.c hw: Remove unnecessary DEVICE() cast 2020-05-15 07:08:52 +02:00
omap_i2c.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
pm_smbus.c hw/i2c/pm_smbus: Remove dead assignment 2020-05-04 14:43:24 +02:00
ppc4xx_i2c.c hw/*/Makefile.objs: Move many .o files to common-objs 2020-02-04 09:00:57 +01:00
smbus_eeprom.c smbus: Fix spd_data_generate() for number of banks > 2 2020-04-29 08:01:52 +02:00
smbus_ich9.c hw/i2c/smbus_ich9: Include "qemu/range.h" 2020-03-09 15:59:31 +01:00
smbus_master.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
smbus_slave.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
trace-events aspeed/i2c: Add trace events 2019-12-16 10:46:34 +00:00
versatile_i2c.c hw/i2c/bitbang_i2c: Use in-place rather than malloc'd bitbang_i2c_interface struct 2019-07-03 10:51:35 +02:00