drm/xe/tests: Fix printf format specifiers in xe_migrate test

BugLink: https://bugs.launchpad.net/bugs/2060097

[ Upstream commit 689a930b93c5c20294df5da0407df361c5412eac ]

KUNIT_FAIL() is used to fail the xe_migrate test when an error occurs.
However, there's a mismatch in the format specifier: '%li' is used to
log 'err', which is an 'int'.

Use '%i' instead of '%li', and for the case where we're printing an
error pointer, just use '%pe', instead of extracting the error code
manually with PTR_ERR(). (This also results in a nicer output when the
error code is known.)

Fixes: dd08ebf6c3 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Signed-off-by: David Gow <davidgow@google.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Acked-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 3ffee550ef3a5d34db6ae37e640e3488ffe84341)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
This commit is contained in:
David Gow
2024-02-21 17:27:21 +08:00
committed by Roxana Nicolescu
parent 431326b867
commit 7cb2a289ba
+4 -4
View File
@@ -114,21 +114,21 @@ static void test_copy(struct xe_migrate *m, struct xe_bo *bo,
region |
XE_BO_NEEDS_CPU_ACCESS);
if (IS_ERR(remote)) {
KUNIT_FAIL(test, "Failed to allocate remote bo for %s: %li\n",
str, PTR_ERR(remote));
KUNIT_FAIL(test, "Failed to allocate remote bo for %s: %pe\n",
str, remote);
return;
}
err = xe_bo_validate(remote, NULL, false);
if (err) {
KUNIT_FAIL(test, "Failed to validate system bo for %s: %li\n",
KUNIT_FAIL(test, "Failed to validate system bo for %s: %i\n",
str, err);
goto out_unlock;
}
err = xe_bo_vmap(remote);
if (err) {
KUNIT_FAIL(test, "Failed to vmap system bo for %s: %li\n",
KUNIT_FAIL(test, "Failed to vmap system bo for %s: %i\n",
str, err);
goto out_unlock;
}