qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [0/7] Remove unnecessary casts introduced by PCI DMA stubs series
@ 2011-11-04  1:03 David Gibson
  2011-11-04  1:03 ` [Qemu-devel] [PATCH 1/7] Remove unnecessary casts from PCI DMA code in eepro100 David Gibson
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: David Gibson @ 2011-11-04  1:03 UTC (permalink / raw)
  To: anthony; +Cc: joerg.roedel, agraf, qemu-devel, avi, eduard.munteanu, sw, rth

As a few people pointed out, my recent patch series introducing a new
(stub) PCI DMA API added unnecessary casts in quite a few places.  I
think this was a hangover from early days of the patchese where the
casts were necessary for some reason I've now forgotten.

Thanks for applying the series anyway, here is the requested followup
series which removes those unnecessary casts.

This still leaves the bug I introduced in eepro100 where
stl_le_pci_dma() is now used on a possibly unaligned address.  I'll be
sending another patch to fix that.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH 1/7] Remove unnecessary casts from PCI DMA code in eepro100
  2011-11-04  1:03 [Qemu-devel] [0/7] Remove unnecessary casts introduced by PCI DMA stubs series David Gibson
@ 2011-11-04  1:03 ` David Gibson
  2011-12-12 18:28   ` Anthony Liguori
  2011-11-04  1:03 ` [Qemu-devel] [PATCH 2/7] Remove unnecessary casts from PCI DMA code in e1000 David Gibson
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 11+ messages in thread
From: David Gibson @ 2011-11-04  1:03 UTC (permalink / raw)
  To: anthony; +Cc: joerg.roedel, agraf, qemu-devel, avi, eduard.munteanu, sw, rth

This patch removes some unnecessary casts in the eepro100 device,
introduced by commit 16ef60c9a8eeee269f7cbc95219a431b1d7cbf29
'eepro100: Use PCI DMA stub functions'.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/eepro100.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/hw/eepro100.c b/hw/eepro100.c
index 7d59e71..8769e33 100644
--- a/hw/eepro100.c
+++ b/hw/eepro100.c
@@ -713,8 +713,7 @@ static void dump_statistics(EEPRO100State * s)
      * values which really matter.
      * Number of data should check configuration!!!
      */
-    pci_dma_write(&s->dev, s->statsaddr,
-                  (uint8_t *) &s->statistics, s->stats_size);
+    pci_dma_write(&s->dev, s->statsaddr, &s->statistics, s->stats_size);
     stl_le_pci_dma(&s->dev, s->statsaddr + 0,
                    s->statistics.tx_good_frames);
     stl_le_pci_dma(&s->dev, s->statsaddr + 36,
@@ -732,7 +731,7 @@ static void dump_statistics(EEPRO100State * s)
 
 static void read_cb(EEPRO100State *s)
 {
-    pci_dma_read(&s->dev, s->cb_address, (uint8_t *) &s->tx, sizeof(s->tx));
+    pci_dma_read(&s->dev, s->cb_address, &s->tx, sizeof(s->tx));
     s->tx.status = le16_to_cpu(s->tx.status);
     s->tx.command = le16_to_cpu(s->tx.command);
     s->tx.link = le32_to_cpu(s->tx.link);
@@ -1707,7 +1706,7 @@ static ssize_t nic_receive(VLANClientState *nc, const uint8_t * buf, size_t size
     /* !!! */
     eepro100_rx_t rx;
     pci_dma_read(&s->dev, s->ru_base + s->ru_offset,
-                 (uint8_t *) &rx, sizeof(eepro100_rx_t));
+                 &rx, sizeof(eepro100_rx_t));
     uint16_t rfd_command = le16_to_cpu(rx.command);
     uint16_t rfd_size = le16_to_cpu(rx.size);
 
-- 
1.7.7

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH 2/7] Remove unnecessary casts from PCI DMA code in e1000
  2011-11-04  1:03 [Qemu-devel] [0/7] Remove unnecessary casts introduced by PCI DMA stubs series David Gibson
  2011-11-04  1:03 ` [Qemu-devel] [PATCH 1/7] Remove unnecessary casts from PCI DMA code in eepro100 David Gibson
@ 2011-11-04  1:03 ` David Gibson
  2011-11-04  1:03 ` [Qemu-devel] [PATCH 3/7] Remove unnecessary casts from PCI DMA code in PCI IDE David Gibson
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: David Gibson @ 2011-11-04  1:03 UTC (permalink / raw)
  To: anthony; +Cc: joerg.roedel, agraf, qemu-devel, avi, eduard.munteanu, sw, rth

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>
---
 hw/e1000.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/hw/e1000.c b/hw/e1000.c
index 986ed9c..a29c944 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -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;
-- 
1.7.7

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH 3/7] Remove unnecessary casts from PCI DMA code in PCI IDE
  2011-11-04  1:03 [Qemu-devel] [0/7] Remove unnecessary casts introduced by PCI DMA stubs series David Gibson
  2011-11-04  1:03 ` [Qemu-devel] [PATCH 1/7] Remove unnecessary casts from PCI DMA code in eepro100 David Gibson
  2011-11-04  1:03 ` [Qemu-devel] [PATCH 2/7] Remove unnecessary casts from PCI DMA code in e1000 David Gibson
@ 2011-11-04  1:03 ` David Gibson
  2011-11-04  1:03 ` [Qemu-devel] [PATCH 4/7] Remove unnecessary casts from PCI DMA code in lsi53c895a David Gibson
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: David Gibson @ 2011-11-04  1:03 UTC (permalink / raw)
  To: anthony; +Cc: joerg.roedel, agraf, qemu-devel, avi, eduard.munteanu, sw, rth

This patch removes some unnecessary casts in the PCI IDE device,
introduced by commit 552908fef5b67ad9d96b76d7cb8371ebc26c9bc8
'PCI IDE: Use PCI DMA stub functions'.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/ide/pci.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 49b823d..07d2cfa 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -71,7 +71,7 @@ static int bmdma_prepare_buf(IDEDMA *dma, int is_write)
             if (bm->cur_prd_last ||
                 (bm->cur_addr - bm->addr) >= BMDMA_PAGE_SIZE)
                 return s->io_buffer_size != 0;
-            pci_dma_read(&bm->pci_dev->dev, bm->cur_addr, (uint8_t *)&prd, 8);
+            pci_dma_read(&bm->pci_dev->dev, bm->cur_addr, &prd, 8);
             bm->cur_addr += 8;
             prd.addr = le32_to_cpu(prd.addr);
             prd.size = le32_to_cpu(prd.size);
@@ -113,7 +113,7 @@ static int bmdma_rw_buf(IDEDMA *dma, int is_write)
             if (bm->cur_prd_last ||
                 (bm->cur_addr - bm->addr) >= BMDMA_PAGE_SIZE)
                 return 0;
-            pci_dma_read(&bm->pci_dev->dev, bm->cur_addr, (uint8_t *)&prd, 8);
+            pci_dma_read(&bm->pci_dev->dev, bm->cur_addr, &prd, 8);
             bm->cur_addr += 8;
             prd.addr = le32_to_cpu(prd.addr);
             prd.size = le32_to_cpu(prd.size);
-- 
1.7.7

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH 4/7] Remove unnecessary casts from PCI DMA code in lsi53c895a
  2011-11-04  1:03 [Qemu-devel] [0/7] Remove unnecessary casts introduced by PCI DMA stubs series David Gibson
                   ` (2 preceding siblings ...)
  2011-11-04  1:03 ` [Qemu-devel] [PATCH 3/7] Remove unnecessary casts from PCI DMA code in PCI IDE David Gibson
@ 2011-11-04  1:03 ` David Gibson
  2011-11-04  1:03 ` [Qemu-devel] [PATCH 5/7] Remove unnecessary casts from PCI DMA code in rtl8139 David Gibson
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: David Gibson @ 2011-11-04  1:03 UTC (permalink / raw)
  To: anthony; +Cc: joerg.roedel, agraf, qemu-devel, avi, eduard.munteanu, sw, rth

This patch removes some unnecessary casts in the lsi53c895a device,
introduced by commit 9ba4524cda1348cbe741535f77815dca6a57da05
'lsi53c895a: Use PCI DMA stub functions'.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/lsi53c895a.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
index fcc27d7..0d3a101 100644
--- a/hw/lsi53c895a.c
+++ b/hw/lsi53c895a.c
@@ -392,7 +392,7 @@ static inline uint32_t read_dword(LSIState *s, uint32_t addr)
 {
     uint32_t buf;
 
-    pci_dma_read(&s->dev, addr, (uint8_t *)&buf, 4);
+    pci_dma_read(&s->dev, addr, &buf, 4);
     return cpu_to_le32(buf);
 }
 
@@ -1079,7 +1079,7 @@ again:
 
             /* 32-bit Table indirect */
             offset = sxt24(addr);
-            pci_dma_read(&s->dev, s->dsa + offset, (uint8_t *)buf, 8);
+            pci_dma_read(&s->dev, s->dsa + offset, buf, 8);
             /* byte count is stored in bits 0:23 only */
             s->dbc = cpu_to_le32(buf[0]) & 0xffffff;
             s->rbc = s->dbc;
-- 
1.7.7

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH 5/7] Remove unnecessary casts from PCI DMA code in rtl8139
  2011-11-04  1:03 [Qemu-devel] [0/7] Remove unnecessary casts introduced by PCI DMA stubs series David Gibson
                   ` (3 preceding siblings ...)
  2011-11-04  1:03 ` [Qemu-devel] [PATCH 4/7] Remove unnecessary casts from PCI DMA code in lsi53c895a David Gibson
@ 2011-11-04  1:03 ` David Gibson
  2011-11-04  1:03 ` [Qemu-devel] [PATCH 6/7] Remove unnecessary casts from PCI DMA code in usb-ehci David Gibson
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: David Gibson @ 2011-11-04  1:03 UTC (permalink / raw)
  To: anthony; +Cc: joerg.roedel, agraf, qemu-devel, avi, eduard.munteanu, sw, rth

This patch removes some unnecessary casts in the rtl8139 device,
introduced by commit 3ada003aee2004d24f23b9cd6f4eda87d9601ddb
'rtl8139: Use PCI DMA stub functions'.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/rtl8139.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/rtl8139.c b/hw/rtl8139.c
index 4c37993..30a7eb6 100644
--- a/hw/rtl8139.c
+++ b/hw/rtl8139.c
@@ -991,13 +991,13 @@ static ssize_t rtl8139_do_receive(VLANClientState *nc, const uint8_t *buf, size_
 
         uint32_t val, rxdw0,rxdw1,rxbufLO,rxbufHI;
 
-        pci_dma_read(&s->dev, cplus_rx_ring_desc, (uint8_t *)&val, 4);
+        pci_dma_read(&s->dev, cplus_rx_ring_desc, &val, 4);
         rxdw0 = le32_to_cpu(val);
-        pci_dma_read(&s->dev, cplus_rx_ring_desc+4, (uint8_t *)&val, 4);
+        pci_dma_read(&s->dev, cplus_rx_ring_desc+4, &val, 4);
         rxdw1 = le32_to_cpu(val);
-        pci_dma_read(&s->dev, cplus_rx_ring_desc+8, (uint8_t *)&val, 4);
+        pci_dma_read(&s->dev, cplus_rx_ring_desc+8, &val, 4);
         rxbufLO = le32_to_cpu(val);
-        pci_dma_read(&s->dev, cplus_rx_ring_desc+12, (uint8_t *)&val, 4);
+        pci_dma_read(&s->dev, cplus_rx_ring_desc+12, &val, 4);
         rxbufHI = le32_to_cpu(val);
 
         DPRINTF("+++ C+ mode RX descriptor %d %08x %08x %08x %08x\n",
-- 
1.7.7

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH 6/7] Remove unnecessary casts from PCI DMA code in usb-ehci
  2011-11-04  1:03 [Qemu-devel] [0/7] Remove unnecessary casts introduced by PCI DMA stubs series David Gibson
                   ` (4 preceding siblings ...)
  2011-11-04  1:03 ` [Qemu-devel] [PATCH 5/7] Remove unnecessary casts from PCI DMA code in rtl8139 David Gibson
@ 2011-11-04  1:03 ` David Gibson
  2011-11-04  1:03 ` [Qemu-devel] [PATCH 7/7] Remove unnecessary casts from PCI DMA code in usb-uhci David Gibson
  2011-11-04 10:49 ` [Qemu-devel] [0/7] Remove unnecessary casts introduced by PCI DMA stubs series Andreas Färber
  7 siblings, 0 replies; 11+ messages in thread
From: David Gibson @ 2011-11-04  1:03 UTC (permalink / raw)
  To: anthony; +Cc: joerg.roedel, agraf, qemu-devel, avi, eduard.munteanu, sw, rth

This patch removes some unnecessary casts in the usb-ehci device,
introduced by commit 68d553587c0aa271c3eb2902921b503740d775b6
'usb-ehci: Use PCI DMA stub functions'.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/usb-ehci.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
index cdd5aae..9e0e0b1 100644
--- a/hw/usb-ehci.c
+++ b/hw/usb-ehci.c
@@ -1107,7 +1107,7 @@ static inline int get_dwords(EHCIState *ehci, uint32_t addr,
     int i;
 
     for(i = 0; i < num; i++, buf++, addr += sizeof(*buf)) {
-        pci_dma_read(&ehci->dev, addr, (uint8_t *)buf, sizeof(*buf));
+        pci_dma_read(&ehci->dev, addr, buf, sizeof(*buf));
         *buf = le32_to_cpu(*buf);
     }
 
@@ -1122,7 +1122,7 @@ static inline int put_dwords(EHCIState *ehci, uint32_t addr,
 
     for(i = 0; i < num; i++, buf++, addr += sizeof(*buf)) {
         uint32_t tmp = cpu_to_le32(*buf);
-        pci_dma_write(&ehci->dev, addr, (uint8_t *)&tmp, sizeof(tmp));
+        pci_dma_write(&ehci->dev, addr, &tmp, sizeof(tmp));
     }
 
     return 1;
@@ -2154,7 +2154,7 @@ static void ehci_advance_periodic_state(EHCIState *ehci)
         }
         list |= ((ehci->frindex & 0x1ff8) >> 1);
 
-        pci_dma_read(&ehci->dev, list, (uint8_t *) &entry, sizeof entry);
+        pci_dma_read(&ehci->dev, list, &entry, sizeof entry);
         entry = le32_to_cpu(entry);
 
         DPRINTF("PERIODIC state adv fr=%d.  [%08X] -> %08X\n",
-- 
1.7.7

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH 7/7] Remove unnecessary casts from PCI DMA code in usb-uhci
  2011-11-04  1:03 [Qemu-devel] [0/7] Remove unnecessary casts introduced by PCI DMA stubs series David Gibson
                   ` (5 preceding siblings ...)
  2011-11-04  1:03 ` [Qemu-devel] [PATCH 6/7] Remove unnecessary casts from PCI DMA code in usb-ehci David Gibson
@ 2011-11-04  1:03 ` David Gibson
  2011-11-04 10:49 ` [Qemu-devel] [0/7] Remove unnecessary casts introduced by PCI DMA stubs series Andreas Färber
  7 siblings, 0 replies; 11+ messages in thread
From: David Gibson @ 2011-11-04  1:03 UTC (permalink / raw)
  To: anthony; +Cc: joerg.roedel, agraf, qemu-devel, avi, eduard.munteanu, sw, rth

This patch removes some unnecessary casts in the usb-uhci device,
introduced by commit fff23ee9a5de74ab111b3cea9eec56782e7d7c50
'usb-uhci: Use PCI DMA stub functions'.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/usb-uhci.c |   17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c
index f9e3ea5..f8912e2 100644
--- a/hw/usb-uhci.c
+++ b/hw/usb-uhci.c
@@ -876,7 +876,7 @@ static void uhci_async_complete(USBPort *port, USBPacket *packet)
         uint32_t link = async->td;
         uint32_t int_mask = 0, val;
 
-        pci_dma_read(&s->dev, link & ~0xf, (uint8_t *) &td, sizeof(td));
+        pci_dma_read(&s->dev, link & ~0xf, &td, sizeof(td));
         le32_to_cpus(&td.link);
         le32_to_cpus(&td.ctrl);
         le32_to_cpus(&td.token);
@@ -888,8 +888,7 @@ static void uhci_async_complete(USBPort *port, USBPacket *packet)
 
         /* update the status bits of the TD */
         val = cpu_to_le32(td.ctrl);
-        pci_dma_write(&s->dev, (link & ~0xf) + 4,
-                      (const uint8_t *)&val, sizeof(val));
+        pci_dma_write(&s->dev, (link & ~0xf) + 4, &val, sizeof(val));
         uhci_async_free(s, async);
     } else {
         async->done = 1;
@@ -952,7 +951,7 @@ static void uhci_process_frame(UHCIState *s)
 
     DPRINTF("uhci: processing frame %d addr 0x%x\n" , s->frnum, frame_addr);
 
-    pci_dma_read(&s->dev, frame_addr, (uint8_t *)&link, 4);
+    pci_dma_read(&s->dev, frame_addr, &link, 4);
     le32_to_cpus(&link);
 
     int_mask = 0;
@@ -976,7 +975,7 @@ static void uhci_process_frame(UHCIState *s)
                 break;
             }
 
-            pci_dma_read(&s->dev, link & ~0xf, (uint8_t *) &qh, sizeof(qh));
+            pci_dma_read(&s->dev, link & ~0xf, &qh, sizeof(qh));
             le32_to_cpus(&qh.link);
             le32_to_cpus(&qh.el_link);
 
@@ -996,7 +995,7 @@ static void uhci_process_frame(UHCIState *s)
         }
 
         /* TD */
-        pci_dma_read(&s->dev, link & ~0xf, (uint8_t *) &td, sizeof(td));
+        pci_dma_read(&s->dev, link & ~0xf, &td, sizeof(td));
         le32_to_cpus(&td.link);
         le32_to_cpus(&td.ctrl);
         le32_to_cpus(&td.token);
@@ -1010,8 +1009,7 @@ static void uhci_process_frame(UHCIState *s)
         if (old_td_ctrl != td.ctrl) {
             /* update the status bits of the TD */
             val = cpu_to_le32(td.ctrl);
-            pci_dma_write(&s->dev, (link & ~0xf) + 4,
-                          (const uint8_t *)&val, sizeof(val));
+            pci_dma_write(&s->dev, (link & ~0xf) + 4, &val, sizeof(val));
         }
 
         if (ret < 0) {
@@ -1039,8 +1037,7 @@ static void uhci_process_frame(UHCIState *s)
 	    /* update QH element link */
             qh.el_link = link;
             val = cpu_to_le32(qh.el_link);
-            pci_dma_write(&s->dev, (curr_qh & ~0xf) + 4,
-                          (const uint8_t *)&val, sizeof(val));
+            pci_dma_write(&s->dev, (curr_qh & ~0xf) + 4, &val, sizeof(val));
 
             if (!depth_first(link)) {
                /* done with this QH */
-- 
1.7.7

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [0/7] Remove unnecessary casts introduced by PCI DMA stubs series
  2011-11-04  1:03 [Qemu-devel] [0/7] Remove unnecessary casts introduced by PCI DMA stubs series David Gibson
                   ` (6 preceding siblings ...)
  2011-11-04  1:03 ` [Qemu-devel] [PATCH 7/7] Remove unnecessary casts from PCI DMA code in usb-uhci David Gibson
@ 2011-11-04 10:49 ` Andreas Färber
  2011-11-28  2:49   ` David Gibson
  7 siblings, 1 reply; 11+ messages in thread
From: Andreas Färber @ 2011-11-04 10:49 UTC (permalink / raw)
  To: David Gibson
  Cc: joerg.roedel, agraf, qemu-devel, avi, eduard.munteanu, sw, rth

Am 04.11.2011 02:03, schrieb David Gibson:
> As a few people pointed out, my recent patch series introducing a new
> (stub) PCI DMA API added unnecessary casts in quite a few places.  I
> think this was a hangover from early days of the patchese where the
> casts were necessary for some reason I've now forgotten.
> 
> Thanks for applying the series anyway, here is the requested followup
> series which removes those unnecessary casts.

Whole series only removes casts, plus one reindentation in 2/7 at a line
touched anyway. Looks okay for 1.0 if it compiles.

Reviewed-by: Andreas Färber <afaerber@suse.de>

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [0/7] Remove unnecessary casts introduced by PCI DMA stubs series
  2011-11-04 10:49 ` [Qemu-devel] [0/7] Remove unnecessary casts introduced by PCI DMA stubs series Andreas Färber
@ 2011-11-28  2:49   ` David Gibson
  0 siblings, 0 replies; 11+ messages in thread
From: David Gibson @ 2011-11-28  2:49 UTC (permalink / raw)
  To: Andreas Färber
  Cc: joerg.roedel, agraf, qemu-devel, avi, eduard.munteanu, sw, rth

On Fri, Nov 04, 2011 at 11:49:26AM +0100, Andreas Färber wrote:
> Am 04.11.2011 02:03, schrieb David Gibson:
> > As a few people pointed out, my recent patch series introducing a new
> > (stub) PCI DMA API added unnecessary casts in quite a few places.  I
> > think this was a hangover from early days of the patchese where the
> > casts were necessary for some reason I've now forgotten.
> > 
> > Thanks for applying the series anyway, here is the requested followup
> > series which removes those unnecessary casts.
> 
> Whole series only removes casts, plus one reindentation in 2/7 at a line
> touched anyway. Looks okay for 1.0 if it compiles.
> 
> Reviewed-by: Andreas Färber <afaerber@suse.de>

Anthony, I notice this series hasn't gone into the 1.0 tree yet.  Is
there a particular reason for that, or has it just no happened yet?

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH 1/7] Remove unnecessary casts from PCI DMA code in eepro100
  2011-11-04  1:03 ` [Qemu-devel] [PATCH 1/7] Remove unnecessary casts from PCI DMA code in eepro100 David Gibson
@ 2011-12-12 18:28   ` Anthony Liguori
  0 siblings, 0 replies; 11+ messages in thread
From: Anthony Liguori @ 2011-12-12 18:28 UTC (permalink / raw)
  To: David Gibson
  Cc: joerg.roedel, agraf, qemu-devel, avi, eduard.munteanu, sw, rth

On 11/03/2011 08:03 PM, David Gibson wrote:
> This patch removes some unnecessary casts in the eepro100 device,
> introduced by commit 16ef60c9a8eeee269f7cbc95219a431b1d7cbf29
> 'eepro100: Use PCI DMA stub functions'.
>
> Signed-off-by: David Gibson<david@gibson.dropbear.id.au>

Applied all.  Thanks.

Regards,

Anthony Liguori

> ---
>   hw/eepro100.c |    7 +++----
>   1 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/hw/eepro100.c b/hw/eepro100.c
> index 7d59e71..8769e33 100644
> --- a/hw/eepro100.c
> +++ b/hw/eepro100.c
> @@ -713,8 +713,7 @@ static void dump_statistics(EEPRO100State * s)
>        * values which really matter.
>        * Number of data should check configuration!!!
>        */
> -    pci_dma_write(&s->dev, s->statsaddr,
> -                  (uint8_t *)&s->statistics, s->stats_size);
> +    pci_dma_write(&s->dev, s->statsaddr,&s->statistics, s->stats_size);
>       stl_le_pci_dma(&s->dev, s->statsaddr + 0,
>                      s->statistics.tx_good_frames);
>       stl_le_pci_dma(&s->dev, s->statsaddr + 36,
> @@ -732,7 +731,7 @@ static void dump_statistics(EEPRO100State * s)
>
>   static void read_cb(EEPRO100State *s)
>   {
> -    pci_dma_read(&s->dev, s->cb_address, (uint8_t *)&s->tx, sizeof(s->tx));
> +    pci_dma_read(&s->dev, s->cb_address,&s->tx, sizeof(s->tx));
>       s->tx.status = le16_to_cpu(s->tx.status);
>       s->tx.command = le16_to_cpu(s->tx.command);
>       s->tx.link = le32_to_cpu(s->tx.link);
> @@ -1707,7 +1706,7 @@ static ssize_t nic_receive(VLANClientState *nc, const uint8_t * buf, size_t size
>       /* !!! */
>       eepro100_rx_t rx;
>       pci_dma_read(&s->dev, s->ru_base + s->ru_offset,
> -                 (uint8_t *)&rx, sizeof(eepro100_rx_t));
> +&rx, sizeof(eepro100_rx_t));
>       uint16_t rfd_command = le16_to_cpu(rx.command);
>       uint16_t rfd_size = le16_to_cpu(rx.size);
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-12-12 18:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-04  1:03 [Qemu-devel] [0/7] Remove unnecessary casts introduced by PCI DMA stubs series David Gibson
2011-11-04  1:03 ` [Qemu-devel] [PATCH 1/7] Remove unnecessary casts from PCI DMA code in eepro100 David Gibson
2011-12-12 18:28   ` Anthony Liguori
2011-11-04  1:03 ` [Qemu-devel] [PATCH 2/7] Remove unnecessary casts from PCI DMA code in e1000 David Gibson
2011-11-04  1:03 ` [Qemu-devel] [PATCH 3/7] Remove unnecessary casts from PCI DMA code in PCI IDE David Gibson
2011-11-04  1:03 ` [Qemu-devel] [PATCH 4/7] Remove unnecessary casts from PCI DMA code in lsi53c895a David Gibson
2011-11-04  1:03 ` [Qemu-devel] [PATCH 5/7] Remove unnecessary casts from PCI DMA code in rtl8139 David Gibson
2011-11-04  1:03 ` [Qemu-devel] [PATCH 6/7] Remove unnecessary casts from PCI DMA code in usb-ehci David Gibson
2011-11-04  1:03 ` [Qemu-devel] [PATCH 7/7] Remove unnecessary casts from PCI DMA code in usb-uhci David Gibson
2011-11-04 10:49 ` [Qemu-devel] [0/7] Remove unnecessary casts introduced by PCI DMA stubs series Andreas Färber
2011-11-28  2:49   ` David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).