Skip to content
Commit fc9a6152 authored by David Gow's avatar David Gow Committed by Shuah Khan
Browse files

drm: tests: Fix invalid printf format specifiers in KUnit tests



The drm_buddy_test's alloc_contiguous test used a u64 for the page size,
which was then updated to be an 'unsigned long' to avoid 64-bit
multiplication division helpers.

However, the variable is logged by some KUNIT_ASSERT_EQ_MSG() using the
'%d' or '%llu' format specifiers, the former of which is always wrong,
and the latter is no longer correct now that ps is no longer a u64. Fix
these to all use '%lu'.

Also, drm_mm_test calls KUNIT_FAIL() with an empty string as the
message. gcc and clang warns if a printf format string is empty, so
give these some more detailed error messages, which should be more
useful anyway.

Fixes: a64056bb ("drm/tests/drm_buddy: add alloc_contiguous test")
Fixes: fca7526b ("drm/tests/drm_buddy: fix build failure on 32-bit targets")
Fixes: fc8d29e2 ("drm: selftest: convert drm_mm selftest to KUnit")
Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
Acked-by: default avatarChristian König <christian.koenig@amd.com>
Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
Reviewed-by: default avatarJustin Stitt <justinstitt@google.com>
Signed-off-by: default avatarDavid Gow <davidgow@google.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 689a930b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment