Commit fb43ebc8 authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Jani Nikula

drm/i915/selftest: Fix use of err in igt_reset_{fail, nop}_engine()

Clang warns:

In file included from drivers/gpu/drm/i915/gt/intel_reset.c:1514:
drivers/gpu/drm/i915/gt/selftest_hangcheck.c:465:62: warning: variable
'err' is uninitialized when used here [-Wuninitialized]
        pr_err("[%s] Create context failed: %d!\n", engine->name, err);
                                                                  ^~~
...
drivers/gpu/drm/i915/gt/selftest_hangcheck.c:580:62: warning: variable
'err' is uninitialized when used here [-Wuninitialized]
        pr_err("[%s] Create context failed: %d!\n", engine->name, err);
                                                                  ^~~
...
2 warnings generated.

This appears to be a copy and paste issue. Use ce directly using the %pe
specifier to pretty print the error code so that err is not used
uninitialized in these functions.

Fixes: 3a7b7266 ("drm/i915/selftest: Bump selftest timeouts for hangcheck")
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210813171158.2665823-1-nathan@kernel.org
(cherry picked from commit ac5a2dff)
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 2c772cf5
...@@ -462,7 +462,7 @@ static int igt_reset_nop_engine(void *arg) ...@@ -462,7 +462,7 @@ static int igt_reset_nop_engine(void *arg)
ce = intel_context_create(engine); ce = intel_context_create(engine);
if (IS_ERR(ce)) { if (IS_ERR(ce)) {
pr_err("[%s] Create context failed: %d!\n", engine->name, err); pr_err("[%s] Create context failed: %pe!\n", engine->name, ce);
return PTR_ERR(ce); return PTR_ERR(ce);
} }
...@@ -577,7 +577,7 @@ static int igt_reset_fail_engine(void *arg) ...@@ -577,7 +577,7 @@ static int igt_reset_fail_engine(void *arg)
ce = intel_context_create(engine); ce = intel_context_create(engine);
if (IS_ERR(ce)) { if (IS_ERR(ce)) {
pr_err("[%s] Create context failed: %d!\n", engine->name, err); pr_err("[%s] Create context failed: %pe!\n", engine->name, ce);
return PTR_ERR(ce); return PTR_ERR(ce);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment