Re: [PATCH v2 5/9] lib/vsprintf: Move pointer_string() upper
On Fri 2018-02-16 23:07:07, Andy Shevchenko wrote: > As preparatory patch to further clean up. > > No functional change. > > Signed-off-by: Andy ShevchenkoReviewed-by: Petr Mladek I have pushed it into printk.git, branch for-4.18-vsprintf-cleanup. Best Regards, Petr
Re: [PATCH v2 5/9] lib/vsprintf: Move pointer_string() upper
On Fri 2018-02-16 23:07:07, Andy Shevchenko wrote: > As preparatory patch to further clean up. > > No functional change. > > Signed-off-by: Andy Shevchenko Reviewed-by: Petr Mladek I have pushed it into printk.git, branch for-4.18-vsprintf-cleanup. Best Regards, Petr
[PATCH v2 5/9] lib/vsprintf: Move pointer_string() upper
As preparatory patch to further clean up. No functional change. Signed-off-by: Andy Shevchenko--- lib/vsprintf.c | 28 ++-- 1 file 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, return string(buf, end, uuid, spec); } +static noinline_for_stack +char *pointer_string(char *buf, char *end, const void *ptr, +struct printf_spec spec) +{ + spec.base = 16; + spec.flags |= SMALL; + if (spec.field_width == -1) { + spec.field_width = 2 * sizeof(ptr); + spec.flags |= ZEROPAD; + } + + return number(buf, end, (unsigned long int)ptr, spec); +} + int kptr_restrict __read_mostly; static noinline_for_stack @@ -1634,20 +1648,6 @@ char *device_node_string(char *buf, char *end, struct device_node *dn, return widen_string(buf, buf - buf_start, end, spec); } -static noinline_for_stack -char *pointer_string(char *buf, char *end, const void *ptr, -struct printf_spec spec) -{ - spec.base = 16; - spec.flags |= SMALL; - if (spec.field_width == -1) { - spec.field_width = 2 * sizeof(ptr); - spec.flags |= ZEROPAD; - } - - return number(buf, end, (unsigned long int)ptr, spec); -} - static bool have_filled_random_ptr_key __read_mostly; static siphash_key_t ptr_key __read_mostly; -- 2.15.1
[PATCH v2 5/9] lib/vsprintf: Move pointer_string() upper
As preparatory patch to further clean up. No functional change. Signed-off-by: Andy Shevchenko --- lib/vsprintf.c | 28 ++-- 1 file 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, return string(buf, end, uuid, spec); } +static noinline_for_stack +char *pointer_string(char *buf, char *end, const void *ptr, +struct printf_spec spec) +{ + spec.base = 16; + spec.flags |= SMALL; + if (spec.field_width == -1) { + spec.field_width = 2 * sizeof(ptr); + spec.flags |= ZEROPAD; + } + + return number(buf, end, (unsigned long int)ptr, spec); +} + int kptr_restrict __read_mostly; static noinline_for_stack @@ -1634,20 +1648,6 @@ char *device_node_string(char *buf, char *end, struct device_node *dn, return widen_string(buf, buf - buf_start, end, spec); } -static noinline_for_stack -char *pointer_string(char *buf, char *end, const void *ptr, -struct printf_spec spec) -{ - spec.base = 16; - spec.flags |= SMALL; - if (spec.field_width == -1) { - spec.field_width = 2 * sizeof(ptr); - spec.flags |= ZEROPAD; - } - - return number(buf, end, (unsigned long int)ptr, spec); -} - static bool have_filled_random_ptr_key __read_mostly; static siphash_key_t ptr_key __read_mostly; -- 2.15.1