drm/i915/selftests: fix uninitialized variable sum when summing up values
Subsystems (3)
PATCH 1/1 drm/i915/selftests: fix uninitialized variable sum when summing up values
From: Colin Ian King <[email protected]>
Currently the variable sum is not uninitialized and hence will cause an incorrect result in the summation values. Fix this by initializing sum to the first item in the summation.
Addresses-Coverity: ("Uninitialized scalar variable")
--- drivers/gpu/drm/i915/gt/selftest_engine_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/gt/selftest_engine_cs.c +1 -1
@@ -108,7 +108,7 @@ static u32 trifilter(u32 *a)sort (a,COUNT ,sizeof (*a), cmp_u32,NULL ); - sum +=mul_u32_u32 (a[2 ],2 ); + sum =mul_u32_u32 (a[2 ],2 ); sum += a[1 ]; sum += a[3 ];
Signature · 1 line
2.24.0
Quoting Colin King (2019-12-10 14:32:05)
Quoted 18 lines
From: Colin Ian King <[email protected]>
Currently the variable sum is not uninitialized and hence will cause an incorrect result in the summation values. Fix this by initializing sum to the first item in the summation.
Addresses-Coverity: ("Uninitialized scalar variable")
Fixes 3c7a44bbbfa7 ("drm/i915/selftests: Perform some basic cycle counting of MI ops")Signed-off-by Colin Ian King <[email protected]>--- drivers/gpu/drm/i915/gt/selftest_engine_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/i915/gt/selftest_engine_cs.c +0
-0
drivers/gpu/drm/i915/gt/selftest_engine_cs.c static u32 trifilter(u32 *a) · line 111
Quoted 5 lines
drivers/gpu/drm/i915/gt/selftest_engine_cs.c +1
-1@@ -108,7 +108,7 @@ static u32 trifilter(u32 *a)sort (a,COUNT ,sizeof (*a), cmp_u32,NULL ); - sum +=mul_u32_u32 (a[2 ],2 ); + sum =mul_u32_u32 (a[2 ],2 );
/o\
-Chris
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/selftests: fix uninitialized variable sum when summing up values
In reply to Colin King== Series Details ==
== Series Details ==
Series: drm/i915/selftests: fix uninitialized variable sum when summing up values
URL : https://patchwork.freedesktop.org/series/70689/
State : failure
== Summary ==
Applying: drm/i915/selftests: fix uninitialized variable sum when summing up values Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/gt/selftest_engine_cs.c
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx