From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] printk-nmi: use %zu format string for size_t
Date: Fri, 18 Dec 2015 15:21:27 +0100 [thread overview]
Message-ID: <3363644.unjjqdaQx2@wuerfel> (raw)
Newly added code in vprintk_nmi prints a size_t using %lu, which causes
a warning on architectures like ARM where it is defined as unsigned int:
kernel/printk/nmi.c: In function '__printk_nmi_flush':
kernel/printk/nmi.c:143:10: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t {aka unsigned int}' [-Wformat=]
This uses the format string that works on all architectures.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 0dcfca2060ee ("printk-nmi-generic-solution-for-safe-printk-in-nmi-v4")
---
Found on arm randconfig builds
Please fold this into the patch that caused the warning
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)
reply other threads:[~2015-12-18 14:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3363644.unjjqdaQx2@wuerfel \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox