Skip to content

Commit

Permalink
drm/i915: work around false-positive maybe-uninitialized warning
Browse files Browse the repository at this point in the history
gcc-9 gets confused by the code flow in check_dirty_whitelist:

drivers/gpu/drm/i915/gt/selftest_workarounds.c: In function 'check_dirty_whitelist':
drivers/gpu/drm/i915/gt/selftest_workarounds.c:492:17: error: 'rsvd' may be used uninitialized in this function [-Werror=maybe-uninitialized]

I could not figure out a good way to do this in a way that gcc
understands better, so initialize the variable to zero, as last
resort.

Fixes: aee20aa ("drm/i915: Implement read-only support in whitelist selftest")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
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/20200527140526.1458215-2-arnd@arndb.de
  • Loading branch information
Arnd Bergmann authored and Chris Wilson committed May 27, 2020
1 parent 6ec81b8 commit cc649a9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/i915/gt/selftest_workarounds.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,8 @@ static int check_dirty_whitelist(struct intel_context *ce)
err = -EINVAL;
goto out_unpin;
}
} else {
rsvd = 0;
}

expect = results[0];
Expand Down

0 comments on commit cc649a9

Please sign in to comment.