Skip to contentSkip to conversation

intel_iommu: Fix two misuse of "0x%u" prints

PATCH In review Peter Xu 5 participants 6 messages Oct 19, 2020 – Oct 20, 2020

lore
Share & tools
lore

Peter Xu

author
#0 lore raw

PATCH 1/1 intel_iommu: Fix two misuse of "0x%u" prints

Dave magically found this. Fix them with "0x%x".

---
 hw/i386/intel_iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/i386/intel_iommu.c +2 -2
index 749eb6ad63..70ac837733 100644
@@ -2665,7 +2665,7 @@ static uint64_t vtd_mem_read(void *opaque, hwaddr addr, unsigned size)
 
     if (addr + size > DMAR_REG_SIZE) {
         error_report_once("%s: MMIO over range: addr=0x%" PRIx64
-                          " size=0x%u", __func__, addr, size);
+                          " size=0x%x", __func__, addr, size);
         return (uint64_t)-1;
     }
 
@@ -2716,7 +2716,7 @@ static void vtd_mem_write(void *opaque, hwaddr addr,
 
     if (addr + size > DMAR_REG_SIZE) {
         error_report_once("%s: MMIO over range: addr=0x%" PRIx64
-                          " size=0x%u", __func__, addr, size);
+                          " size=0x%x", __func__, addr, size);
         return;
     }
 
Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · * Peter Xu ([email protected]) wrote:

Dave magically found this. Fix them with "0x%x".

Quoted 29 lines
---
 hw/i386/intel_iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/i386/intel_iommu.c +2 -2
index 749eb6ad63..70ac837733 100644
@@ -2665,7 +2665,7 @@ static uint64_t vtd_mem_read(void *opaque, hwaddr addr, unsigned size)
 
     if (addr + size > DMAR_REG_SIZE) {
         error_report_once("%s: MMIO over range: addr=0x%" PRIx64
-                          " size=0x%u", __func__, addr, size);
+                          " size=0x%x", __func__, addr, size);
         return (uint64_t)-1;
     }
 
@@ -2716,7 +2716,7 @@ static void vtd_mem_write(void *opaque, hwaddr addr,
 
     if (addr + size > DMAR_REG_SIZE) {
         error_report_once("%s: MMIO over range: addr=0x%" PRIx64
-                          " size=0x%u", __func__, addr, size);
+                          " size=0x%x", __func__, addr, size);
         return;
     }
 
Signature · 1 line
2.26.2
Signature · 1 line
Dr. David Alan Gilbert / [email protected] / Manchester, UK
#3 lore raw
Quoted 9 lines · * Peter Maydell ([email protected]) wrote:
Quoted 5 lines · Peter Xu

Dave magically found this. Fix them with "0x%x".

Hmm, a quick grep finds also some "0x%d" in an arm trace-event file :-) I'll send a patch...

See:
https://lists.gnu.org/archive/html/qemu-devel/2020-10/msg04179.html

Dave

Quoted 2 lines

-- PMM

Signature · 1 line
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Reviewed-by on v1 1/1
#4 lore raw
In reply to Peter Xu
Quoted 13 lines · Peter Xu

Dave magically found this. Fix them with "0x%x".

---
  hw/i386/intel_iommu.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
hw/i386/intel_iommu.c +0 -0
index 749eb6ad63..70ac837733 100644

hw/i386/intel_iommu.c static uint64_t vtd_mem_read(void *opaque, hwaddr addr, unsigned size) · line 2668

Quoted 5 lines
hw/i386/intel_iommu.c +1 -1
@@ -2665,7 +2665,7 @@ static uint64_t vtd_mem_read(void *opaque, hwaddr addr, unsigned size)
 
      if (addr + size > DMAR_REG_SIZE) {
          error_report_once("%s: MMIO over range: addr=0x%" PRIx64
-                          " size=0x%u", __func__, addr, size);
+                          " size=0x%x", __func__, addr, size);
Acked-by on v1 1/1
#5 lore raw
In reply to Peter Xu
Quoted 22 lines · Peter Xu

Dave magically found this. Fix them with "0x%x".

---
  hw/i386/intel_iommu.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
hw/i386/intel_iommu.c +1 -1
index 749eb6ad63..70ac837733 100644
@@ -2665,7 +2665,7 @@ static uint64_t vtd_mem_read(void *opaque, hwaddr addr, unsigned size)
 
      if (addr + size > DMAR_REG_SIZE) {
          error_report_once("%s: MMIO over range: addr=0x%" PRIx64
-                          " size=0x%u", __func__, addr, size);
+                          " size=0x%x", __func__, addr, size);
          return (uint64_t)-1;
      }
 

hw/i386/intel_iommu.c static void vtd_mem_write(void *opaque, hwaddr addr, · line 2722

Quoted 8 lines
hw/i386/intel_iommu.c +1 -1
@@ -2716,7 +2716,7 @@ static void vtd_mem_write(void *opaque, hwaddr addr,
 
      if (addr + size > DMAR_REG_SIZE) {
          error_report_once("%s: MMIO over range: addr=0x%" PRIx64
-                          " size=0x%u", __func__, addr, size);
+                          " size=0x%x", __func__, addr, size);
          return;
      }