Skip to content

Commit

Permalink
drm/i915/selftests: Silence the compiler for impossible errors
Browse files Browse the repository at this point in the history
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: [email protected]
Signed-off-by: Chris Wilson <[email protected]>
Cc: Matthew Auld <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Matthew Auld <[email protected]>
  • Loading branch information
ickle committed Oct 17, 2017
1 parent a6d65e4 commit 134649f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/i915/selftests/huge_pages.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 --
Expand Down

0 comments on commit 134649f

Please sign in to comment.