diff options
| -rw-r--r-- | lib/vsprintf.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index c789d265311b..87dbced51b1a 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c | |||
| @@ -1347,6 +1347,20 @@ char *uuid_string(char *buf, char *end, const u8 *addr, | |||
| 1347 | return string(buf, end, uuid, spec); | 1347 | return string(buf, end, uuid, spec); |
| 1348 | } | 1348 | } |
| 1349 | 1349 | ||
| 1350 | static noinline_for_stack | ||
| 1351 | char *pointer_string(char *buf, char *end, const void *ptr, | ||
| 1352 | struct printf_spec spec) | ||
| 1353 | { | ||
| 1354 | spec.base = 16; | ||
| 1355 | spec.flags |= SMALL; | ||
| 1356 | if (spec.field_width == -1) { | ||
| 1357 | spec.field_width = 2 * sizeof(ptr); | ||
| 1358 | spec.flags |= ZEROPAD; | ||
| 1359 | } | ||
| 1360 | |||
| 1361 | return number(buf, end, (unsigned long int)ptr, spec); | ||
| 1362 | } | ||
| 1363 | |||
| 1350 | int kptr_restrict __read_mostly; | 1364 | int kptr_restrict __read_mostly; |
| 1351 | 1365 | ||
| 1352 | static noinline_for_stack | 1366 | static noinline_for_stack |
| @@ -1634,20 +1648,6 @@ char *device_node_string(char *buf, char *end, struct device_node *dn, | |||
| 1634 | return widen_string(buf, buf - buf_start, end, spec); | 1648 | return widen_string(buf, buf - buf_start, end, spec); |
| 1635 | } | 1649 | } |
| 1636 | 1650 | ||
| 1637 | static noinline_for_stack | ||
| 1638 | char *pointer_string(char *buf, char *end, const void *ptr, | ||
| 1639 | struct printf_spec spec) | ||
| 1640 | { | ||
| 1641 | spec.base = 16; | ||
| 1642 | spec.flags |= SMALL; | ||
| 1643 | if (spec.field_width == -1) { | ||
| 1644 | spec.field_width = 2 * sizeof(ptr); | ||
| 1645 | spec.flags |= ZEROPAD; | ||
| 1646 | } | ||
| 1647 | |||
| 1648 | return number(buf, end, (unsigned long int)ptr, spec); | ||
| 1649 | } | ||
| 1650 | |||
| 1651 | static bool have_filled_random_ptr_key __read_mostly; | 1651 | static bool have_filled_random_ptr_key __read_mostly; |
| 1652 | static siphash_key_t ptr_key __read_mostly; | 1652 | static siphash_key_t ptr_key __read_mostly; |
| 1653 | 1653 | ||
