Skip to contentSkip to conversation

hw/dma/xilinx_axidma: debug printf fixups

PATCH In review Andrew Jones 3 participants 5 messages Jan 5, 2016 – Jan 6, 2016 Arm/Zynq architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/dma/xilinx_axidma: debug printf fixups

(Found by grepping for broken PRI users.)

---
 hw/dma/xilinx_axidma.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
hw/dma/xilinx_axidma.c +4 -4
index b1cfa11356a26..2ab0772cd19ae 100644
@@ -180,10 +180,10 @@ static inline int streamid_from_addr(hwaddr addr)
 #ifdef DEBUG_ENET
 static void stream_desc_show(struct SDesc *d)
 {
-    qemu_log("buffer_addr  = " PRIx64 "\n", d->buffer_address);
-    qemu_log("nxtdesc      = " PRIx64 "\n", d->nxtdesc);
-    qemu_log("control      = %x\n", d->control);
-    qemu_log("status       = %x\n", d->status);
+    qemu_log("buffer_addr  = 0x%" PRIx64 "\n", d->buffer_address);
+    qemu_log("nxtdesc      = 0x%" PRIx64 "\n", d->nxtdesc);
+    qemu_log("control      = 0x%x\n", d->control);
+    qemu_log("status       = 0x%x\n", d->status);
 }
 #endif
 
Signature · 1 line
2.4.3
#1 lore raw
Quoted 13 lines · Andrew Jones

(Found by grepping for broken PRI users.)

---
 hw/dma/xilinx_axidma.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
hw/dma/xilinx_axidma.c +0 -0
index b1cfa11356a26..2ab0772cd19ae 100644
@@ -180,10 +180,10 @@ static inline int streamid_from_addr(hwaddr addr)
 #ifdef DEBUG_ENET

hw/dma/xilinx_axidma.c static inline int streamid_from_addr(hwaddr addr) · line 186

Quoted 10 lines
hw/dma/xilinx_axidma.c +4 -4
 static void stream_desc_show(struct SDesc *d)
 {
-    qemu_log("buffer_addr  = " PRIx64 "\n", d->buffer_address);
-    qemu_log("nxtdesc      = " PRIx64 "\n", d->nxtdesc);
-    qemu_log("control      = %x\n", d->control);
-    qemu_log("status       = %x\n", d->status);
+    qemu_log("buffer_addr  = 0x%" PRIx64 "\n", d->buffer_address);
+    qemu_log("nxtdesc      = 0x%" PRIx64 "\n", d->nxtdesc);
+    qemu_log("control      = 0x%x\n", d->control);
+    qemu_log("status       = 0x%x\n", d->status);

This is dead code. Nothing uses stream_desc_show() even when DEBUG_ENET is defined. I'd just delete the function and #ifdef altogether, instead.

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#2 lore raw
Quoted 19 lines · Eric Blake
Quoted 18 lines · Andrew Jones

(Found by grepping for broken PRI users.)

---
 hw/dma/xilinx_axidma.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
hw/dma/xilinx_axidma.c +0 -3
index b1cfa11356a26..2ab0772cd19ae 100644
@@ -180,10 +180,10 @@ static inline int streamid_from_addr(hwaddr addr)
 #ifdef DEBUG_ENET
 static void stream_desc_show(struct SDesc *d)
 {
-    qemu_log("buffer_addr  = " PRIx64 "\n", d->buffer_address);
-    qemu_log("nxtdesc      = " PRIx64 "\n", d->nxtdesc);
-    qemu_log("control      = %x\n", d->control);
Quoted 8 lines

hw/dma/xilinx_axidma.c static inline int streamid_from_addr(hwaddr addr) · line 186

Quoted 5 lines
hw/dma/xilinx_axidma.c +4 -1
-    qemu_log("status       = %x\n", d->status);
+    qemu_log("buffer_addr  = 0x%" PRIx64 "\n", d->buffer_address);
+    qemu_log("nxtdesc      = 0x%" PRIx64 "\n", d->nxtdesc);
+    qemu_log("control      = 0x%x\n", d->control);
+    qemu_log("status       = 0x%x\n", d->status);

This is dead code. Nothing uses stream_desc_show() even when DEBUG_ENET is defined. I'd just delete the function and #ifdef altogether, instead.

Sounds good, but I guess I'll leave the keep+fix vs. throw decision to the maintainers, rather than to submit a v2 ripping it out.

Thanks,
drew

Quoted 5 lines
Signature · 3 lines
-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#3 lore raw
Quoted 29 lines · Andrew Jones
Quoted 19 lines · Eric Blake
Quoted 18 lines · Andrew Jones

(Found by grepping for broken PRI users.)

---
 hw/dma/xilinx_axidma.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
hw/dma/xilinx_axidma.c +0 -3
index b1cfa11356a26..2ab0772cd19ae 100644
@@ -180,10 +180,10 @@ static inline int streamid_from_addr(hwaddr addr)
 #ifdef DEBUG_ENET
 static void stream_desc_show(struct SDesc *d)
 {
-    qemu_log("buffer_addr  = " PRIx64 "\n", d->buffer_address);
-    qemu_log("nxtdesc      = " PRIx64 "\n", d->nxtdesc);
-    qemu_log("control      = %x\n", d->control);
Quoted 8 lines

hw/dma/xilinx_axidma.c static inline int streamid_from_addr(hwaddr addr) · line 186

Quoted 5 lines
hw/dma/xilinx_axidma.c +4 -1
-    qemu_log("status       = %x\n", d->status);
+    qemu_log("buffer_addr  = 0x%" PRIx64 "\n", d->buffer_address);
+    qemu_log("nxtdesc      = 0x%" PRIx64 "\n", d->nxtdesc);
+    qemu_log("control      = 0x%x\n", d->control);
+    qemu_log("status       = 0x%x\n", d->status);

This is dead code. Nothing uses stream_desc_show() even when DEBUG_ENET is defined. I'd just delete the function and #ifdef altogether, instead.

Quoted 2 lines

Sounds good, but I guess I'll leave the keep+fix vs. throw decision to the maintainers, rather than to submit a v2 ripping it out.

I don't see any reason to keep dead code around. I think it should be removed.

If you send a V2 removing it (or a new patch altogether) I'll review it.

Thanks,

Alistair

Quoted 12 lines

Thanks,
drew

Quoted 5 lines

--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org

#4 lore raw
Quoted 30 lines · Alistair Francis
Quoted 29 lines · Andrew Jones
Quoted 27 lines · Eric Blake
Quoted 13 lines · Andrew Jones

(Found by grepping for broken PRI users.)

---
 hw/dma/xilinx_axidma.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
hw/dma/xilinx_axidma.c +0 -0
index b1cfa11356a26..2ab0772cd19ae 100644
@@ -180,10 +180,10 @@ static inline int streamid_from_addr(hwaddr addr)
 #ifdef DEBUG_ENET

hw/dma/xilinx_axidma.c static inline int streamid_from_addr(hwaddr addr) · line 186

Quoted 10 lines
hw/dma/xilinx_axidma.c +4 -4
 static void stream_desc_show(struct SDesc *d)
 {
-    qemu_log("buffer_addr  = " PRIx64 "\n", d->buffer_address);
-    qemu_log("nxtdesc      = " PRIx64 "\n", d->nxtdesc);
-    qemu_log("control      = %x\n", d->control);
-    qemu_log("status       = %x\n", d->status);
+    qemu_log("buffer_addr  = 0x%" PRIx64 "\n", d->buffer_address);
+    qemu_log("nxtdesc      = 0x%" PRIx64 "\n", d->nxtdesc);
+    qemu_log("control      = 0x%x\n", d->control);
+    qemu_log("status       = 0x%x\n", d->status);

This is dead code. Nothing uses stream_desc_show() even when DEBUG_ENET is defined. I'd just delete the function and #ifdef altogether, instead.

Quoted 4 lines
Quoted 2 lines

Sounds good, but I guess I'll leave the keep+fix vs. throw decision to the maintainers, rather than to submit a v2 ripping it out.

I don't see any reason to keep dead code around. I think it should be removed.

The reason I see, is that this function could be useful to temporarily add it different places while debugging. I.e. this is no different than a collection of temporary printf's, but saves the time of rewriting those printf's whenever/wherever they're necessary. I suspect that's why this function is here in the first place.

That said, I don't debug this file, so I don't really have any say on whether or not it's of any use now. Anyway, based on the fact this function has PRI bugs in it that would break compilation, I guess nobody debugs this file with DEBUG_ENET turned on.

Quoted 2 lines

If you send a V2 removing it (or a new patch altogether) I'll review it.

OK, sending a new patch that kills it.

Thanks,
drew