From patchwork Mon Aug 5 21:51:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 13754203 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 891ECC3DA7F for ; Mon, 5 Aug 2024 21:53: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: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:Cc: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=J0bLTIuU/Mhn2qog1wsVS/0//rPwKleWaM2YFI6mOes=; b=YHVKBV0sA3rwIfiau+jYG0cFvP OLuqfy7NfkJ9sYHtQuanTwHt/SzfBQJ8ZEfBryHM8pysWjAyr/R+h+in6kEywjd2lEw1+0LKyyczh 5b9cSPrMdBUWZfhzPLPI5z1V2hk8bHH3L+oc13R4Unzr9C51Pt0Ohu2fW159HcBt1b0+40M/yx0Fi dLqrNvVXdswsPEdgkovRsko7oT9xG1+5Xc5Nwt5oBfjJy34Az79Rod7CTf+Q54SflTw1fl+2EcrWb 7vzocjlAEuO0p9wYv/JRUSRsdXyAI/cvTx1ePumbrqWUxvJEzQ8AsC7MnPmKfqpDlBsFGfAHM3VaR 6FTAAqVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sb5e1-0000000HOTm-39nl; Mon, 05 Aug 2024 21:53: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 1sb5c9-0000000HO7J-2DbA for linux-arm-kernel@lists.infradead.org; Mon, 05 Aug 2024 21:51:39 +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=J0bLTIuU/Mhn2qog1wsVS/0//rPwKleWaM2YFI6mOes=; b=HSd7pA 21WJKhwN3nsHQY+m2evdIQLwd5ET7r3A6BP1WXuVV1/L/z0cvx9QPmSVZ6mDl71d P3fi58TbaBg8+VfpV07pZaubTrpmGOl/lBUsudv850u28/fTLnqmp3PhSQNORaUN gNh9C7dZhzL/8TLTPIDyK67RY5BuFvf6pYWJGOjd/2ixABzlo9gr2E0zR0GU+PUx 61kq529SB3SREb56IXd5uFCCi6tfj3JddibXjtcjemt0Ekr+I1Fbxxlu7Qzyc4L+ uSXiUuW6xezYw25NbiRD9McaCHEzuWfJF5bnQr0ncuRkP+sS2Y4bkUxhwRjPc4HT lyH0die1o2nUOU2A== Received: (qmail 18215 invoked from network); 5 Aug 2024 23:51:30 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 5 Aug 2024 23:51:30 +0200 X-UD-Smtp-Session: l3s3148p1@oJr5rfYe8JpehhYC From: Wolfram Sang To: linux-media@vger.kernel.org Cc: Wolfram Sang , Mauro Carvalho Chehab , Krzysztof Kozlowski , Alim Akhtar , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 5/8] media: platform: exynos-gsc: use 'time_left' variable with wait_event_timeout() Date: Mon, 5 Aug 2024 23:51:18 +0200 Message-ID: <20240805215123.3528-6-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_145137_863801_2670409A X-CRM114-Status: GOOD ( 13.90 ) 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: , 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_event_timeout() causing patterns like: timeout = wait_event_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining. Fix to the proper variable type 'long' while here. Signed-off-by: Wolfram Sang --- drivers/media/platform/samsung/exynos-gsc/gsc-core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/samsung/exynos-gsc/gsc-core.c b/drivers/media/platform/samsung/exynos-gsc/gsc-core.c index 618ae55fe396..f45f5c8612a6 100644 --- a/drivers/media/platform/samsung/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/samsung/exynos-gsc/gsc-core.c @@ -1225,7 +1225,7 @@ static void gsc_remove(struct platform_device *pdev) static int gsc_m2m_suspend(struct gsc_dev *gsc) { unsigned long flags; - int timeout; + long time_left; spin_lock_irqsave(&gsc->slock, flags); if (!gsc_m2m_pending(gsc)) { @@ -1236,12 +1236,12 @@ static int gsc_m2m_suspend(struct gsc_dev *gsc) set_bit(ST_M2M_SUSPENDING, &gsc->state); spin_unlock_irqrestore(&gsc->slock, flags); - timeout = wait_event_timeout(gsc->irq_queue, - test_bit(ST_M2M_SUSPENDED, &gsc->state), - GSC_SHUTDOWN_TIMEOUT); + time_left = wait_event_timeout(gsc->irq_queue, + test_bit(ST_M2M_SUSPENDED, &gsc->state), + GSC_SHUTDOWN_TIMEOUT); clear_bit(ST_M2M_SUSPENDING, &gsc->state); - return timeout == 0 ? -EAGAIN : 0; + return time_left == 0 ? -EAGAIN : 0; } static void gsc_m2m_resume(struct gsc_dev *gsc)