From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754001AbbLCUvh (ORCPT ); Thu, 3 Dec 2015 15:51:37 -0500 Received: from mail-lb0-f177.google.com ([209.85.217.177]:34786 "EHLO mail-lb0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753795AbbLCUvc (ORCPT ); Thu, 3 Dec 2015 15:51:32 -0500 From: Rasmus Villemoes To: Andrew Morton , Andy Shevchenko , Rasmus Villemoes , Kees Cook , Martin Kletzander Cc: Ingo Molnar , linux-kernel@vger.kernel.org Subject: [PATCH v3 02/14] lib/vsprintf.c: move string() below widen_string() Date: Thu, 3 Dec 2015 21:51:01 +0100 Message-Id: <1449175873-1780-3-git-send-email-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.6.1 In-Reply-To: <1449175873-1780-1-git-send-email-linux@rasmusvillemoes.dk> References: <1449175873-1780-1-git-send-email-linux@rasmusvillemoes.dk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is pure code movement, making sure the widen_string() helper is defined before the string() function. Cc: Ingo Molnar Signed-off-by: Rasmus Villemoes --- lib/vsprintf.c | 62 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index d7452563a6a6..a021e6380404 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -507,37 +507,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; @@ -586,6 +555,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) { -- 2.6.1