Skip to content

Commit

Permalink
test suite: use %zu to print size_t
Browse files Browse the repository at this point in the history
On 32-bit, we can't use %lu to print a size_t variable and gcc warns us
about it.  Shame it doesn't warn about it on 64-bit.

Link: https://lkml.kernel.org/r/20250403003311.359917-1-Liam.Howlett@oracle.com
Fixes: cc86e0c ("radix tree test suite: add support for slab bulk APIs")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Matthew Wilcox (Oracle) authored and Andrew Morton committed Apr 12, 2025
1 parent be8254f commit a30951d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/testing/shared/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void kmem_cache_free(struct kmem_cache *cachep, void *objp)
void kmem_cache_free_bulk(struct kmem_cache *cachep, size_t size, void **list)
{
if (kmalloc_verbose)
pr_debug("Bulk free %p[0-%lu]\n", list, size - 1);
pr_debug("Bulk free %p[0-%zu]\n", list, size - 1);

pthread_mutex_lock(&cachep->lock);
for (int i = 0; i < size; i++)
Expand All @@ -168,7 +168,7 @@ int kmem_cache_alloc_bulk(struct kmem_cache *cachep, gfp_t gfp, size_t size,
size_t i;

if (kmalloc_verbose)
pr_debug("Bulk alloc %lu\n", size);
pr_debug("Bulk alloc %zu\n", size);

pthread_mutex_lock(&cachep->lock);
if (cachep->nr_objs >= size) {
Expand Down

0 comments on commit a30951d

Please sign in to comment.