Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5501386pxb; Wed, 26 Jan 2022 13:32:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7LW2ShYMc1lix8JMh6KYhPlKg8l9ofpYEs221ynU0F0pVSf8ODn5S9oA7Tw4iUgcC2bQi X-Received: by 2002:a17:902:ecc2:: with SMTP id a2mr558412plh.27.1643232742345; Wed, 26 Jan 2022 13:32:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643232742; cv=none; d=google.com; s=arc-20160816; b=XFijlUuo8ePRpttM+xNf5bXWGHCw0/TeIAlvuZZstMMSFKXkbS5UJJMnvo7pwO/nHy qVc++IY3Z79HqxmfcQZi3D/jxMOUiIS+WBH3+T1BIkQDowNsFj9QMChzx8dY1NOsQ1QI Xd6EGniaYZH5Bv6At7g7gatQbBejnerDxvucZRV9CcYNHW1v/JjXrbjk+TbscfzOoq9f j8VhVBrTGmVa/IdQnZR3Jruy7ohpb2qNHGIUbwuXh0vVPF2lU7AfITml67FRXhi4fvKl nOFmhkHSo+Wd7MWbdgHYoOOBxluQQdc2Jt+FVedZSyJrpg4dfUUmD++AhWwtOtw0ufsu YaFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gxaUAoF/8/qhcceuJXqxLBsulwz0SKUP5VmptqAxJho=; b=TSbJULpcZuE3Ixpc/9iMsXf26hZ5ocN8Kem33jZOjXAXiWVi3uNZ8J3lSI4NDLyq2i XLYzzaqsxZkm/0K7esSnWOTwm02vPczvkFtkoc8gna32TjNDDp1ctCfzNyLKlq1ER193 2yIFERCQseh+fuI0KrLd5ANlmVyQ1KWrePCqSwbA5YBZN3bjxAQPmVUw0KMo6g881IBB sYFd/Sa1jtut80daZ3y6pjivBQQ8E3EVs4s0wfif4vRV7YpG5um+uMREUa08TrJ23YD7 h0hfIOnMHO7rH+Zg8ibMo2raEciO2FmP+Y9c7WSN6ExkDY+yoADLNN6jZu9x83Hv5MMT 8VwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JgqLl8f3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bj7si316814plb.408.2022.01.26.13.32.09; Wed, 26 Jan 2022 13:32:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JgqLl8f3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242055AbiAZOTK (ORCPT + 99 others); Wed, 26 Jan 2022 09:19:10 -0500 Received: from mga05.intel.com ([192.55.52.43]:24800 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235570AbiAZOTJ (ORCPT ); Wed, 26 Jan 2022 09:19:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643206749; x=1674742749; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IMYFtQz9rkY/3tjpaVw7Apkf5zFNR7UXirlLlWW0FOM=; b=JgqLl8f3JNontWOhpVwx7uJGyxgKMCBiDtv3wxkhgv/uldXyA1jJfqlP DHa+4822gpkMI6SJqDcRScmCLgbKRncmeGxtYXzDm0Y3ZMJUAhwI7nHCh PisoZgO7c6wAWsJMgelTJv9ZWkKoD2TiTar9I9T86pJhcZfcBXa0tWrbQ cZ9j3aCbxdIc7chcSE/2FJH9EEyz5KOG0qbkGr6DNwgz2tSgP0eS3ClMI 4L9uLLET+7R2ezsY6+9iHe0L1sX/pRJk+VWd50nvvFcQL/7b8DTBADnMN wB7/QudRgWSia8mt5g4fscGHVygRm5TPlJd5OgD+Rtv+bAj9hjKWuui2k A==; X-IronPort-AV: E=McAfee;i="6200,9189,10238"; a="332911687" X-IronPort-AV: E=Sophos;i="5.88,318,1635231600"; d="scan'208";a="332911687" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2022 06:19:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,318,1635231600"; d="scan'208";a="581116026" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 26 Jan 2022 06:19:06 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id DE4625E4; Wed, 26 Jan 2022 16:19:19 +0200 (EET) From: Andy Shevchenko To: Kees Cook , Francis Laniel , Petr Mladek , linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Steven Rostedt , Sergey Senozhatsky , Rasmus Villemoes , Andy Shevchenko , Sakari Ailus Subject: [PATCH v3 3/3] vsprintf: Move space out of string literals in fourcc_string() Date: Wed, 26 Jan 2022 16:19:17 +0200 Message-Id: <20220126141917.75399-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220126141917.75399-1-andriy.shevchenko@linux.intel.com> References: <20220126141917.75399-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The literals "big-endian" and "little-endian" may be potentially occurred in other places. Dropping space allows linker to "compress" them by using only a single copy. Rasmus suggested, while at it, replacing strcpy() + strlen() by p = stpcpy(), which is done here as well. Signed-off-by: Andy Shevchenko Acked-by: Sakari Ailus --- v3: no changes lib/vsprintf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 4e8f3e9acb99..e2a1d89f1a5c 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -1781,8 +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 += strlen(p); + *p++ = ' '; + p = stpcpy(p, orig & BIT(31) ? "big-endian" : "little-endian"); *p++ = ' '; *p++ = '('; -- 2.34.1