[PATCH v1 1/1] vsprintf: Move space out of string literals in fourcc_string()

From: Andy Shevchenko
Date: Mon Jan 10 2022 - 15:56:10 EST


The literals "big-endian" and "little-endian" may be potentially
occurred in other places. Dropping space allows compiler to
"compress" them by using only a single copy.

Cc: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---

Depends on the
https://lore.kernel.org/lkml/20220110205049.11696-1-andriy.shevchenko@xxxxxxxxxxxxxxx/T/#u
but not to be critical or fix-like.

lib/vsprintf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index b02f01366acb..5818856d5626 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1780,7 +1780,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