mem: use z specifier to format size_t
authorStephen Hemminger <stephen@networkplumber.org>
Thu, 15 Feb 2018 22:25:50 +0000 (14:25 -0800)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 4 Apr 2018 11:43:33 +0000 (13:43 +0200)
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 <stephen@networkplumber.org>
lib/librte_eal/linuxapp/eal/eal_memory.c

index 38853b7..86df674 100644 (file)
@@ -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) {