diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2015-04-15 19:17:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-15 19:35:23 -0400 |
commit | e8a7ba5f5c8c0c94c0c7f1bcd53c0289560c7446 (patch) | |
tree | d7c31f8969586dfad3a9092910c05dbbe0edc33f /Documentation | |
parent | 7330660ed2e8d8d4c65b90cea62d8f1ed49c0104 (diff) |
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')
-rw-r--r-- | Documentation/printk-formats.txt | 32 |
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: | |||
8 | unsigned long long %llu or %llx | 8 | unsigned long long %llu or %llx |
9 | size_t %zu or %zx | 9 | size_t %zu or %zx |
10 | ssize_t %zd or %zx | 10 | ssize_t %zd or %zx |
11 | s32 %d or %x | ||
12 | u32 %u or %x | ||
13 | s64 %lld or %llx | ||
14 | u64 %llu or %llx | ||
15 | |||
16 | If <type> is dependent on a config option for its size (e.g., sector_t, | ||
17 | blkcnt_t) or is architecture-dependent for its size (e.g., tcflag_t), use a | ||
18 | format specifier of its largest possible type and explicitly cast to it. | ||
19 | Example: | ||
20 | |||
21 | printk("test: sector number/total blocks: %llu/%llu\n", | ||
22 | (unsigned long long)sector, (unsigned long long)blockcount); | ||
23 | |||
24 | Reminder: sizeof() result is of type size_t. | ||
25 | |||
11 | 26 | ||
12 | Raw pointer value SHOULD be printed with %p. The kernel supports | 27 | Raw pointer value SHOULD be printed with %p. The kernel supports |
13 | the following extended format specifiers for pointer types: | 28 | the following extended format specifiers for pointer types: |
@@ -246,23 +261,6 @@ struct va_format: | |||
246 | 261 | ||
247 | Passed by reference. | 262 | Passed by reference. |
248 | 263 | ||
249 | u64 SHOULD be printed with %llu/%llx: | ||
250 | |||
251 | printk("%llu", u64_var); | ||
252 | |||
253 | s64 SHOULD be printed with %lld/%llx: | ||
254 | |||
255 | printk("%lld", s64_var); | ||
256 | |||
257 | If <type> is dependent on a config option for its size (e.g., sector_t, | ||
258 | blkcnt_t) or is architecture-dependent for its size (e.g., tcflag_t), use a | ||
259 | format specifier of its largest possible type and explicitly cast to it. | ||
260 | Example: | ||
261 | |||
262 | printk("test: sector number/total blocks: %llu/%llu\n", | ||
263 | (unsigned long long)sector, (unsigned long long)blockcount); | ||
264 | |||
265 | Reminder: sizeof() result is of type size_t. | ||
266 | 264 | ||
267 | Thank you for your cooperation and attention. | 265 | Thank you for your cooperation and attention. |
268 | 266 | ||