From patchwork Mon Aug 5 21:51:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 13754201 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DDDEDC3DA4A for ; Mon, 5 Aug 2024 21:52:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:To:From:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7loi66eWoM4pglv0+trIoRx+8rGoC+Ly/55TuGaEhSQ=; b=CLnsUPxxKkZSQD Lr+oBI2Av92VG7HA8aIEGPYEXql+H87OpsVzejdJVyxnUK/KymyNyAOsCHBNC8kxdkQyqjw9T2SPO 4kehsDct1oaDubGKoxcaFQZhz+nTEqtNRnrbHkbrpO8HSQJqk8m0Q5oZby9CX03kSds1veYpIjuB9 5+9x9Im7s1B3Wb5SzBdGeDQeRbctjbYeD0NyJtBANuLnH4Csjvh6/xOw6dlvg5oldKm9xLHmX8caT SneotEd1FH3KxTzM86Zpcqpj1QM1BQ4v6U92HMsCcBujQxvCRvcXuPneJgG3m5P9Er5eNq80aJ+Ke U6mUOBl+wGKWY18FQLpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sb5d3-0000000HOIS-3cZL; Mon, 05 Aug 2024 21:52:33 +0000 Received: from zeus03.de ([194.117.254.33] helo=mail.zeus03.de) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sb5c4-0000000HO62-0ZKj for linux-arm-kernel@lists.infradead.org; Mon, 05 Aug 2024 21:51:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= sang-engineering.com; h=from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; s=k1; bh=7loi66eWoM4pglv0+trIoRx+8rGoC+Ly/55TuGaEhSQ=; b=VsaEc5 W46msxU/DpeVVdyZcGKvIzaPRjQc2z2+g1hbevug0L0W8S1DRX06eh4J2MTNPmml 9hdhpI3j2KNR74ijArlBYUQ2ZAPrsjstzFc45MS0xU6Zf5AfMhMftZpfXbTiPXOO JiQ3JgJ++YOmTBzmaVYn8UM+oQQKw/NTqrIB5Y5K9TscE6WDgD7089yZuzAQCAeg h2tTkco086vicAb5WI3rlTQDpIMyj3tgzojydU3Qkb/sLdtnB3QWe9LPIy4x/TZH qb9Bqoos78f3F5n8V5iDD7daRm4thzO0uwXltKJMGTGQM1yiVdeqSAqezzEoffqL xlAfwk9LPj4j7wYg== Received: (qmail 18128 invoked from network); 5 Aug 2024 23:51:27 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 5 Aug 2024 23:51:27 +0200 X-UD-Smtp-Session: l3s3148p1@qPPNrfYe8pRehhYC From: Wolfram Sang To: linux-media@vger.kernel.org Subject: [PATCH v2 2/8] media: atmel-isi: use 'time_left' variable with wait_for_completion_timeout() Date: Mon, 5 Aug 2024 23:51:15 +0200 Message-ID: <20240805215123.3528-3-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240805215123.3528-1-wsa+renesas@sang-engineering.com> References: <20240805215123.3528-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240805_145132_809347_DBBB4B98 X-CRM114-Status: GOOD ( 15.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Eugen Hristev , Claudiu Beznea , Wolfram Sang , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() causing patterns like: timeout = wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining. Signed-off-by: Wolfram Sang --- drivers/media/platform/atmel/atmel-isi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c index c1108df72dd5..5c823d3f9cc0 100644 --- a/drivers/media/platform/atmel/atmel-isi.c +++ b/drivers/media/platform/atmel/atmel-isi.c @@ -242,7 +242,7 @@ static irqreturn_t isi_interrupt(int irq, void *dev_id) #define WAIT_ISI_DISABLE 0 static int atmel_isi_wait_status(struct atmel_isi *isi, int wait_reset) { - unsigned long timeout; + unsigned long time_left; /* * The reset or disable will only succeed if we have a * pixel clock from the camera. @@ -257,9 +257,9 @@ static int atmel_isi_wait_status(struct atmel_isi *isi, int wait_reset) isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS); } - timeout = wait_for_completion_timeout(&isi->complete, - msecs_to_jiffies(500)); - if (timeout == 0) + time_left = wait_for_completion_timeout(&isi->complete, + msecs_to_jiffies(500)); + if (time_left == 0) return -ETIMEDOUT; return 0;