All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] vsprintf: Move space out of string literals in fourcc_string()
@ 2022-01-10 20:55 Andy Shevchenko
  2022-01-10 22:13 ` Sakari Ailus
  2022-01-11 10:26 ` Rasmus Villemoes
  0 siblings, 2 replies; 6+ messages in thread
From: Andy Shevchenko @ 2022-01-10 20:55 UTC (permalink / raw)
  To: Petr Mladek, linux-kernel
  Cc: Steven Rostedt, Sergey Senozhatsky, Andy Shevchenko,
	Rasmus Villemoes, Sakari Ailus

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@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---

Depends on the
https://lore.kernel.org/lkml/20220110205049.11696-1-andriy.shevchenko@linux.intel.com/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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-01-11 16:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-10 20:55 [PATCH v1 1/1] vsprintf: Move space out of string literals in fourcc_string() Andy Shevchenko
2022-01-10 22:13 ` Sakari Ailus
2022-01-11 10:26 ` Rasmus Villemoes
2022-01-11 11:28   ` Andy Shevchenko
2022-01-11 15:10     ` Petr Mladek
2022-01-11 16:14       ` Rasmus Villemoes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.