]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
lib: memcpy_kunit: Fix an invalid format specifier in an assertion msg
authorDavid Gow <davidgow@google.com>
Wed, 21 Feb 2024 09:27:16 +0000 (17:27 +0800)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:19:18 +0000 (18:19 -0400)
commit3c3d394b531fe141ddabc02eed7b7d4a9e49da9c
tree091487185e065926f214ab85ddacc47b241e2c2e
parent8d98a46b8b45534cbbf21d99a17b857b5f9e984d
lib: memcpy_kunit: Fix an invalid format specifier in an assertion msg

[ 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 <davidgow@google.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Justin Stitt <justinstitt@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
lib/memcpy_kunit.c