| From 946ff50b24654a2a633cb5566248a7f0620d6924 Mon Sep 17 00:00:00 2001 |
| From: Jani Nikula <jani.nikula@intel.com> |
| Date: Sun, 11 Aug 2013 12:44:02 +0300 |
| Subject: drm/i915: drop unnecessary local variable to suppress build warning |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| 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> |
| (cherry picked from commit ea04cb31d506ac3f4fc3cefb1c50eb4f35ab37fd) |
| Signed-off-by: Darren Hart <dvhart@linux.intel.com> |
| --- |
| drivers/gpu/drm/i915/i915_irq.c | 10 +++------- |
| 1 file changed, 3 insertions(+), 7 deletions(-) |
| |
| diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c |
| index 096d50142c11..36cf7073690e 100644 |
| --- a/drivers/gpu/drm/i915/i915_irq.c |
| +++ b/drivers/gpu/drm/i915/i915_irq.c |
| @@ -1951,8 +1951,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 |
| @@ -1973,20 +1971,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 |
| -- |
| 1.8.5.rc3 |
| |