Skip to contentSkip to conversation

mm, mempool: use '%zu' for printing 'size_t' variable

PATCH In review Fabio Estevam 2 participants 2 messages Apr 2, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm, mempool: use '%zu' for printing 'size_t' variable

From: Fabio Estevam <[email protected]>

Commit 8b65aaa9c53404 ("mm, mempool: poison elements backed by page allocator") caused the following build warning on ARM:

mm/mempool.c:31:2: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'size_t' [-Wformat]

Use '%zu' for printing 'size_t' variable.

---
 mm/mempool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/mempool.c +1 -1
index 436628d..5a2f4f0 100644
@@ -28,7 +28,7 @@ static void poison_error(mempool_t *pool, void *element, size_t size,
 	int i;
 
 	pr_err("BUG: mempool element poison mismatch\n");
-	pr_err("Mempool %p size %ld\n", pool, size);
+	pr_err("Mempool %p size %zu\n", pool, size);
 	pr_err(" nr=%d @ %p: %s0x", nr, element, start > 0 ? "... " : "");
 	for (i = start; i < end; i++)
 		pr_cont("%x ", *(u8 *)(element + i));
Signature · 7 lines
1.9.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Commit 8b65aaa9c53404 ("mm, mempool: poison elements backed by page allocator") caused the following build warning on ARM:

mm/mempool.c:31:2: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'size_t' [-Wformat]

Use '%zu' for printing 'size_t' variable.

Fixes the mmotm:master warning reported by Fengguang on microblaze today.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>