[PATCH] printk: nmi: Use correct format specifier for size_t

From: Thierry Reding
Date: Tue Dec 29 2015 - 05:31:57 EST


From: Thierry Reding <treding@xxxxxxxxxx>

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 <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Petr Mladek <pmladek@xxxxxxxx>
Signed-off-by: Thierry Reding <treding@xxxxxxxxxx>
---
kernel/printk/nmi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/printk/nmi.c b/kernel/printk/nmi.c
index 92c61e960c4a..cdee2707a1f2 100644
--- a/kernel/printk/nmi.c
+++ b/kernel/printk/nmi.c
@@ -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)
--
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/