lib/vsnprintf: Add %par specifier for sake of consistency
Subsystems (3)
Andy Shevchenko
reviewerPATCH 1/1 lib/vsnprintf: Add %par specifier for sake of consistency
While resource_size_t is repeating phys_addr_t, allocate %par specifier for that type for sake of consistency.
--- Documentation/printk-formats.txt | 13 ++++++++++--- lib/vsprintf.c | 11 +++++++++-- 2 files changed, 19 insertions(+), 5 deletions(-)
Documentation/printk-formats.txt +10 -3
@@ -79,9 +79,16 @@ Physical addresses types phys_addr_t: %pa[p] 0x01234567 or 0x0123456789abcdef - For printing a phys_addr_t type (and its derivatives, such as - resource_size_t) which can vary based on build options, regardless of - the width of the CPU data path. Passed by reference. + For printing a phys_addr_t type which can vary based on build options, + regardless of the width of the CPU data path. Passed by reference. + +Resource size types resource_size_t: + + %par 0x01234567 or 0x0123456789abcdef + + For printing a resource_size_t type which can vary based on build + options, regardless of the width of the CPU data path. Passed by + reference. DMA addresses types dma_addr_t:
lib/vsprintf.c +9 -2
@@ -1373,6 +1373,10 @@ char *address_val(char *buf, char *end, const void *addr, const char *fmt) num = *(const dma_addr_t *)addr; size =sizeof (dma_addr_t);break ; +case 'r' : + num = *(const resource_size_t *)addr; + size =sizeof (resource_size_t); +break ;case 'p' :default : num = *(const phys_addr_t *)addr;
@@ -1548,8 +1552,11 @@ int kptr_restrict __read_mostly;* N no separator * The maximum supported length is 64 bytes of the input. Consider * to use print_hex_dump() for the larger input. -* - 'a[pd]' For address types [p] phys_addr_t, [d] dma_addr_t and derivatives -* (default assumed to be phys_addr_t, passed by reference) +* - 'a[dpr]' For address types (default assumed to be phys_addr_t, passed by +* reference): +* [d] dma_addr_t +* [p] phys_addr_t +* [r] resource_size_t * - 'd[234]' For a dentry name (optionally 2-4 last components) * - 'D[234]' Same as 'd' but for a struct file * - 'g' For block_device name (gendisk + partition number)
Signature · 1 line
2.10.2
Andy Shevchenko
reviewerQuoted 3 lines · Andy Shevchenko
While
resource_size_tis repeatingphys_addr_t, allocate %par specifier for
that type for sake of consistency.
Does it make sense to anyone?
Quoted 70 lines
Signed-off-by Andy Shevchenko <[email protected]>---
Documentation/printk-formats.txt | 13 ++++++++++--- lib/vsprintf.c | 11 +++++++++--2 files changed, 19 insertions(+), 5 deletions(-)Documentation/printk- renamed from Documentation/printk-formats.txt +0
-0formats.txt
index 5962949..d8c40c3 100644Documentation/printk-formats.txt +0
-0@@ -79,9 +79,16 @@ Physical addresses types phys_addr_t:
%pa[p]0x01234567or0x0123456789abcdefDocumentation/printk-formats.txt +0
-2- For printing a phys_addr_t type (and its derivatives, such as - resource_size_t) which can vary based on build options,regardless of
Documentation/printk-formats.txt +1
-1- the width of the CPU data path. Passed by reference. + For printing a phys_addr_t type which can vary based on buildoptions,
Documentation/printk-formats.txt +1
-0+ regardless of the width of the CPU data path. Passed byreference.
Documentation/printk-formats.txt +6
-0+ +Resource size types resource_size_t: + + %par 0x01234567 or 0x0123456789abcdef + + For printing a resource_size_t type which can vary based onbuild
Documentation/printk-formats.txt +1
-0+ options, regardless of the width of the CPU data path. Passedby
Documentation/printk-formats.txt +1
-0+ reference.
DMA addresses typesdma_addr_t:lib/vsprintf.c +4
-0@@ -1373,6 +1373,10 @@ char *address_val(char *buf, char *end, const void *addr, const char *fmt) num = *(const dma_addr_t *)addr; size = sizeof(dma_addr_t); break; +case 'r' : + num = *(const resource_size_t *)addr; + size =sizeof (resource_size_t); +break ;case 'p':
default:
num = *(constphys_addr_t*)addr;lib/vsprintf.c +0
-0@@ -1548,8 +1552,11 @@ int kptr_restrict __read_mostly; * N no separator * The maximum supported length is 64 bytes of the input.Consider
* to useprint_hex_dump()for the larger input.
- * - 'a[pd]' For address types [p]phys_addr_t, [d]dma_addr_tand derivatives
- * (default assumed to bephys_addr_t, passed by reference)
+ * - 'a[dpr]' For address types (default assumed to bephys_addr_t, passed by
+ * reference):
+ * [d]dma_addr_t
+ * [p]phys_addr_t
+ * [r]resource_size_t
* - 'd[234]' For a dentry name (optionally 2-4 last components)
* - 'D[234]' Same as 'd' but for a struct file
* - 'g' Forblock_devicename (gendisk + partition number)
Signature · 2 lines
Andy Shevchenko <[email protected]> Intel Finland Oy