aboutsummaryrefslogtreecommitdiffstats
path: root/lib-vsprintf-add-pap-padp-options.patch
diff options
Diffstat (limited to 'lib-vsprintf-add-pap-padp-options.patch')
-rw-r--r--lib-vsprintf-add-pap-padp-options.patch80
1 files changed, 0 insertions, 80 deletions
diff --git a/lib-vsprintf-add-pap-padp-options.patch b/lib-vsprintf-add-pap-padp-options.patch
deleted file mode 100644
index 3c2202ceabe737..00000000000000
--- a/lib-vsprintf-add-pap-padp-options.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From: Chris Fries <cfries@google.com>
-Subject: lib: vsprintf: Add "%paP", "%padP" options
-
-Add %paP and %padP for physical address that need to always be shown
-regardless of kptr restrictions.
-
-Cc: William Roberts <william.c.roberts@intel.com>
-Cc: Dave Weinstein <olorin@google.com>
-Signed-off-by: Chris Fries <cfries@google.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- Documentation/printk-formats.txt | 10 ++++++----
- lib/vsprintf.c | 12 +++++++++---
- 2 files changed, 15 insertions(+), 7 deletions(-)
-
---- a/Documentation/printk-formats.txt
-+++ b/Documentation/printk-formats.txt
-@@ -121,21 +121,23 @@ Physical addresses types ``phys_addr_t``
-
- ::
-
-- %pa[p] 0x01234567 or 0x0123456789abcdef
-+ %pa[p][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.
-+the width of the CPU data path. Passed by reference. Use the trailing
-+'P' if it needs to be always shown.
-
- DMA addresses types ``dma_addr_t``
- ==================================
-
- ::
-
-- %pad 0x01234567 or 0x0123456789abcdef
-+ %pad[P] 0x01234567 or 0x0123456789abcdef
-
- For printing a ``dma_addr_t`` type which can vary based on build options,
--regardless of the width of the CPU data path. Passed by reference.
-+regardless of the width of the CPU data path. Passed by reference. Use
-+the trailing 'P' if it needs to be always shown.
-
- Raw buffer as an escaped string
- ===============================
---- a/lib/vsprintf.c
-+++ b/lib/vsprintf.c
-@@ -1395,23 +1395,29 @@ static noinline_for_stack
- char *address_val(char *buf, char *end, const void *addr, const char *fmt)
- {
- unsigned long long num;
-+ int cleanse = kptr_restrict_cleanse_addresses();
-+ int decleanse_idx = 1;
- int size;
-
- switch (fmt[1]) {
- case 'd':
- num = *(const dma_addr_t *)addr;
- size = sizeof(dma_addr_t);
-+ decleanse_idx = 2;
- break;
- case 'p':
-+ decleanse_idx = 2;
-+ /* fall thru */
- default:
- num = *(const phys_addr_t *)addr;
- size = sizeof(phys_addr_t);
- break;
- }
-
-- return special_hex_number(buf, end,
-- kptr_restrict_cleanse_addresses() ? 0UL : num,
-- size);
-+ /* 'P' on the tail means don't restrict the pointer. */
-+ cleanse = cleanse && (fmt[decleanse_idx] != 'P');
-+
-+ return special_hex_number(buf, end, cleanse ? 0UL : num, size);
- }
-
- static noinline_for_stack