qemu/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
acpi
adc
alpha
arm
audio
block
char
core
cpu
cris
display
dma
gpio
hppa
hyperv
i2c
i386
ide
input
intc
ipack
ipmi
isa
lm32
m68k
mem
microblaze
mips
misc
moxie
net
nios2
nubus
nvram
openrisc
pci
pci-bridge
pci-host
pcmcia
ppc
rdma
riscv
rtc
s390x
scsi
sd
semihosting
sh4
smbios
sparc
sparc64
ssi
timer
tpm
tricore
unicore32
usb
vfio
virtio
watchdog
xen
xenpv
xtensa
Kconfig
Makefile.objs