summaryrefslogtreecommitdiffstats
path: root/Documentation/printk-formats.txt
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2015-04-16 01:17:17 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-16 01:35:23 +0200
commite8a7ba5f5c8c0c94c0c7f1bcd53c0289560c7446 (patch)
treed7c31f8969586dfad3a9092910c05dbbe0edc33f /Documentation/printk-formats.txt
parentlib/vsprintf: document %p parameters passed by reference (diff)
downloadlinux-e8a7ba5f5c8c0c94c0c7f1bcd53c0289560c7446.tar.xz
linux-e8a7ba5f5c8c0c94c0c7f1bcd53c0289560c7446.zip
lib/vsprintf: Move integer format types to the top
Move the format types for 64-bit integers and configurable size integers to the top, so they're next to the other integer format types. While at it, add the missing format types for s32 and u32. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Mike Turquette <mturquette@linaro.org> Cc: Stephen Boyd <sboyd@codeaurora.org> Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/printk-formats.txt')
-rw-r--r--Documentation/printk-formats.txt32
1 files changed, 15 insertions, 17 deletions
diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt
index 71438f3eb0c0..56804e40cb18 100644
--- a/Documentation/printk-formats.txt
+++ b/Documentation/printk-formats.txt
@@ -8,6 +8,21 @@ If variable is of Type, use printk format specifier:
unsigned long long %llu or %llx
size_t %zu or %zx
ssize_t %zd or %zx
+ s32 %d or %x
+ u32 %u or %x
+ s64 %lld or %llx
+ u64 %llu or %llx
+
+If <type> is dependent on a config option for its size (e.g., sector_t,
+blkcnt_t) or is architecture-dependent for its size (e.g., tcflag_t), use a
+format specifier of its largest possible type and explicitly cast to it.
+Example:
+
+ printk("test: sector number/total blocks: %llu/%llu\n",
+ (unsigned long long)sector, (unsigned long long)blockcount);
+
+Reminder: sizeof() result is of type size_t.
+
Raw pointer value SHOULD be printed with %p. The kernel supports
the following extended format specifiers for pointer types:
@@ -246,23 +261,6 @@ struct va_format:
Passed by reference.
-u64 SHOULD be printed with %llu/%llx:
-
- printk("%llu", u64_var);
-
-s64 SHOULD be printed with %lld/%llx:
-
- printk("%lld", s64_var);
-
-If <type> is dependent on a config option for its size (e.g., sector_t,
-blkcnt_t) or is architecture-dependent for its size (e.g., tcflag_t), use a
-format specifier of its largest possible type and explicitly cast to it.
-Example:
-
- printk("test: sector number/total blocks: %llu/%llu\n",
- (unsigned long long)sector, (unsigned long long)blockcount);
-
-Reminder: sizeof() result is of type size_t.
Thank you for your cooperation and attention.