summaryrefslogtreecommitdiffstats
path: root/lib/vsprintf.c
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2016-01-15 16:58:31 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-16 11:17:26 -0800
commit95508cfa10503bbe5adb78bd1b2b56a01ab3dd2d (patch)
tree5878086c2c0b63aa6ea233db86e113c8b821d2aa /lib/vsprintf.c
parentcfccde04e28d26e9f102e535b7358bf6cf3bc6fb (diff)
downloadlinux-0-day-95508cfa10503bbe5adb78bd1b2b56a01ab3dd2d.tar.gz
linux-0-day-95508cfa10503bbe5adb78bd1b2b56a01ab3dd2d.tar.xz
lib/vsprintf.c: move string() below widen_string()
This is pure code movement, making sure the widen_string() helper is defined before the string() function. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Cc: Al Viro <viro@ZenIV.linux.org.uk> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Joe Perches <joe@perches.com> Cc: Kees Cook <keescook@chromium.org> Cc: Maurizio Lombardi <mlombard@redhat.com> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r--lib/vsprintf.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 3f37b478c4290..854d597ba23ca 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -510,37 +510,6 @@ char *number(char *buf, char *end, unsigned long long num,
return buf;
}
-static noinline_for_stack
-char *string(char *buf, char *end, const char *s, struct printf_spec spec)
-{
- int len, i;
-
- if ((unsigned long)s < PAGE_SIZE)
- s = "(null)";
-
- len = strnlen(s, spec.precision);
-
- if (!(spec.flags & LEFT)) {
- while (len < spec.field_width--) {
- if (buf < end)
- *buf = ' ';
- ++buf;
- }
- }
- for (i = 0; i < len; ++i) {
- if (buf < end)
- *buf = *s;
- ++buf; ++s;
- }
- while (len < spec.field_width--) {
- if (buf < end)
- *buf = ' ';
- ++buf;
- }
-
- return buf;
-}
-
static void move_right(char *buf, char *end, unsigned len, unsigned spaces)
{
size_t size;
@@ -589,6 +558,37 @@ char *widen_string(char *buf, int n, char *end, struct printf_spec spec)
}
static noinline_for_stack
+char *string(char *buf, char *end, const char *s, struct printf_spec spec)
+{
+ int len, i;
+
+ if ((unsigned long)s < PAGE_SIZE)
+ s = "(null)";
+
+ len = strnlen(s, spec.precision);
+
+ if (!(spec.flags & LEFT)) {
+ while (len < spec.field_width--) {
+ if (buf < end)
+ *buf = ' ';
+ ++buf;
+ }
+ }
+ for (i = 0; i < len; ++i) {
+ if (buf < end)
+ *buf = *s;
+ ++buf; ++s;
+ }
+ while (len < spec.field_width--) {
+ if (buf < end)
+ *buf = ' ';
+ ++buf;
+ }
+
+ return buf;
+}
+
+static noinline_for_stack
char *dentry_name(char *buf, char *end, const struct dentry *d, struct printf_spec spec,
const char *fmt)
{