verbs: Use correct type for printf from struct rlimit
PATCH 1/1 verbs: Use correct type for printf from struct rlimit
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.
--- libibverbs/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
libibverbs/init.c +2 -2
@@ -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,
Signature · 6 lines
2.15.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20180130224904.GA11309-uk2M96/[email protected]
Leon Romanovsky
AppliedQuoted 11 lines · Jason Gunthorpe
The actual type of the members is
rlim_twhich 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.
--- libibverbs/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Thanks, applied.