Skip to content

Commit 689a930

Browse files
sulixshuahkh
authored andcommitted
drm/xe/tests: Fix printf format specifiers in xe_migrate test
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: dd08ebf ("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>
1 parent ff3b96f commit 689a930

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/gpu/drm/xe/tests/xe_migrate.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,21 +114,21 @@ static void test_copy(struct xe_migrate *m, struct xe_bo *bo,
114114
region |
115115
XE_BO_NEEDS_CPU_ACCESS);
116116
if (IS_ERR(remote)) {
117-
KUNIT_FAIL(test, "Failed to allocate remote bo for %s: %li\n",
118-
str, PTR_ERR(remote));
117+
KUNIT_FAIL(test, "Failed to allocate remote bo for %s: %pe\n",
118+
str, remote);
119119
return;
120120
}
121121

122122
err = xe_bo_validate(remote, NULL, false);
123123
if (err) {
124-
KUNIT_FAIL(test, "Failed to validate system bo for %s: %li\n",
124+
KUNIT_FAIL(test, "Failed to validate system bo for %s: %i\n",
125125
str, err);
126126
goto out_unlock;
127127
}
128128

129129
err = xe_bo_vmap(remote);
130130
if (err) {
131-
KUNIT_FAIL(test, "Failed to vmap system bo for %s: %li\n",
131+
KUNIT_FAIL(test, "Failed to vmap system bo for %s: %i\n",
132132
str, err);
133133
goto out_unlock;
134134
}

0 commit comments

Comments
 (0)