DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Stephen Hemminger <sthemmin@microsoft.com>
Subject: [dpdk-dev] [PATCH 2/2] eal: use %zu to format size_t
Date: Thu, 15 Feb 2018 14:25:50 -0800	[thread overview]
Message-ID: <20180215222550.31128-3-stephen@networkplumber.org> (raw)
In-Reply-To: <20180215222550.31128-1-stephen@networkplumber.org>

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(-)

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) {
-- 
2.15.1

  parent reply	other threads:[~2018-02-15 22:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-15 22:25 [dpdk-dev] [PATCH 0/2] use %z for formatting Stephen Hemminger
2018-02-15 22:25 ` [dpdk-dev] [PATCH 1/2] pci: use %z to format size_t Stephen Hemminger
2018-02-15 22:25 ` Stephen Hemminger [this message]
2018-04-04 10:41 ` [dpdk-dev] [PATCH 0/2] use %z for formatting Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180215222550.31128-3-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=sthemmin@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).