diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2011-11-04 12:03:33 +1100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-12 11:16:50 -0600 |
commit | 00c3a05b25533d7cb42b599509390fb1488d597c (patch) | |
tree | 0b09b5c02e5981935ec7bc0e394277dd67274664 /hw/e1000.c | |
parent | e965d4bce3ebbb5a33bba24926a8f6ba0825994c (diff) | |
download | hqemu-00c3a05b25533d7cb42b599509390fb1488d597c.zip hqemu-00c3a05b25533d7cb42b599509390fb1488d597c.tar.gz |
Remove unnecessary casts from PCI DMA code in e1000
This patch removes some unnecessary casts in the e1000 device,
introduced by commit 62ecbd353d25e62c4a6c327ea88ba5404e13507a 'e1000:
Use PCI DMA stub functions'.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/e1000.c')
-rw-r--r-- | hw/e1000.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -507,7 +507,7 @@ txdesc_writeback(E1000State *s, dma_addr_t base, struct e1000_tx_desc *dp) ~(E1000_TXD_STAT_EC | E1000_TXD_STAT_LC | E1000_TXD_STAT_TU); dp->upper.data = cpu_to_le32(txd_upper); pci_dma_write(&s->dev, base + ((char *)&dp->upper - (char *)dp), - (void *)&dp->upper, sizeof(dp->upper)); + &dp->upper, sizeof(dp->upper)); return E1000_ICR_TXDW; } @@ -534,7 +534,7 @@ start_xmit(E1000State *s) while (s->mac_reg[TDH] != s->mac_reg[TDT]) { base = tx_desc_base(s) + sizeof(struct e1000_tx_desc) * s->mac_reg[TDH]; - pci_dma_read(&s->dev, base, (void *)&desc, sizeof(desc)); + pci_dma_read(&s->dev, base, &desc, sizeof(desc)); DBGOUT(TX, "index %d: %p : %x %x\n", s->mac_reg[TDH], (void *)(intptr_t)desc.buffer_addr, desc.lower.data, @@ -714,7 +714,7 @@ e1000_receive(VLANClientState *nc, const uint8_t *buf, size_t size) desc_size = s->rxbuf_size; } base = rx_desc_base(s) + sizeof(desc) * s->mac_reg[RDH]; - pci_dma_read(&s->dev, base, (void *)&desc, sizeof(desc)); + pci_dma_read(&s->dev, base, &desc, sizeof(desc)); desc.special = vlan_special; desc.status |= (vlan_status | E1000_RXD_STAT_DD); if (desc.buffer_addr) { @@ -724,8 +724,7 @@ e1000_receive(VLANClientState *nc, const uint8_t *buf, size_t size) copy_size = s->rxbuf_size; } pci_dma_write(&s->dev, le64_to_cpu(desc.buffer_addr), - (void *)(buf + desc_offset + vlan_offset), - copy_size); + buf + desc_offset + vlan_offset, copy_size); } desc_offset += desc_size; desc.length = cpu_to_le16(desc_size); @@ -739,7 +738,7 @@ e1000_receive(VLANClientState *nc, const uint8_t *buf, size_t size) } else { // as per intel docs; skip descriptors with null buf addr DBGOUT(RX, "Null RX descriptor!!\n"); } - pci_dma_write(&s->dev, base, (void *)&desc, sizeof(desc)); + pci_dma_write(&s->dev, base, &desc, sizeof(desc)); if (++s->mac_reg[RDH] * sizeof(desc) >= s->mac_reg[RDLEN]) s->mac_reg[RDH] = 0; |