From patchwork Wed Oct 24 09:29:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1636731 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 532E54020F for ; Wed, 24 Oct 2012 09:30:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934546Ab2JXJ35 (ORCPT ); Wed, 24 Oct 2012 05:29:57 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:35487 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934488Ab2JXJ3x (ORCPT ); Wed, 24 Oct 2012 05:29:53 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id q9O9Tr5x012512; Wed, 24 Oct 2012 04:29:53 -0500 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q9O9TrBs019014; Wed, 24 Oct 2012 04:29:53 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Wed, 24 Oct 2012 04:29:52 -0500 Received: from deskari.tieu.ti.com (h64-3.vpn.ti.com [172.24.64.3]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id q9O9TOBS028560; Wed, 24 Oct 2012 04:29:51 -0500 From: Tomi Valkeinen To: , , CC: Tomi Valkeinen Subject: [PATCH 18/20] OMAPDSS: DISPC: fix loop in error handler Date: Wed, 24 Oct 2012 12:29:09 +0300 Message-ID: <1351070951-18616-19-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1351070951-18616-1-git-send-email-tomi.valkeinen@ti.com> References: <1351070951-18616-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org The dispc's error handler has a loop inside another loop, and both use the same loop variable. This is clearly wrong, and this patch makes a new variable for the inner loop. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dispc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index d294873..070ce30 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c @@ -3901,6 +3901,7 @@ static void dispc_error_worker(struct work_struct *work) bit = mgr_desc[i].sync_lost_irq; if (bit & errors) { + int j; struct omap_dss_device *dssdev = mgr->get_device(mgr); bool enable; @@ -3911,9 +3912,9 @@ static void dispc_error_worker(struct work_struct *work) enable = dssdev->state == OMAP_DSS_DISPLAY_ACTIVE; dssdev->driver->disable(dssdev); - for (i = 0; i < omap_dss_get_num_overlays(); ++i) { + for (j = 0; j < omap_dss_get_num_overlays(); ++j) { struct omap_overlay *ovl; - ovl = omap_dss_get_overlay(i); + ovl = omap_dss_get_overlay(j); if (ovl->id != OMAP_DSS_GFX && ovl->manager == mgr)