From nobody Sun Feb 8 07:15:06 2026 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 66B761C5D57 for ; Wed, 17 Dec 2025 12:37:02 +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=1765975022; cv=none; b=q8Xg1mLwhqmuT9wuHulgP6bCHLjTwLdzEy26UdRshAqNDYo9uvHbhPahMcFaIKLzMj8eiI8QgQOVPq5ij3aa44wFjPn7/vP6mymayoF/SBp2Vyt2vW8yclksoZBbCaCc8ke64QzwXXwsFB9lzWdB40XZHWfzD1+RPlwxILnxM00= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765975022; c=relaxed/simple; bh=nZn+ax3RHfVjbbgt8eSi7Y9BbpwM/+jJ0FKy/ag9hGI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=i7m5ISgN9jRBt6EZ+xaD4nOekyu4m2aXb7wfAgRIGTEKUHvhQEyzJq0QnGHZiIIZXm3AdPllNwn5o5P2g5xAF7ldkqLoe+SQnNlEB5OZg1gIv/Xa/TTHdNiAocBPGnkxiTfe2sYhuNo10kwtXbKm8eoX53WHsD/VwSyIahOeeGg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ipqlkflW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ipqlkflW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 594B5C4CEF5; Wed, 17 Dec 2025 12:37:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765975021; bh=nZn+ax3RHfVjbbgt8eSi7Y9BbpwM/+jJ0FKy/ag9hGI=; h=From:To:Cc:Subject:Date:From; b=ipqlkflWquZRo/lpAzayhsX42Ybte5HVsjPncIUOA8vZxHRWfOzh+SoujJbKvq+lP qitInWekbRmAvV23iN9cLDYOB9bJ8Zs9TbJXjHN0IG6uvG1556cTi6Sle/RpdbTn8h 1hW2Cj3Z1rBQsxyH7RoxbDXg2x3dJUvPWoMcjFyk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Jakub Kicinski , David Gow , "Masami Hiramatsu (Google)" , Vlastimil Babka , Kees Cook Subject: [PATCH] test_list_sort: fix up const mismatch Date: Wed, 17 Dec 2025 13:36:52 +0100 Message-ID: <2025121751-backtrack-manifesto-7c57@gregkh> X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1620; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=nZn+ax3RHfVjbbgt8eSi7Y9BbpwM/+jJ0FKy/ag9hGI=; b=owGbwMvMwCRo6H6F97bub03G02pJDJlOix//f7p70Q+W9oqTtbczDust6zF7P+1Cvj3jzeMb7 B9sEP6u2RHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATeWrLsODI2uOSL512Cf1l tW9q/na9UE4hfxnDfHfxdssgIf3ySxVLKiIWHzr5sqg1AQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In the internal cmp function, a const pointer is cast out to a non-const pointer by using container_of(). This is probably not what is intended at all, so fix up the const marking to properly preserve what is really happening (i.e. the const should flow through the container_of() call) Cc: Jakub Kicinski Cc: David Gow Cc: "Masami Hiramatsu (Google)" Cc: Vlastimil Babka Cc: Kees Cook Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Reviewed-by: David Gow --- lib/tests/test_list_sort.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tests/test_list_sort.c b/lib/tests/test_list_sort.c index 30879abc8a42..28158557b164 100644 --- a/lib/tests/test_list_sort.c +++ b/lib/tests/test_list_sort.c @@ -26,7 +26,7 @@ struct debug_el { unsigned int serial; }; =20 -static void check(struct kunit *test, struct debug_el *ela, struct debug_e= l *elb) +static void check(struct kunit *test, const struct debug_el *ela, const st= ruct debug_el *elb) { struct debug_el **elts =3D test->priv; =20 @@ -46,7 +46,7 @@ static void check(struct kunit *test, struct debug_el *el= a, struct debug_el *elb /* `priv` is the test pointer so check() can fail the test if the list is = invalid. */ static int cmp(void *priv, const struct list_head *a, const struct list_he= ad *b) { - struct debug_el *ela, *elb; + const struct debug_el *ela, *elb; =20 ela =3D container_of(a, struct debug_el, list); elb =3D container_of(b, struct debug_el, list); --=20 2.52.0