Skip to contentSkip to conversation

printk: nmi: Use correct format specifier for size_t

PATCH New Thierry Reding 1 participant 1 message Dec 29, 2015 Printk

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 printk: nmi: Use correct format specifier for size_t

From: Thierry Reding <[email protected]>

The correct format specifier for arguments of type size_t is %zu. Using anything else is bound to trigger warnings on either 32-bit or 64-bit builds.

Fixes 0dcfca2060ee ("printk-nmi-generic-solution-for-safe-printk-in-nmi-v4")
Cc Andrew Morton <[email protected]>
Cc Petr Mladek <[email protected]>
---
 kernel/printk/nmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/printk/nmi.c +1 -1
index 92c61e960c4a..cdee2707a1f2 100644
@@ -140,7 +140,7 @@ more:
 	 * @len must only increase.
 	 */
 	if (i && i >= len)
-		pr_err("printk_nmi_flush: internal error: i=%d >= len=%lu\n",
+		pr_err("printk_nmi_flush: internal error: i=%d >= len=%zu\n",
 		       i, len);
 
 	if (!len)
Signature · 1 line
2.5.0