summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/selftests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-10-17 11:37:23 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2017-10-17 14:07:47 +0100
commit134649ff3545f3b7b862c589e9accb400ace2474 (patch)
tree90e90207d8b4b93dffddc3e49dfed00dfdac649d /drivers/gpu/drm/i915/selftests
parenta6d65e451cc4e7127698384868a4447ee7be7d16 (diff)
downloadop-kernel-dev-134649ff3545f3b7b862c589e9accb400ace2474.zip
op-kernel-dev-134649ff3545f3b7b862c589e9accb400ace2474.tar.gz
drm/i915/selftests: Silence the compiler for impossible errors
It should be impossible for these tests not to run due to an empty ppgtt, but if it should happen, let's report ENODEV (our typical internal error for impossible events). In file included from drivers/gpu/drm/i915/i915_gem.c:5415: drivers/gpu/drm/i915/selftests/huge_pages.c: In function 'igt_mock_ppgtt_huge_fill': >> drivers/gpu/drm/i915/selftests/huge_pages.c:612: error: 'err' may be used uninitialized in this function drivers/gpu/drm/i915/selftests/huge_pages.c: In function 'igt_ppgtt_exhaust_huge': drivers/gpu/drm/i915/selftests/huge_pages.c:1159: error: 'err' may be used uninitialized in this function Reported-by: kbuild-all@01.org Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Matthew Auld <matthew.auld@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20171017103723.6933-1-chris@chris-wilson.co.uk Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/selftests')
-rw-r--r--drivers/gpu/drm/i915/selftests/huge_pages.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/selftests/huge_pages.c b/drivers/gpu/drm/i915/selftests/huge_pages.c
index c53f847..5cc8101 100644
--- a/drivers/gpu/drm/i915/selftests/huge_pages.c
+++ b/drivers/gpu/drm/i915/selftests/huge_pages.c
@@ -609,7 +609,7 @@ static int igt_mock_ppgtt_huge_fill(void *arg)
bool single = false;
LIST_HEAD(objects);
IGT_TIMEOUT(end_time);
- int err;
+ int err = -ENODEV;
for_each_prime_number_from(page_num, 1, max_pages) {
struct drm_i915_gem_object *obj;
@@ -1157,7 +1157,7 @@ static int igt_ppgtt_exhaust_huge(void *arg)
unsigned int size_mask;
unsigned int page_mask;
int n, i;
- int err;
+ int err = -ENODEV;
/*
* Sanity check creating objects with a varying mix of page sizes --
OpenPOWER on IntegriCloud