From: Jani Nikula Date: Sun, 11 Aug 2013 09:44:02 +0000 (+0300) Subject: drm/i915: drop unnecessary local variable to suppress build warning X-Git-Tag: firefly_0821_release~176^2~5263^2~28^2~51 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ea04cb31d506ac3f4fc3cefb1c50eb4f35ab37fd;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Jani Nikula Reviewed-by: Chris Wilson Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 06659a72d0cf..28d57477aa42 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -1905,8 +1905,6 @@ static void i915_hangcheck_elapsed(unsigned long data) } else busy = false; } else { - int score; - /* We always increment the hangcheck score * if the ring is busy and still processing * the same request, so that no single request @@ -1927,20 +1925,18 @@ static void i915_hangcheck_elapsed(unsigned long data) switch (ring->hangcheck.action) { case HANGCHECK_WAIT: - score = 0; break; case HANGCHECK_ACTIVE: - score = BUSY; + ring->hangcheck.score += BUSY; break; case HANGCHECK_KICK: - score = KICK; + ring->hangcheck.score += KICK; break; case HANGCHECK_HUNG: - score = HUNG; + ring->hangcheck.score += HUNG; stuck[i] = true; break; } - ring->hangcheck.score += score; } } else { /* Gradually reduce the count so that we catch DoS