Skip to content

Commit ea04cb3

Browse files
jnikuladanvet
authored andcommitted
drm/i915: drop unnecessary local variable to suppress build warning
Although I could not reproduce this (different compiler version, perhaps), reportedly we get: drivers/gpu/drm/i915/i915_irq.c:1943:27: warning: ‘score’ may be used uninitialized in this function [-Wuninitialized] Drop the 'score' variable altogether as it's not really needed. Reported-by: Kees Cook <keescook@chromium.org> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1 parent f2f4d82 commit ea04cb3

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

‎drivers/gpu/drm/i915/i915_irq.c‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1905,8 +1905,6 @@ static void i915_hangcheck_elapsed(unsigned long data)
19051905
} else
19061906
busy = false;
19071907
} else {
1908-
int score;
1909-
19101908
/* We always increment the hangcheck score
19111909
* if the ring is busy and still processing
19121910
* the same request, so that no single request
@@ -1927,20 +1925,18 @@ static void i915_hangcheck_elapsed(unsigned long data)
19271925

19281926
switch (ring->hangcheck.action) {
19291927
case HANGCHECK_WAIT:
1930-
score = 0;
19311928
break;
19321929
case HANGCHECK_ACTIVE:
1933-
score = BUSY;
1930+
ring->hangcheck.score += BUSY;
19341931
break;
19351932
case HANGCHECK_KICK:
1936-
score = KICK;
1933+
ring->hangcheck.score += KICK;
19371934
break;
19381935
case HANGCHECK_HUNG:
1939-
score = HUNG;
1936+
ring->hangcheck.score += HUNG;
19401937
stuck[i] = true;
19411938
break;
19421939
}
1943-
ring->hangcheck.score += score;
19441940
}
19451941
} else {
19461942
/* Gradually reduce the count so that we catch DoS

0 commit comments

Comments
 (0)