[dpdk-dev,2/2] eal: use %zu to format size_t

Message ID 20180215222550.31128-3-stephen@networkplumber.org (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Stephen Hemminger Feb. 15, 2018, 10:25 p.m. UTC
  The recommended way to format size_t in printf is to use the
z modifier which handles the case where size_t maybe 32 or 64 bits.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Patch

diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 38853b753aab..86df67480201 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -1390,16 +1390,16 @@  rte_eal_hugepage_attach(void)
 			max_seg = s;
 			if (base_addr != MAP_FAILED) {
 				/* errno is stale, don't use */
-				RTE_LOG(ERR, EAL, "Could not mmap %llu bytes "
+				RTE_LOG(ERR, EAL, "Could not mmap %zu bytes "
 					"in /dev/zero at [%p], got [%p] - "
 					"please use '--base-virtaddr' option\n",
-					(unsigned long long)mcfg->memseg[s].len,
+					mcfg->memseg[s].len,
 					mcfg->memseg[s].addr, base_addr);
 				munmap(base_addr, mcfg->memseg[s].len);
 			} else {
-				RTE_LOG(ERR, EAL, "Could not mmap %llu bytes "
+				RTE_LOG(ERR, EAL, "Could not mmap %zu bytes "
 					"in /dev/zero at [%p]: '%s'\n",
-					(unsigned long long)mcfg->memseg[s].len,
+					mcfg->memseg[s].len,
 					mcfg->memseg[s].addr, strerror(errno));
 			}
 			if (aslr_enabled() > 0) {