]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
kunit: fix up const mis-match in many assert functions
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Dec 2025 12:32:47 +0000 (13:32 +0100)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 5 Jan 2026 22:32:03 +0000 (15:32 -0700)
commite70a307b852804b2a7aaaafdd37542ca11e6eb00
treea6d08b658a2a2e06c2360779ec4e211ca5182139
parent567b3d3af647fe1e9b9fb306c70850c7066130a8
kunit: fix up const mis-match in many assert functions

In many kunit assert functions a const pointer is passed to
container_of() and out pops a non-const pointer, which really isn't the
correct thing to do at all.  Fix this up by correctly marking the
casted-to pointer as const to preserve the marking.

Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: Rae Moar <raemoar63@gmail.com>
Cc: linux-kselftest@vger.kernel.org
Cc: kunit-dev@googlegroups.com
Link: https://lore.kernel.org/r/2025121746-result-staleness-5a68@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
lib/kunit/assert.c