aboutsummaryrefslogtreecommitdiff
path: root/hw/net
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-09-16 14:25:19 -0400
committerEduardo Habkost <ehabkost@redhat.com>2020-09-18 14:12:32 -0400
commit8063396bf3459a810d24e3efd6110b8480f0de5b (patch)
tree40f85f15d7016e3ee66916a59be53d2b2c71510a /hw/net
parenta489d1951cd9cc91c5954214fcf6ae0f9d2d4292 (diff)
Use OBJECT_DECLARE_SIMPLE_TYPE when possible
This converts existing DECLARE_INSTANCE_CHECKER usage to OBJECT_DECLARE_SIMPLE_TYPE when possible. $ ./scripts/codeconverter/converter.py -i \ --pattern=AddObjectDeclareSimpleType $(git grep -l '' -- '*.[ch]') Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Paul Durrant <paul@xen.org> Message-Id: <20200916182519.415636-6-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/net')
-rw-r--r--hw/net/dp8393x.c4
-rw-r--r--hw/net/e1000e.c4
-rw-r--r--hw/net/etraxfs_eth.c4
-rw-r--r--hw/net/fsl_etsec/etsec.h3
-rw-r--r--hw/net/lan9118.c4
-rw-r--r--hw/net/milkymist-minimac2.c4
-rw-r--r--hw/net/mipsnet.c4
-rw-r--r--hw/net/ne2000-isa.c4
-rw-r--r--hw/net/opencores_eth.c4
-rw-r--r--hw/net/pcnet-pci.c4
-rw-r--r--hw/net/rtl8139.c4
-rw-r--r--hw/net/smc91c111.c4
-rw-r--r--hw/net/spapr_llan.c4
-rw-r--r--hw/net/stellaris_enet.c4
-rw-r--r--hw/net/sungem.c4
-rw-r--r--hw/net/sunhme.c4
-rw-r--r--hw/net/tulip.h4
-rw-r--r--hw/net/xgmac.c4
-rw-r--r--hw/net/xilinx_axienet.c4
19 files changed, 19 insertions, 56 deletions
diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c
index 56b96e9b0f..674b04b354 100644
--- a/hw/net/dp8393x.c
+++ b/hw/net/dp8393x.c
@@ -151,9 +151,7 @@ do { printf("sonic ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } while (0)
#define SONIC_DESC_ADDR 0xFFFE
#define TYPE_DP8393X "dp8393x"
-typedef struct dp8393xState dp8393xState;
-DECLARE_INSTANCE_CHECKER(dp8393xState, DP8393X,
- TYPE_DP8393X)
+OBJECT_DECLARE_SIMPLE_TYPE(dp8393xState, DP8393X)
struct dp8393xState {
SysBusDevice parent_obj;
diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
index 938d44f198..b6f1ae3c8f 100644
--- a/hw/net/e1000e.c
+++ b/hw/net/e1000e.c
@@ -56,9 +56,7 @@
#include "qom/object.h"
#define TYPE_E1000E "e1000e"
-typedef struct E1000EState E1000EState;
-DECLARE_INSTANCE_CHECKER(E1000EState, E1000E,
- TYPE_E1000E)
+OBJECT_DECLARE_SIMPLE_TYPE(E1000EState, E1000E)
struct E1000EState {
PCIDevice parent_obj;
diff --git a/hw/net/etraxfs_eth.c b/hw/net/etraxfs_eth.c
index 36d898ad16..1b82aec794 100644
--- a/hw/net/etraxfs_eth.c
+++ b/hw/net/etraxfs_eth.c
@@ -324,9 +324,7 @@ static void mdio_cycle(struct qemu_mdio *bus)
#define FS_ETH_MAX_REGS 0x17
#define TYPE_ETRAX_FS_ETH "etraxfs-eth"
-typedef struct ETRAXFSEthState ETRAXFSEthState;
-DECLARE_INSTANCE_CHECKER(ETRAXFSEthState, ETRAX_FS_ETH,
- TYPE_ETRAX_FS_ETH)
+OBJECT_DECLARE_SIMPLE_TYPE(ETRAXFSEthState, ETRAX_FS_ETH)
struct ETRAXFSEthState {
SysBusDevice parent_obj;
diff --git a/hw/net/fsl_etsec/etsec.h b/hw/net/fsl_etsec/etsec.h
index 0c929d9afd..fddf551544 100644
--- a/hw/net/fsl_etsec/etsec.h
+++ b/hw/net/fsl_etsec/etsec.h
@@ -150,8 +150,7 @@ struct eTSEC {
typedef struct eTSEC eTSEC;
#define TYPE_ETSEC_COMMON "eTSEC"
-DECLARE_INSTANCE_CHECKER(eTSEC, ETSEC_COMMON,
- TYPE_ETSEC_COMMON)
+OBJECT_DECLARE_SIMPLE_TYPE(eTSEC, ETSEC_COMMON)
#define eTSEC_TRANSMIT 1
#define eTSEC_RECEIVE 2
diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c
index 57a59accd0..ab57c02c8e 100644
--- a/hw/net/lan9118.c
+++ b/hw/net/lan9118.c
@@ -181,9 +181,7 @@ static const VMStateDescription vmstate_lan9118_packet = {
}
};
-typedef struct lan9118_state lan9118_state;
-DECLARE_INSTANCE_CHECKER(lan9118_state, LAN9118,
- TYPE_LAN9118)
+OBJECT_DECLARE_SIMPLE_TYPE(lan9118_state, LAN9118)
struct lan9118_state {
SysBusDevice parent_obj;
diff --git a/hw/net/milkymist-minimac2.c b/hw/net/milkymist-minimac2.c
index 41a8543edf..78c20c94e5 100644
--- a/hw/net/milkymist-minimac2.c
+++ b/hw/net/milkymist-minimac2.c
@@ -99,9 +99,7 @@ struct MilkymistMinimac2MdioState {
typedef struct MilkymistMinimac2MdioState MilkymistMinimac2MdioState;
#define TYPE_MILKYMIST_MINIMAC2 "milkymist-minimac2"
-typedef struct MilkymistMinimac2State MilkymistMinimac2State;
-DECLARE_INSTANCE_CHECKER(MilkymistMinimac2State, MILKYMIST_MINIMAC2,
- TYPE_MILKYMIST_MINIMAC2)
+OBJECT_DECLARE_SIMPLE_TYPE(MilkymistMinimac2State, MILKYMIST_MINIMAC2)
struct MilkymistMinimac2State {
SysBusDevice parent_obj;
diff --git a/hw/net/mipsnet.c b/hw/net/mipsnet.c
index 61dbd575da..2ade72dea0 100644
--- a/hw/net/mipsnet.c
+++ b/hw/net/mipsnet.c
@@ -25,9 +25,7 @@
#define MAX_ETH_FRAME_SIZE 1514
#define TYPE_MIPS_NET "mipsnet"
-typedef struct MIPSnetState MIPSnetState;
-DECLARE_INSTANCE_CHECKER(MIPSnetState, MIPS_NET,
- TYPE_MIPS_NET)
+OBJECT_DECLARE_SIMPLE_TYPE(MIPSnetState, MIPS_NET)
struct MIPSnetState {
SysBusDevice parent_obj;
diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c
index 688a0cc4f6..dd6f6e34d3 100644
--- a/hw/net/ne2000-isa.c
+++ b/hw/net/ne2000-isa.c
@@ -33,9 +33,7 @@
#include "qemu/module.h"
#include "qom/object.h"
-typedef struct ISANE2000State ISANE2000State;
-DECLARE_INSTANCE_CHECKER(ISANE2000State, ISA_NE2000,
- TYPE_ISA_NE2000)
+OBJECT_DECLARE_SIMPLE_TYPE(ISANE2000State, ISA_NE2000)
struct ISANE2000State {
ISADevice parent_obj;
diff --git a/hw/net/opencores_eth.c b/hw/net/opencores_eth.c
index 5cd204c30c..0b3dc3146e 100644
--- a/hw/net/opencores_eth.c
+++ b/hw/net/opencores_eth.c
@@ -272,9 +272,7 @@ typedef struct desc {
#define DEFAULT_PHY 1
#define TYPE_OPEN_ETH "open_eth"
-typedef struct OpenEthState OpenEthState;
-DECLARE_INSTANCE_CHECKER(OpenEthState, OPEN_ETH,
- TYPE_OPEN_ETH)
+OBJECT_DECLARE_SIMPLE_TYPE(OpenEthState, OPEN_ETH)
struct OpenEthState {
SysBusDevice parent_obj;
diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c
index 449970bc52..ccc3fce2a0 100644
--- a/hw/net/pcnet-pci.c
+++ b/hw/net/pcnet-pci.c
@@ -52,9 +52,7 @@
#define TYPE_PCI_PCNET "pcnet"
-typedef struct PCIPCNetState PCIPCNetState;
-DECLARE_INSTANCE_CHECKER(PCIPCNetState, PCI_PCNET,
- TYPE_PCI_PCNET)
+OBJECT_DECLARE_SIMPLE_TYPE(PCIPCNetState, PCI_PCNET)
struct PCIPCNetState {
/*< private >*/
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index 9246388f58..ba5ace1ab7 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -94,9 +94,7 @@ static inline GCC_FMT_ATTR(1, 2) int DPRINTF(const char *fmt, ...)
#define TYPE_RTL8139 "rtl8139"
-typedef struct RTL8139State RTL8139State;
-DECLARE_INSTANCE_CHECKER(RTL8139State, RTL8139,
- TYPE_RTL8139)
+OBJECT_DECLARE_SIMPLE_TYPE(RTL8139State, RTL8139)
/* Symbolic offsets to registers. */
enum RTL8139_registers {
diff --git a/hw/net/smc91c111.c b/hw/net/smc91c111.c
index 9fad904321..ad778cd8fc 100644
--- a/hw/net/smc91c111.c
+++ b/hw/net/smc91c111.c
@@ -25,9 +25,7 @@
#define NUM_PACKETS 4
#define TYPE_SMC91C111 "smc91c111"
-typedef struct smc91c111_state smc91c111_state;
-DECLARE_INSTANCE_CHECKER(smc91c111_state, SMC91C111,
- TYPE_SMC91C111)
+OBJECT_DECLARE_SIMPLE_TYPE(smc91c111_state, SMC91C111)
struct smc91c111_state {
SysBusDevice parent_obj;
diff --git a/hw/net/spapr_llan.c b/hw/net/spapr_llan.c
index d34cb29607..2093f1bad0 100644
--- a/hw/net/spapr_llan.c
+++ b/hw/net/spapr_llan.c
@@ -85,9 +85,7 @@ typedef uint64_t vlan_bd_t;
#define VLAN_MAX_BUFS (VLAN_RX_BDS_LEN / 8)
#define TYPE_VIO_SPAPR_VLAN_DEVICE "spapr-vlan"
-typedef struct SpaprVioVlan SpaprVioVlan;
-DECLARE_INSTANCE_CHECKER(SpaprVioVlan, VIO_SPAPR_VLAN_DEVICE,
- TYPE_VIO_SPAPR_VLAN_DEVICE)
+OBJECT_DECLARE_SIMPLE_TYPE(SpaprVioVlan, VIO_SPAPR_VLAN_DEVICE)
#define RX_POOL_MAX_BDS 4096
#define RX_MAX_POOLS 5
diff --git a/hw/net/stellaris_enet.c b/hw/net/stellaris_enet.c
index 9f13afa4e4..8dd60783d8 100644
--- a/hw/net/stellaris_enet.c
+++ b/hw/net/stellaris_enet.c
@@ -51,9 +51,7 @@ do { fprintf(stderr, "stellaris_enet: error: " fmt , ## __VA_ARGS__);} while (0)
#define SE_TCTL_DUPLEX 0x08
#define TYPE_STELLARIS_ENET "stellaris_enet"
-typedef struct stellaris_enet_state stellaris_enet_state;
-DECLARE_INSTANCE_CHECKER(stellaris_enet_state, STELLARIS_ENET,
- TYPE_STELLARIS_ENET)
+OBJECT_DECLARE_SIMPLE_TYPE(stellaris_enet_state, STELLARIS_ENET)
typedef struct {
uint8_t data[2048];
diff --git a/hw/net/sungem.c b/hw/net/sungem.c
index 91753830a7..33c3722df6 100644
--- a/hw/net/sungem.c
+++ b/hw/net/sungem.c
@@ -23,9 +23,7 @@
#define TYPE_SUNGEM "sungem"
-typedef struct SunGEMState SunGEMState;
-DECLARE_INSTANCE_CHECKER(SunGEMState, SUNGEM,
- TYPE_SUNGEM)
+OBJECT_DECLARE_SIMPLE_TYPE(SunGEMState, SUNGEM)
#define MAX_PACKET_SIZE 9016
diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c
index 7364ba1019..fc34905f87 100644
--- a/hw/net/sunhme.c
+++ b/hw/net/sunhme.c
@@ -130,9 +130,7 @@
#define MII_COMMAND_WRITE 0x1
#define TYPE_SUNHME "sunhme"
-typedef struct SunHMEState SunHMEState;
-DECLARE_INSTANCE_CHECKER(SunHMEState, SUNHME,
- TYPE_SUNHME)
+OBJECT_DECLARE_SIMPLE_TYPE(SunHMEState, SUNHME)
/* Maximum size of buffer */
#define HME_FIFO_SIZE 0x800
diff --git a/hw/net/tulip.h b/hw/net/tulip.h
index 87e3ab79bc..ffd1f88d57 100644
--- a/hw/net/tulip.h
+++ b/hw/net/tulip.h
@@ -6,9 +6,7 @@
#include "qom/object.h"
#define TYPE_TULIP "tulip"
-typedef struct TULIPState TULIPState;
-DECLARE_INSTANCE_CHECKER(TULIPState, TULIP,
- TYPE_TULIP)
+OBJECT_DECLARE_SIMPLE_TYPE(TULIPState, TULIP)
#define CSR(_x) ((_x) << 3)
diff --git a/hw/net/xgmac.c b/hw/net/xgmac.c
index a066550023..00859a7d50 100644
--- a/hw/net/xgmac.c
+++ b/hw/net/xgmac.c
@@ -140,9 +140,7 @@ typedef struct RxTxStats {
} RxTxStats;
#define TYPE_XGMAC "xgmac"
-typedef struct XgmacState XgmacState;
-DECLARE_INSTANCE_CHECKER(XgmacState, XGMAC,
- TYPE_XGMAC)
+OBJECT_DECLARE_SIMPLE_TYPE(XgmacState, XGMAC)
struct XgmacState {
SysBusDevice parent_obj;
diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c
index 4e13786e50..f8cf5290e1 100644
--- a/hw/net/xilinx_axienet.c
+++ b/hw/net/xilinx_axienet.c
@@ -43,9 +43,7 @@
#define TYPE_XILINX_AXI_ENET_DATA_STREAM "xilinx-axienet-data-stream"
#define TYPE_XILINX_AXI_ENET_CONTROL_STREAM "xilinx-axienet-control-stream"
-typedef struct XilinxAXIEnet XilinxAXIEnet;
-DECLARE_INSTANCE_CHECKER(XilinxAXIEnet, XILINX_AXI_ENET,
- TYPE_XILINX_AXI_ENET)
+OBJECT_DECLARE_SIMPLE_TYPE(XilinxAXIEnet, XILINX_AXI_ENET)
typedef struct XilinxAXIEnetStreamSlave XilinxAXIEnetStreamSlave;
DECLARE_INSTANCE_CHECKER(XilinxAXIEnetStreamSlave, XILINX_AXI_ENET_DATA_STREAM,