lib/vsprintf: Move pointer_string() upper
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 16 Feb 2018 21:07:07 +0000 (23:07 +0200)
committerPetr Mladek <pmladek@suse.com>
Wed, 11 Apr 2018 08:32:42 +0000 (10:32 +0200)
As preparatory patch to further clean up.

No functional change.

Link: http://lkml.kernel.org/r/20180216210711.79901-5-andriy.shevchenko@linux.intel.com
To: "Tobin C . Harding" <me@tobin.cc>
To: linux@rasmusvillemoes.dk
To: Joe Perches <joe@perches.com>
To: linux-kernel@vger.kernel.org
To: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
lib/vsprintf.c

index c789d265311b0078702d6d09dbfa90ed2a4c049a..87dbced51b1afa012f7078c5261659465381f327 100644 (file)
@@ -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;