qemu-e2k/hw
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
..
9pfs qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
acpi qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
adc
alpha hw/ide: Do ide_drive_get() within pci_ide_create_devs() 2020-03-17 12:22:36 -04:00
arm qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
audio qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
block qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
char qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
core various: Remove unnecessary OBJECT() cast 2020-05-15 07:08:14 +02:00
cpu qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
cris
display hw: Remove unnecessary DEVICE() cast 2020-05-15 07:08:52 +02:00
dma qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
gpio qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
hppa hw/ide: Remove unneeded inclusion of hw/ide.h 2020-03-17 12:22:36 -04:00
hyperv qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
i2c hw: Remove unnecessary DEVICE() cast 2020-05-15 07:08:52 +02:00
i386 qom: Drop @errp parameter of object_property_del() 2020-05-15 07:08:14 +02:00
ide hw: Remove unnecessary DEVICE() cast 2020-05-15 07:08:52 +02:00
input qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
intc qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
ipack qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
ipmi various: Remove unnecessary OBJECT() cast 2020-05-15 07:08:14 +02:00
isa Drop more @errp parameters after previous commit 2020-05-15 07:08:14 +02:00
lm32
m68k hw/m68k: Use memory_region_init_rom() with read-only regions 2020-03-17 15:18:47 +01:00
mem qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
microblaze various: Remove unnecessary OBJECT() cast 2020-05-15 07:08:14 +02:00
mips smbus: Fix spd_data_generate() error API violation 2020-04-29 08:01:52 +02:00
misc hw: Remove unnecessary DEVICE() cast 2020-05-15 07:08:52 +02:00
moxie
net hw: Remove unnecessary DEVICE() cast 2020-05-15 07:08:52 +02:00
nios2 qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
nubus hw: Remove unnecessary DEVICE() cast 2020-05-15 07:08:52 +02:00
nvram qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
openrisc
pci qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
pci-bridge
pci-host hw: Remove unnecessary DEVICE() cast 2020-05-15 07:08:52 +02:00
pcmcia qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
ppc hw: Remove unnecessary DEVICE() cast 2020-05-15 07:08:52 +02:00
rdma lockable: Replace locks with lock guard macros 2020-05-04 16:07:43 +01:00
riscv qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
rtc qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
s390x various: Remove unnecessary OBJECT() cast 2020-05-15 07:08:14 +02:00
scsi qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
sd qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
semihosting
sh4 hw: Remove unnecessary DEVICE() cast 2020-05-15 07:08:52 +02:00
smbios
sparc qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
sparc64 qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
ssi qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
timer hw/timer/nrf51_timer: Add trace event of counter value update 2020-05-11 11:05:52 +01:00
tpm hw/tpm: fix usage of bool in tpm-tis.c 2020-05-12 11:47:24 -04:00
tricore
unicore32
usb qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
vfio qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
virtio qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
watchdog qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
xen hw: Remove unnecessary DEVICE() cast 2020-05-15 07:08:52 +02:00
xenpv
xtensa
Kconfig
Makefile.objs