Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2599292lqp; Mon, 25 Mar 2024 04:07:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWporo7gmgdabxa/lZ/Gf1F0MB2vtrLujMTLppTeDI091LdWnIt+a4tgxwasYloC5acXupqztX18xJzGy1TmmWov6FylQILY8zkWkugaA== X-Google-Smtp-Source: AGHT+IHdfoqaq7G3KxHiRzXa3uD/8WsC+RGTs/VfDH5/VQOfqr3lWTE31hvZonMTJH/p+IqibgCK X-Received: by 2002:a05:6a20:3b06:b0:1a3:4e17:ff8f with SMTP id c6-20020a056a203b0600b001a34e17ff8fmr6669538pzh.57.1711364840779; Mon, 25 Mar 2024 04:07:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711364840; cv=pass; d=google.com; s=arc-20160816; b=Yf9bLDEDib28+JK5z1N4zf50wmIlKRsyFOiPIdBEWHZhdQC18OlhefYywl0bjWhrgi Ffnzjpaerl7Jfy+GMmHhEOxkM05GMDdyUWsGKEoSJk7ztCOLgJJ21P//ZMD1tbifS1hz knavxb4QXLMLXJW7pVEGhbBYucaGzGYYhylah3TdryHs2RN4vSot3a12+TT1eaW8oSEe iMrlpSRMt5H/2x06uA1ImzrxZuNOdwqnm7l7Mx0Sec9Sp60onn7he+3fuxf+BNN0wEF1 i857arYFaKZkW+NCA25oQT0cSyYoYkTvF9z47HUe+z4fvNX2Vq0JbWQH2ai7Ds6EUhxe IyDw== 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=TKEXK4Dq2c61WXg5g81vVhbnqaf5tj1JPFjphefKy9o=; fh=Ow1Fg1yIqSnWhRTIIpoQqIj31E6WqHvFSV9tyI1UJ/w=; b=Kb2lD7RY83UjJXii0CGtdVaPkgCsAaLOflCjbmfVYlL/3ScKfHpbn01/Prziu1Osno liUbSG32LNqq+8AbPyI6bEkwxAJnUuSWhc7pi1lvHcJ+iOmPk80sL2V+vikgeNu28LE6 aS9MzUdQ1bTEVjJObNwgveF8OBbbVIelYK+3V0y9WvmARixvjy0dkVPnUGYW2XP2gguu 5ERUnVtrSmiUIw/roW6atxAVEhQNiYUy8RhR4A2cR6DLJATADBpghU9mzU6gYmwZIraP QruJRN6KizorZasn9PcUgfIjOaNnbfi73gTxlrxsvPDmbDGJH64tCtFzl6rTWaWzNl1m jPPw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u9a9A5ma; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115353-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115353-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id g13-20020a63e60d000000b005cdfb96ea62si7585861pgh.243.2024.03.25.04.07.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 04:07:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115353-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u9a9A5ma; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115353-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115353-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id EA170B3DBB8 for ; Mon, 25 Mar 2024 10:43:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 95AC81EC4CA; Mon, 25 Mar 2024 02:34:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="u9a9A5ma" 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 C540381ADB; Sun, 24 Mar 2024 22:49:06 +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=m0Mh75qo+dfBfArmqBzj+tTh1X2/IMnya0Z40e9ZcqzCB5K28KfX8j27dJPyw76DkfyPFVLE5mInrfT66Vis5zSC1HkMp6KzNjFc0NaloHNjwAfPdvTO8vxrh2CG5Ujd3ndNQYG+iARh7toe68356UcBYITpFHhfskbor8GGlRA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320547; c=relaxed/simple; bh=UtPbFHo8lwti70qwLux/kF9zRmuI2UztEodfyyPfoCg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=emstW3FzHajmogWkkKkMNepupDzSobch1Tj63G93vMXubPF2oS0AeDytLrNQ2QntUNAtEu+4oUsl0zmTp+v31DdwKbOfjIEI/Y2iWu8CKefO18ASSBe/sBdE6lRrXD+q+D79Fd2JtJhTaqIvpUtyJQMHdMlNgnMYSYdMKSthzeI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=u9a9A5ma; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D8B4C43390; Sun, 24 Mar 2024 22:49:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320546; bh=UtPbFHo8lwti70qwLux/kF9zRmuI2UztEodfyyPfoCg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u9a9A5maXPKU8On3HszyYBE0lPB2y8tvJqEXF9x9NwgzJ53u7mWXYT8mY7K4L6a/7 tcSvQx804G5zhDua5FHFDd+zmgYWJ1pZ5YNAlobm+ZlAMMvlSl2maCr/MyQBqVRiOO WJbrQWqUkro0aIMeS7CEFafE3qRyBJMICtALqR9Chac5yIRhjHC/4UKg9hhcM6ZxNu yqIQG/ARdNvSvnSrAtVYc/MsIN1wog4k2II129P+b0bFr5dFOUdVMC0//7a3rjo/CB QIjgnxo36hoDFhMnEMrvn8A05wG/yyymOTky+iZzHUaMEOst37efsRKhOZ8RuMgCfY w4jDqkfjEAKpQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: David Gow , Guenter Roeck , Daniel Latypov , Shuah Khan , Sasha Levin Subject: [PATCH 6.7 107/713] lib/cmdline: Fix an invalid format specifier in an assertion msg Date: Sun, 24 Mar 2024 18:37:13 -0400 Message-ID: <20240324224720.1345309-108-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 d2733a026fc7247ba42d7a8e1b737cf14bf1df21 ] The correct format specifier for p - n (both p and n are pointers) is %td, as the type should be ptrdiff_t. This was discovered by annotating KUnit assertion macros with gcc's printf specifier, but note that gcc incorrectly suggested a %d or %ld specifier (depending on the pointer size of the architecture being built). Fixes: 0ea09083116d ("lib/cmdline: Allow get_options() to take 0 to validate the input") Signed-off-by: David Gow Tested-by: Guenter Roeck Reviewed-by: Daniel Latypov Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- lib/cmdline_kunit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cmdline_kunit.c b/lib/cmdline_kunit.c index d4572dbc91453..705b82736be08 100644 --- a/lib/cmdline_kunit.c +++ b/lib/cmdline_kunit.c @@ -124,7 +124,7 @@ static void cmdline_do_one_range_test(struct kunit *test, const char *in, n, e[0], r[0]); p = memchr_inv(&r[1], 0, sizeof(r) - sizeof(r[0])); - KUNIT_EXPECT_PTR_EQ_MSG(test, p, NULL, "in test %u at %u out of bound", n, p - r); + KUNIT_EXPECT_PTR_EQ_MSG(test, p, NULL, "in test %u at %td out of bound", n, p - r); } static void cmdline_test_range(struct kunit *test) -- 2.43.0