qemu-e2k/hw/net
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
..
can qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
fsl_etsec
rocker
allwinner_emac.c hw/net: Make NetCanReceive() return a boolean 2020-03-31 21:14:35 +08:00
allwinner-sun8i-emac.c hw/net/allwinner-sun8i-emac.c: Fix REG_ADDR_HIGH/LOW reads 2020-03-31 21:14:35 +08:00
cadence_gem.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
dp8393x.c hw/net: Make NetCanReceive() return a boolean 2020-03-31 21:14:35 +08:00
e1000_regs.h
e1000.c Drop more @errp parameters after previous commit 2020-05-15 07:08:14 +02:00
e1000e_core.c
e1000e_core.h
e1000e.c Drop more @errp parameters after previous commit 2020-05-15 07:08:14 +02:00
e1000x_common.c
e1000x_common.h
eepro100.c Drop more @errp parameters after previous commit 2020-05-15 07:08:14 +02:00
etraxfs_eth.c
ftgmac100.c hw: Remove unnecessary DEVICE() cast 2020-05-15 07:08:52 +02:00
i82596.c hw/net: Make NetCanReceive() return a boolean 2020-03-31 21:14:35 +08:00
i82596.h hw/net: Make NetCanReceive() return a boolean 2020-03-31 21:14:35 +08:00
imx_fec.c hw: Remove unnecessary DEVICE() cast 2020-05-15 07:08:52 +02:00
Kconfig
lan9118.c
lance.c Drop more @errp parameters after previous commit 2020-05-15 07:08:14 +02:00
lasi_i82596.c Drop more @errp parameters after previous commit 2020-05-15 07:08:14 +02:00
Makefile.objs hw/net: Add Smartfusion2 emac block 2020-04-30 11:52:28 +01:00
mcf_fec.c
milkymist-minimac2.c
mipsnet.c
msf2-emac.c hw/net: Add Smartfusion2 emac block 2020-04-30 11:52:28 +01:00
ne2000-isa.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
ne2000-pci.c Drop more @errp parameters after previous commit 2020-05-15 07:08:14 +02:00
ne2000.c
ne2000.h
net_rx_pkt.c
net_rx_pkt.h
net_tx_pkt.c
net_tx_pkt.h
opencores_eth.c hw/net: Make NetCanReceive() return a boolean 2020-03-31 21:14:35 +08:00
pcnet-pci.c Drop more @errp parameters after previous commit 2020-05-15 07:08:14 +02:00
pcnet.c
pcnet.h
rtl8139.c Drop more @errp parameters after previous commit 2020-05-15 07:08:14 +02:00
smc91c111.c hw/net: Make NetCanReceive() return a boolean 2020-03-31 21:14:35 +08:00
spapr_llan.c Drop more @errp parameters after previous commit 2020-05-15 07:08:14 +02:00
stellaris_enet.c
sungem.c Drop more @errp parameters after previous commit 2020-05-15 07:08:14 +02:00
sunhme.c Drop more @errp parameters after previous commit 2020-05-15 07:08:14 +02:00
trace-events
tulip.c Drop more @errp parameters after previous commit 2020-05-15 07:08:14 +02:00
tulip.h
vhost_net-stub.c
vhost_net.c
virtio-net.c qdev: Unrealize must not fail 2020-05-15 07:08:14 +02:00
vmware_utils.h
vmxnet3_defs.h
vmxnet3.c Drop more @errp parameters after previous commit 2020-05-15 07:08:14 +02:00
vmxnet3.h
vmxnet_debug.h
xen_nic.c
xgmac.c
xilinx_axienet.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
xilinx_ethlite.c hw/net: Make NetCanReceive() return a boolean 2020-03-31 21:14:35 +08:00