]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/selftests: fix uninitialized variable sum when summing up values
authorColin Ian King <colin.king@canonical.com>
Tue, 10 Dec 2019 14:32:05 +0000 (14:32 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 10 Dec 2019 14:35:24 +0000 (14:35 +0000)
commit628b7404e94b3b55afc1a251d1f225ab489b3a86
tree1c52fe04ae2384a5f354f522b6cff58394cb39dd
parentd6f83f7ad830aa43688fde5f6a53fd1ff3f1d9e0
drm/i915/selftests: fix uninitialized variable sum when summing up values

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: 05c630a42be8 ("drm/i915/selftests: Perform some basic cycle counting of MI ops")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20191210143205.338308-1-colin.king@canonical.com
drivers/gpu/drm/i915/gt/selftest_engine_cs.c