Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3343929pxv; Sun, 4 Jul 2021 16:06:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWZ0gX5P5iJ2V5aI22SfDxCXAIXbLzUyf4mHrISQV5/eNmkxYwO6V1WvVMZjJks6tP/lZF X-Received: by 2002:a05:6638:3594:: with SMTP id v20mr9538496jal.25.1625439983518; Sun, 04 Jul 2021 16:06:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625439983; cv=none; d=google.com; s=arc-20160816; b=D7MJ/k2BT+u55JDtZCEtQ3KUEnXbFRTxlCukK1ImQfflmcCf6XPK95lUfqazmIJ3S2 WmDHaf6AbNrjSc6+BhBO0hsaGYvcb7ihbXuyUpfUHSJ767wuXxCtecf5kPX+dT954oSj 6DE1o448IFm8QS6If07HvEe6R6mtGdLBtZub+c8bQhMmTQlNeShfBy+iw3XNvuCHQF21 qJ7YY/EoWxPGgiJWREpNfGrOVIwef2ClmXoRUENK5tHUFTvlmGvkQgu0nOzMVaDp9oLt IN4CGfBQhMdWzc2NOqvzn6u/LY+xS4DZSJkBRFOqei4mEjoAw0gUHgfE9ugtRjTGVV6B Q9qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZcnhEZC4UIYoqA+UhlkIB3AVUZs+Ig4CDKWqjhZSRJg=; b=F9hbxvMAnW14RlM7FjrAEP8sQexwpP2UqfqFaCT+YgvrJvZVifq4LWRahpUaICskid zKerWF2oosjAzCRp7m50lUfyaNoX8bEhWoyhAROC0INODONUBNGk8Rsb6mR+zCeYNQvT 1+RIXyfhaR7rbB9r2xCjB+bXO+nRohF07w/IK/pOxe1l6O70kt/q37LIHXoQTOxr+5GT v+/Y6pRenrz0FvacRRogCVo94DFicuB1Vo2tal53X4fcTy6BZLHlg7edf5R2bf55tmf5 KaKztIGSygyQj3YYYLrHb6KNnHkHYXuBjTRVYIqLBL4190fSPQRLFrphxcFeIc/FW/rt c5WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XQaysxXX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si12018795jal.25.2021.07.04.16.06.12; Sun, 04 Jul 2021 16:06:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XQaysxXX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230498AbhGDXIB (ORCPT + 99 others); Sun, 4 Jul 2021 19:08:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:46062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230261AbhGDXHi (ORCPT ); Sun, 4 Jul 2021 19:07:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D89CF6192B; Sun, 4 Jul 2021 23:05:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625439902; bh=ycmPIHPt6luVzIP71dxQy1C3huelF0s4SRfcO/QPdpc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XQaysxXXWXM7Fjz+ejvFtHZCgbXfUZ/P7yXKIqokwcb80lLcICtRrrQs+W45/yn6i DBf3gQklBdz4F8DyW5uRP/ZfHqaoNkB45MDE38Wso8qV4F+Ib3DsZvmimB+M+bst4m TVHOh2BzSHnHT/zoZK3Af71u6WORijnn7Pt5WPegRWE2SbkjLFsU/zNxSybenKIRe4 EeU+1rl3Rp35s3kSFYZ/v1LlBJJ7Y0bKKq8/ISMwxHlF/uoJyYrHoY4CN7BJ3tpQtg CUDSgjx4wJUWKrWwpCN2lXxl9srJR/G/TQkQSGfG4ESEYi24XwG38ryjacQR6gPcFH o/RspUMCKnhlA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Laurent Pinchart , Rui Miguel Silva , Frieder Schrempf , Mauro Carvalho Chehab , Sasha Levin , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.13 30/85] media: imx: imx7_mipi_csis: Fix logging of only error event counters Date: Sun, 4 Jul 2021 19:03:25 -0400 Message-Id: <20210704230420.1488358-30-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210704230420.1488358-1-sashal@kernel.org> References: <20210704230420.1488358-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Laurent Pinchart [ Upstream commit d2fcc9c2de1191ea80366e3658711753738dd10a ] The mipi_csis_events array ends with 6 non-error events, not 4. Update mipi_csis_log_counters() accordingly. While at it, log event counters in forward order, as there's no reason to log them backward. Signed-off-by: Laurent Pinchart Acked-by: Rui Miguel Silva Reviewed-by: Frieder Schrempf Tested-by: Frieder Schrempf Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/staging/media/imx/imx7-mipi-csis.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c index 025fdc488bd6..25d0f89b2e53 100644 --- a/drivers/staging/media/imx/imx7-mipi-csis.c +++ b/drivers/staging/media/imx/imx7-mipi-csis.c @@ -666,13 +666,15 @@ static void mipi_csis_clear_counters(struct csi_state *state) static void mipi_csis_log_counters(struct csi_state *state, bool non_errors) { - int i = non_errors ? MIPI_CSIS_NUM_EVENTS : MIPI_CSIS_NUM_EVENTS - 4; + unsigned int num_events = non_errors ? MIPI_CSIS_NUM_EVENTS + : MIPI_CSIS_NUM_EVENTS - 6; struct device *dev = &state->pdev->dev; unsigned long flags; + unsigned int i; spin_lock_irqsave(&state->slock, flags); - for (i--; i >= 0; i--) { + for (i = 0; i < num_events; ++i) { if (state->events[i].counter > 0 || state->debug) dev_info(dev, "%s events: %d\n", state->events[i].name, state->events[i].counter); -- 2.30.2