All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
Subject: [PATCH libibverbs] memory: use SCNxPTR format to read uintptr_t values
Date: Wed, 11 Jul 2012 17:10:35 +0200	[thread overview]
Message-ID: <1342019435-10041-1-git-send-email-ydroneaud@opteya.com> (raw)

SCNxPTR is the correct format to parse uintptr_t hexadecimal values,
whatever the width of uintptr_t type.

This fix a warning when building on a 32bits system.

Signed-off-by: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
---
 src/memory.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/memory.c b/src/memory.c
index ea9e712..7d97e55 100644
--- a/src/memory.c
+++ b/src/memory.c
@@ -44,6 +44,7 @@
 #include <string.h>
 #include <dirent.h>
 #include <limits.h>
+#include <inttypes.h>
 
 #include "ibverbs.h"
 
@@ -116,7 +117,7 @@ static unsigned long get_page_size(void *base)
 		int n;
 		uintptr_t range_start, range_end;
 
-		n = sscanf(buf, "%lx-%lx", &range_start, &range_end);
+		n = sscanf(buf, "%" SCNxPTR "-%" SCNxPTR, &range_start, &range_end);
 
 		if (n < 2)
 			continue;
-- 
1.7.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2012-07-11 15:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-11 15:10 Yann Droneaud [this message]
     [not found] ` <1342019435-10041-1-git-send-email-ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
2012-07-11 15:47   ` [PATCH libibverbs] memory: use SCNxPTR format to read uintptr_t values Roland Dreier
     [not found]     ` <CAL1RGDUQiWdSYbCH8k7Bwu8y549wQtQ7=tPA1G=uJuGW76G4hA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-11 16:09       ` Jason Gunthorpe
2012-07-11 16:17       ` Yann Droneaud

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=1342019435-10041-1-git-send-email-ydroneaud@opteya.com \
    --to=ydroneaud-rly5vtjfyj3qt0dzr+alfa@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.