Skip to content

Commit 70cac50

Browse files
arndbjlahtine-intel
authored andcommitted
drm/i915: work around false-positive maybe-uninitialized warning
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 <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Signed-off-by: Chris Wilson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit cc649a9) Signed-off-by: Joonas Lahtinen <[email protected]>
1 parent 54a9adc commit 70cac50

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/gpu/drm/i915/gt/selftest_workarounds.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,8 @@ static int check_dirty_whitelist(struct intel_context *ce)
623623
err = -EINVAL;
624624
goto out_unpin;
625625
}
626+
} else {
627+
rsvd = 0;
626628
}
627629

628630
expect = results[0];

0 commit comments

Comments
 (0)