vsprintf: Move space out of string literals in fourcc_string()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 27 Jan 2022 18:12:33 +0000 (20:12 +0200)
committerPetr Mladek <pmladek@suse.com>
Thu, 10 Feb 2022 12:16:50 +0000 (13:16 +0100)
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@linux.intel.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20220127181233.72910-2-andriy.shevchenko@linux.intel.com
lib/vsprintf.c

index 3e416a3cb66d415edeba51991a3df81a98f80b52..f96c66899df6b8f6d2cde581a013ba135650399a 100644 (file)
@@ -1790,7 +1790,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++ = ' ';