[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220127181233.72910-2-andriy.shevchenko@linux.intel.com>
Date: Thu, 27 Jan 2022 20:12:33 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Petr Mladek <pmladek@...e.com>, linux-kernel@...r.kernel.org
Cc: Steven Rostedt <rostedt@...dmis.org>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Sakari Ailus <sakari.ailus@...ux.intel.com>
Subject: [PATCH v4 2/2] vsprintf: Move space out of string literals in fourcc_string()
The literals "big-endian" and "little-endian" may be potentially
occurred in other places. Dropping space allows linker to
merge them by using only a single copy.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Acked-by: Sakari Ailus <sakari.ailus@...ux.intel.com>
---
v4: dropped stpcpy() use (Kees), replaced "compress" with merge (Nick)
lib/vsprintf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 4e8f3e9acb99..a1babe5e07d1 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1781,7 +1781,8 @@ char *fourcc_string(char *buf, char *end, const u32 *fourcc,
*p++ = isascii(c) && isprint(c) ? c : '.';
}
- strcpy(p, orig & BIT(31) ? " big-endian" : " little-endian");
+ *p++ = ' ';
+ strcpy(p, orig & BIT(31) ? "big-endian" : "little-endian");
p += strlen(p);
*p++ = ' ';
--
2.34.1
Powered by blists - more mailing lists