Commit ad067148585b1fc98814b1ca3db4d0c1fdd969e0

Authored by aliguori
1 parent 9036de1a

Remove NICInfo from e1000 and mipsnet state (Mark McLoughlin)

NICInfo isn't used after initialization, so remove it from the driver
state structures.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7147 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 2 changed files with 2 additions and 6 deletions
hw/e1000.c
@@ -75,7 +75,6 @@ enum { @@ -75,7 +75,6 @@ enum {
75 typedef struct E1000State_st { 75 typedef struct E1000State_st {
76 PCIDevice dev; 76 PCIDevice dev;
77 VLANClientState *vc; 77 VLANClientState *vc;
78 - NICInfo *nd;  
79 int mmio_index; 78 int mmio_index;
80 79
81 uint32_t mac_reg[0x8000]; 80 uint32_t mac_reg[0x8000];
@@ -1078,7 +1077,6 @@ pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn) @@ -1078,7 +1077,6 @@ pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn)
1078 pci_register_io_region((PCIDevice *)d, 1, IOPORT_SIZE, 1077 pci_register_io_region((PCIDevice *)d, 1, IOPORT_SIZE,
1079 PCI_ADDRESS_SPACE_IO, ioport_map); 1078 PCI_ADDRESS_SPACE_IO, ioport_map);
1080 1079
1081 - d->nd = nd;  
1082 memmove(d->eeprom_data, e1000_eeprom_template, 1080 memmove(d->eeprom_data, e1000_eeprom_template,
1083 sizeof e1000_eeprom_template); 1081 sizeof e1000_eeprom_template);
1084 for (i = 0; i < 3; i++) 1082 for (i = 0; i < 3; i++)
@@ -1099,7 +1097,7 @@ pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn) @@ -1099,7 +1097,7 @@ pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn)
1099 e1000_receive, e1000_can_receive, d); 1097 e1000_receive, e1000_can_receive, d);
1100 d->vc->link_status_changed = e1000_set_link_status; 1098 d->vc->link_status_changed = e1000_set_link_status;
1101 1099
1102 - qemu_format_nic_info_str(d->vc, d->nd->macaddr); 1100 + qemu_format_nic_info_str(d->vc, nd->macaddr);
1103 1101
1104 register_savevm(info_str, -1, 2, nic_save, nic_load, d); 1102 register_savevm(info_str, -1, 2, nic_save, nic_load, d);
1105 d->dev.unregister = pci_e1000_uninit; 1103 d->dev.unregister = pci_e1000_uninit;
hw/mipsnet.c
@@ -35,7 +35,6 @@ typedef struct MIPSnetState { @@ -35,7 +35,6 @@ typedef struct MIPSnetState {
35 uint8_t tx_buffer[MAX_ETH_FRAME_SIZE]; 35 uint8_t tx_buffer[MAX_ETH_FRAME_SIZE];
36 qemu_irq irq; 36 qemu_irq irq;
37 VLANClientState *vc; 37 VLANClientState *vc;
38 - NICInfo *nd;  
39 } MIPSnetState; 38 } MIPSnetState;
40 39
41 static void mipsnet_reset(MIPSnetState *s) 40 static void mipsnet_reset(MIPSnetState *s)
@@ -248,7 +247,6 @@ void mipsnet_init (int base, qemu_irq irq, NICInfo *nd) @@ -248,7 +247,6 @@ void mipsnet_init (int base, qemu_irq irq, NICInfo *nd)
248 register_ioport_read(base, 36, 4, mipsnet_ioport_read, s); 247 register_ioport_read(base, 36, 4, mipsnet_ioport_read, s);
249 248
250 s->irq = irq; 249 s->irq = irq;
251 - s->nd = nd;  
252 if (nd && nd->vlan) { 250 if (nd && nd->vlan) {
253 s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, 251 s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,
254 mipsnet_receive, mipsnet_can_receive, s); 252 mipsnet_receive, mipsnet_can_receive, s);
@@ -256,7 +254,7 @@ void mipsnet_init (int base, qemu_irq irq, NICInfo *nd) @@ -256,7 +254,7 @@ void mipsnet_init (int base, qemu_irq irq, NICInfo *nd)
256 s->vc = NULL; 254 s->vc = NULL;
257 } 255 }
258 256
259 - qemu_format_nic_info_str(s->vc, s->nd->macaddr); 257 + qemu_format_nic_info_str(s->vc, nd->macaddr);
260 258
261 mipsnet_reset(s); 259 mipsnet_reset(s);
262 register_savevm("mipsnet", 0, 0, mipsnet_save, mipsnet_load, s); 260 register_savevm("mipsnet", 0, 0, mipsnet_save, mipsnet_load, s);