* [PATCH] verbs: Use correct type for printf from struct rlimit
@ 2018-01-30 22:49 Jason Gunthorpe
[not found] ` <20180130224904.GA11309-uk2M96/98Pc@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Jason Gunthorpe @ 2018-01-30 22:49 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] verbs: Use correct type for printf from struct rlimit
[not found] ` <20180130224904.GA11309-uk2M96/98Pc@public.gmane.org>
@ 2018-01-31 5:58 ` Leon Romanovsky
0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2018-01-31 5:58 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 473 bytes --]
On Tue, Jan 30, 2018 at 03:49:04PM -0700, Jason Gunthorpe wrote:
> 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(-)
>
Thanks, applied.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-31 5:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-30 22:49 [PATCH] verbs: Use correct type for printf from struct rlimit Jason Gunthorpe
[not found] ` <20180130224904.GA11309-uk2M96/98Pc@public.gmane.org>
2018-01-31 5:58 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox