[v4,4/8] pci: fix format warning on Windows
diff mbox series

Message ID 20200519142020.15848-5-talshn@mellanox.com
State New
Delegated to: Thomas Monjalon
Headers show
Series
  • Windows bus/pci support
Related show

Checks

Context Check Description
ci/Intel-compilation fail apply issues
ci/checkpatch success coding style OK

Commit Message

Tal Shnaiderman May 19, 2020, 2:20 p.m. UTC
From: Tal Shnaiderman <talshn@mellanox.com>

the struct rte_pci_addr defines domain as uint32_t variable however
the PCI_PRI_FMT macro used for logging the struct sets the format
of domain to uint16_t.

The mismatch causes the following warning messages
in Windows clang build:

format specifies type 'unsigned short' but the argument
has type 'uint32_t' (aka 'unsigned int') [-Wformat]

Signed-off-by: Tal Shnaiderman <talshn@mellanox.com>
---
 lib/librte_pci/rte_pci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/lib/librte_pci/rte_pci.h b/lib/librte_pci/rte_pci.h
index b721bbf58..d119a9e4a 100644
--- a/lib/librte_pci/rte_pci.h
+++ b/lib/librte_pci/rte_pci.h
@@ -22,7 +22,7 @@  extern "C" {
 #include <inttypes.h>
 
 /** Formatting string for PCI device identifier: Ex: 0000:00:01.0 */
-#define PCI_PRI_FMT "%.4" PRIx16 ":%.2" PRIx8 ":%.2" PRIx8 ".%" PRIx8
+#define PCI_PRI_FMT "%.4" PRIx32 ":%.2" PRIx8 ":%.2" PRIx8 ".%" PRIx8
 #define PCI_PRI_STR_SIZE sizeof("XXXXXXXX:XX:XX.X")
 
 /** Short formatting string, without domain, for PCI device: Ex: 00:01.0 */