public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH] verbs: Use correct type for printf from struct rlimit
Date: Tue, 30 Jan 2018 15:49:04 -0700	[thread overview]
Message-ID: <20180130224904.GA11309@ziepe.ca> (raw)

The actual type of the members is rlim_t which only happens to be
unsigned long on the platforms we have tested so far. x32 uses something
else.

Casting to unsigned long long for printing is the safe solution.

Signed-off-by: Jason Gunthorpe <jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 libibverbs/init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libibverbs/init.c b/libibverbs/init.c
index ff2c60ffcbc963..cda628b9e0544d 100644
--- a/libibverbs/init.c
+++ b/libibverbs/init.c
@@ -552,9 +552,9 @@ static void check_memlock_limit(void)
 	}
 
 	if (rlim.rlim_cur <= 32768)
-		fprintf(stderr, PFX "Warning: RLIMIT_MEMLOCK is %lu bytes.\n"
+		fprintf(stderr, PFX "Warning: RLIMIT_MEMLOCK is %llu bytes.\n"
 			"    This will severely limit memory registrations.\n",
-			rlim.rlim_cur);
+			(unsigned long long)rlim.rlim_cur);
 }
 
 static int same_sysfs_dev(struct verbs_sysfs_dev *sysfs1,
-- 
2.15.1

--
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:[~2018-01-30 22:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-30 22:49 Jason Gunthorpe [this message]
     [not found] ` <20180130224904.GA11309-uk2M96/98Pc@public.gmane.org>
2018-01-31  5:58   ` [PATCH] verbs: Use correct type for printf from struct rlimit Leon Romanovsky

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=20180130224904.GA11309@ziepe.ca \
    --to=jgg-vpraknaxozvwk0htik3j/w@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox