Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2588001lqp; Mon, 25 Mar 2024 03:42:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWbVgR/SsuUQtL5O9tZNE4TV64XILA1nW0wPmDwCPw98c5cwYRJCtymPPzvN3lamA3CxGOW14177s/DLtLDd9cuYjKVw+2gux+5q25Y9g== X-Google-Smtp-Source: AGHT+IHv+a998m47kXufWx3TtoUOEBfete4YuXUVUrkQu6nTw8KjFK7yHmg+I4WVi0EZpT4v6gsI X-Received: by 2002:a05:622a:15cb:b0:431:4d37:925e with SMTP id d11-20020a05622a15cb00b004314d37925emr4723682qty.51.1711363322182; Mon, 25 Mar 2024 03:42:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711363322; cv=pass; d=google.com; s=arc-20160816; b=JviPCyhE1atsM6G3zWZYrjQGxQVp+HspaV1PciJoMJFS90K+DmrESH9Pq9yYyHf0fE 6gWMujPkOAtI5h0woqXect0TePTgTkAhMr5rPXiNzUeh8mMH3yLwHGLPdHk3i+LL80FL wvQX7yITIih2JuzyXbUBl44odx9/PP9LOA4i5Qlk475GydfaxgeGPNHzdApUCpqvhN3W d383/vxZw2xc82eCXTnUEm6wzqD4Epfi0wWxV+1fSH4NG2AVvqSAsL4PcMKZDx1hTjjt 8iLodToG/28x1CYi9OgMAp2vbZgfLsvuGCvufAZpQHGnL2oQQNN4bMMeVtqwfdm0erpR 6dRQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=eMn6gpLt+7N6bYSB/cqO6r/FDOTK116wtB8u+sq0IIg=; fh=8RLesEX/izE45skaFMbpAL6XzjHMQxils0u7MR51RLA=; b=bTQG/MbN92jNU+Dp3D3g6p/E3apL6MP5v1v9G867Dw5bupuQL1ATfK67BYBd3tDPUx xLqfW/b7e/iWq8OjwSsE13GSqMozjWhKCgCV0MJlT06QOkxWhJ1UlXnNyou3ndo7u7Yj xRvIhZ0mDLIZpyxGZGq1No5kgCT6U+iAolvddkabZIhpw/9w2ESiQW2toaS7gmcgtY7o sOljYnOUCwJR8Rd+5yxQQBkbarZy0WEBDNh88vZC7WfELq16t/AmcgSwO5iw+1eNtbUn 8HfCKiV2MNnJyOSkaoVlIZfK1h4utyo1xcN82u1V3xv2oO49djBYCCsiPi+yjyYyVAOJ QpRg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cGIUOnfm; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115346-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115346-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f10-20020ac859ca000000b004315aed85e9si1372454qtf.124.2024.03.25.03.42.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 03:42:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115346-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cGIUOnfm; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115346-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115346-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D97071C2D388 for ; Mon, 25 Mar 2024 10:42:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D433E1E8910; Mon, 25 Mar 2024 02:33:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cGIUOnfm" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9540A80612; Sun, 24 Mar 2024 22:49:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320547; cv=none; b=ouj5wKG91iePJdukynrN42OPwuWxbdHRlfD2+ItCJXoJXqt0oNiqMYJxFdLLsnUhaEsoIoNzNJSPD/M0gnjgC9/CFMV3mcahQ69+TF6NuNPx4vmpJ2kDk+tx/ld49iE86yLYdpVz16oL4SVi/kw7PRYgXsMzdOiJX/sM/uaDCag= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320547; c=relaxed/simple; bh=//otllxWTZARqxoMNJaZWiaXPi8swLKbFrMrfBueuy4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RHIBCPrPVNrdnXHDiCPECouP0ojwU/QUPA3H4GytM8mjB734krPMdTXPkM1jOX7gaw8ph6wqrXQmC7txnmzIh2iTwLx8FcOzbvohXsjFQCSadcGAxUKK3qrb5xM7HXHQe1dMytqNPIta/HhnKp8imfIDSwcMkf9xunvl0ffr8hk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cGIUOnfm; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5A4DC433F1; Sun, 24 Mar 2024 22:49:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320547; bh=//otllxWTZARqxoMNJaZWiaXPi8swLKbFrMrfBueuy4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cGIUOnfmCIreTtQW5eMttoK7GtJJtmZ+7W7kTCVPCwTv/HRe5wiI5CNs4MxrDOlhm mn7c91LQq2U4jqllR35ADCYZFWp5xUDBtRmAGpR0jhUA1S6yJOf8kxjSLDS4e/7L/P nKY2FtjGROavrBmKHJvFKe7tQ3UNrgHkxLMVFj7SoU/jAqodod95HWkuYxCxm5ZeqT ZT5eunTm5N4wz4zMTs/dzBAWObkKCD1xVCMhv8yF9mLsmlg/Yu9cGT0tmH8HPxrBYa pY846/RO+SfVpfopT2mbKa2U7tmj1Zky0pP/I4uaP30+4z2KwwH/zU2Sp77A/B1zdH zyEVqpsHJZCjQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: David Gow , Guenter Roeck , Justin Stitt , Shuah Khan , Sasha Levin Subject: [PATCH 6.7 108/713] lib: memcpy_kunit: Fix an invalid format specifier in an assertion msg Date: Sun, 24 Mar 2024 18:37:14 -0400 Message-ID: <20240324224720.1345309-109-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324224720.1345309-1-sashal@kernel.org> References: <20240324224720.1345309-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: David Gow [ Upstream commit 0a549ed22c3c7cc6da5c5f5918efd019944489a5 ] The 'i' passed as an assertion message is a size_t, so should use '%zu', not '%d'. This was found by annotating the _MSG() variants of KUnit's assertions to let gcc validate the format strings. Fixes: bb95ebbe89a7 ("lib: Introduce CONFIG_MEMCPY_KUNIT_TEST") Signed-off-by: David Gow Tested-by: Guenter Roeck Reviewed-by: Justin Stitt Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- lib/memcpy_kunit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/memcpy_kunit.c b/lib/memcpy_kunit.c index 440aee705ccca..30e00ef0bf2e0 100644 --- a/lib/memcpy_kunit.c +++ b/lib/memcpy_kunit.c @@ -32,7 +32,7 @@ struct some_bytes { BUILD_BUG_ON(sizeof(instance.data) != 32); \ for (size_t i = 0; i < sizeof(instance.data); i++) { \ KUNIT_ASSERT_EQ_MSG(test, instance.data[i], v, \ - "line %d: '%s' not initialized to 0x%02x @ %d (saw 0x%02x)\n", \ + "line %d: '%s' not initialized to 0x%02x @ %zu (saw 0x%02x)\n", \ __LINE__, #instance, v, i, instance.data[i]); \ } \ } while (0) @@ -41,7 +41,7 @@ struct some_bytes { BUILD_BUG_ON(sizeof(one) != sizeof(two)); \ for (size_t i = 0; i < sizeof(one); i++) { \ KUNIT_EXPECT_EQ_MSG(test, one.data[i], two.data[i], \ - "line %d: %s.data[%d] (0x%02x) != %s.data[%d] (0x%02x)\n", \ + "line %d: %s.data[%zu] (0x%02x) != %s.data[%zu] (0x%02x)\n", \ __LINE__, #one, i, one.data[i], #two, i, two.data[i]); \ } \ kunit_info(test, "ok: " TEST_OP "() " name "\n"); \ -- 2.43.0