Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2555920lqp; Mon, 25 Mar 2024 02:27:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV+1lUAJKJ1yQ2ezaZzHvFO1yYw6QLcF9T13WDTKGk2hRhcpHfF1n8HiTi7TPSEucFCNiiT0ZH2jyvR0H5/v3V+rB/N0Vpmso2eBX40Fg== X-Google-Smtp-Source: AGHT+IEGU+3/hxljBZPs1KLRVdgDzMLtSp5YGjvluvYThvZNjz19sF9MBm8iWxmtgxGfUk7O4YVB X-Received: by 2002:a05:6214:48b:b0:696:45f2:a3f4 with SMTP id pt11-20020a056214048b00b0069645f2a3f4mr6601106qvb.63.1711358868669; Mon, 25 Mar 2024 02:27:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711358868; cv=pass; d=google.com; s=arc-20160816; b=ylkmtawAJ3wdyiJEqCSldIFaYAe1roGTT3SM7JE1U1Qje/JPTm5obKEMh1XoIfkuzY k0iGebrW9RSNfqhPWMlK+AvEPbVDTU0IgZcXJh0KCT3gsr5g2ga+9g00qlTWUOPOmnVM 26PtgQUwHA835vEsQ2+AxFpBobfZGQeBhjUMhuLNCcdl/MJA3pDbWoQ/UV4KqArXYLkS 1mMQWzdXjLlzAUcLYsI68pBzgeZlZaIWC7bE5Fvx0Lmicw3nxqFPCsHeqpuJUrsO4TY+ cnP7YPB647q36H5pdA/YOdlUvvkDfA0+QOCTJLrGZYmv3Sucuad0r6c7Qw1ji/dCwiI6 Cr4A== 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=z2IbYuVbLRUvPp32ddmPwJ8paYfj9ZqA4r82LmxXtAFzYPm/iDWVjqWZJJFufXoF9s yPaa3kYx5asl5gCnXP2au/+OvnyeuEhSmPvWs+g/QGDfpDRYrRwm0kWumsYAit9PNKw4 kd++sgANr8Kf557/Pfq8X0ECJBuvMChnN6V5LQEnq+lpuhZiQEMJ94jJduslyqtOgmQs 0F26y8Yc/WoH3enctSag0gDcCKkqMC3d8R15BFV0nQQUiJVgKiBJra+AIdrl7YbvKDYK pjq8VBJs6iwknro7zJtFTJ2YN1s8pNKsStpnYRT8ZqpMgiVRhDFuNGorOYbDH6x5Jc1j nkcA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lGyRJeo0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115814-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115814-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 2-20020a0562140dc200b0069694dab3ecsi258837qvt.153.2024.03.25.02.27.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 02:27:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115814-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=lGyRJeo0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115814-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115814-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 68D691C313B4 for ; Mon, 25 Mar 2024 09:27:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 56A55375F58; Mon, 25 Mar 2024 03:01:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lGyRJeo0" 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 BFC11145B07; Sun, 24 Mar 2024 23:13:16 +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=1711321996; cv=none; b=W6ZKiB44zRcpfo+OpxDS0c5pxb1KIGt9jnmjcgKOjKO5ZXc4r9zOh0X0LYDpPKE/NYFg6Sd2skW43Idn1pTX5YE7Ssj1prMM/BNN4GZdLju44EBsu4voIsh1Bl8MTtZYVhOXxJnBMcyenYwO4AmzW5++ESq78OUvwL2M5OA1Pa4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321996; c=relaxed/simple; bh=UtPbFHo8lwti70qwLux/kF9zRmuI2UztEodfyyPfoCg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HTz+D5jKL4yQ+w47IBI5WPaCrR7Rlq9HjHYYEA1GsOyWjnJtGJFrGgaKpyQO7Y+zoylAXEJy+PLBHoIw+84TxXqnKXQdxvM+Cw512LDVLMiXQV5a0iSc1sTLeNJRsRzdn4GoeY9dGpn5q9ZiAikwsfAcRmyCZXIZHkxGcKHQIZY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lGyRJeo0; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCEB1C43394; Sun, 24 Mar 2024 23:13:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711321996; bh=UtPbFHo8lwti70qwLux/kF9zRmuI2UztEodfyyPfoCg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lGyRJeo0nzynd2sxyFbaewW8L8JwfHTSWj0dEVf+1FI3FwOHLHrgzaC600jNJM+Uw yFruXxYbfGiO+TJ2CaDWNzyc9XzvYRa3zBBwM1ZQt7Rk99RHpZ2kcaX4ALpzpgxmi3 vkUwZr00TWWjTQ5Jy+jeFpNDulwIai/1VxJiUrnr+7L9NaVNYz0glufvMGR2VDZX35 /iwtHi0wp5EgHlBF41gfxEyzTsFBAJxyo+EU7NVl/AxELK0x+dH8gHKHUcYSfn/q/n Qr7ZiM27DFRHXxf3UXESEmAm0zOKgCxhpmPLE+5JDCphSuu1f1vDLRQ3HdQ6bVINit KETDVH+BqhThg== 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.1 068/451] lib/cmdline: Fix an invalid format specifier in an assertion msg Date: Sun, 24 Mar 2024 19:05:44 -0400 Message-ID: <20240324231207.1351418-69-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-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