From patchwork Wed Nov 28 19:09:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 1818031 Return-Path: X-Original-To: patchwork-linux-media@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 845A43FC54 for ; Wed, 28 Nov 2012 19:10:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932224Ab2K1TJ6 (ORCPT ); Wed, 28 Nov 2012 14:09:58 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:44088 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932209Ab2K1TJ6 (ORCPT ); Wed, 28 Nov 2012 14:09:58 -0500 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0ME700LI6P8E8G40@mailout3.samsung.com> for linux-media@vger.kernel.org; Thu, 29 Nov 2012 04:09:57 +0900 (KST) X-AuditID: cbfee61a-b7fa66d0000004cf-7d-50b661845f55 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 6A.63.01231.48166B05; Thu, 29 Nov 2012 04:09:57 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0ME7006TUP7TOU90@mmp2.samsung.com> for linux-media@vger.kernel.org; Thu, 29 Nov 2012 04:09:56 +0900 (KST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: sw0312.kim@samsung.com, kyungmin.park@samsung.com, a.hajda@samsung.com, Sylwester Nawrocki Subject: [PATCH RFC 08/12] s5p-csis: Correct the event counters logging Date: Wed, 28 Nov 2012 20:09:25 +0100 Message-id: <1354129766-2821-9-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1354129766-2821-1-git-send-email-s.nawrocki@samsung.com> References: <1354129766-2821-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPJMWRmVeSWpSXmKPExsVy+t9jQd3WxG0BBm+XsVr0bNjK6sDo8XmT XABjFJdNSmpOZllqkb5dAldG66HdrAXXOSquzt7G2sA4i72LkZNDQsBEYt3LZcwQtpjEhXvr 2UBsIYHpjBJzfkdD2CuYJJ51sIDYbAKGEr1H+xhBbBEBeYknvTfA6pkFKiVOzp/NBGILC7hL nN93FyzOIqAq0fVkAlg9r4CrxIwNb4F2cQDtUpCYM8kGJMwp4CZx/sYDRohVrhKfrzQxTWDk XcDIsIpRNLUguaA4KT3XUK84Mbe4NC9dLzk/dxMj2NvPpHYwrmywOMQowMGoxMO7yXJbgBBr YllxZe4hRgkOZiUR3ltBQCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8zR4pAUIC6YklqdmpqQWp RTBZJg5OqQZGNe+OEy3rZM7aSG1qr3Hinf7x15l9dg+N58ttdW+T6f3Fe+/N7ufOJ7O/JM2d frRUe5/7XwkP5b/sBQtm3fwlu8f96YHrctX3nwpkKLV8OnF50UShJVFf/O6d+zFPPsLSxvoY 24kQxyutddYpEpdWPmLcPfFW46JPuRz2U0trzmRyOkXLLJ/Vo8RSnJFoqMVcVJwIALj5sU/y AQAA Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The counter field is unsigned so >= 0 condition always evaluates to true. Fix this to log events for which counter is > 0 or for all when in debug mode. Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park --- drivers/media/platform/s5p-fimc/mipi-csis.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/s5p-fimc/mipi-csis.c b/drivers/media/platform/s5p-fimc/mipi-csis.c index e979b6e..8ec7c3b 100644 --- a/drivers/media/platform/s5p-fimc/mipi-csis.c +++ b/drivers/media/platform/s5p-fimc/mipi-csis.c @@ -415,12 +415,12 @@ static void s5pcsis_log_counters(struct csis_state *state, bool non_errors) spin_lock_irqsave(&state->slock, flags); - for (i--; i >= 0; i--) - if (state->events[i].counter >= 0) + for (i--; i >= 0; i--) { + if (state->events[i].counter > 0 || debug) v4l2_info(&state->sd, "%s events: %d\n", state->events[i].name, state->events[i].counter); - + } spin_unlock_irqrestore(&state->slock, flags); }