From patchwork Tue Oct 13 15:12:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10054 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id AFE27BEEE1 for ; Tue, 13 Oct 2020 15:12:55 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 74AFB60F1E; Tue, 13 Oct 2020 17:12:55 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Iv1hY+KA"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3154D60DFD for ; Tue, 13 Oct 2020 17:12:49 +0200 (CEST) Received: from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C209ABA9; Tue, 13 Oct 2020 17:12:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1602601968; bh=/3amyfmBVl40XA4/zUIT/CuQHwQ9kzpA0dfssbxbI7w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Iv1hY+KAahrvaHodaPHE7p+czmUZR7GfZDQXPOwPyROekXJbSgHfHATp0dw05OTZb x+RvuYNmH9QG4N5jKaDF0K0rP+cBxQx8Xy0YqD2EOQXYcy2t9oos0DwuUGa/YDb8G5 wsQPkyrhIfyLr5Lo9CVQAH8j11bcoOldPYZw5Y9M= From: Kieran Bingham To: libcamera devel Date: Tue, 13 Oct 2020 16:12:39 +0100 Message-Id: <20201013151241.3557005-9-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201013151241.3557005-1-kieran.bingham@ideasonboard.com> References: <20201013151241.3557005-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 08/10] ipa: raspberrypi: Re-use iterator variable X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The function gauss_seidel2_SOR() makes use of a function scoped iterator 'i', for several loops, and has a precedence of re-using the function scoped iterator declaration, but then proceeds to alias the iterator with a new declaration in one of the later loops. Re-use the existing iterator variable for consistency, and to prevent variable aliasing. Signed-off-by: Kieran Bingham Reviewed-by: David Plowman --- src/ipa/raspberrypi/controller/rpi/alsc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipa/raspberrypi/controller/rpi/alsc.cpp b/src/ipa/raspberrypi/controller/rpi/alsc.cpp index 42fbc8a476ad..8447f8bec18b 100644 --- a/src/ipa/raspberrypi/controller/rpi/alsc.cpp +++ b/src/ipa/raspberrypi/controller/rpi/alsc.cpp @@ -628,7 +628,7 @@ static double gauss_seidel2_SOR(double const M[XY][4], double omega, lambda[i] = compute_lambda_bottom(i, M, lambda); lambda[0] = compute_lambda_bottom_start(0, M, lambda); double max_diff = 0; - for (int i = 0; i < XY; i++) { + for (i = 0; i < XY; i++) { lambda[i] = old_lambda[i] + (lambda[i] - old_lambda[i]) * omega; if (fabs(lambda[i] - old_lambda[i]) > fabs(max_diff)) max_diff = lambda[i] - old_lambda[i];