Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp843031lqj; Mon, 3 Jun 2024 02:30:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXnD3ae7Pb/KrRyZjkfS/lnHtUoJ4awFuMv1hxRB5QZb7pzhHqe+p9heSodXsbuMo0QlTQo5xV8yQGXBO4eAWG9K6ejNFcieITxjf0k8Q== X-Google-Smtp-Source: AGHT+IHEsg6PFHkFBxEmHhSvQjw0hvL0cilitIqMdwPjXp7Okr+uVSWxh6MhGpo047AeigmDfQnq X-Received: by 2002:a05:6a00:3cc2:b0:6f8:ec5b:69ea with SMTP id d2e1a72fcca58-702478043e7mr12690613b3a.15.1717407038503; Mon, 03 Jun 2024 02:30:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717407038; cv=pass; d=google.com; s=arc-20160816; b=WjOvsQR8djIYEemXujfi6B+gXmQLwgTp/T4tbfNEsil1SHlVNiZG66C98pLdCMORto /hrRppLbePyyn3es2bbO4/GtcWCg/qTWKgKxgk0Ndnc406sRZuIlDSAltC9dM+S/lKvW t/usqitgb401Ko2MsWNK9Yf3bGy1CMm4PM1s02ZU68fJB2jivn8fYlVEWJoqwmVWKTDp 2XRSSO//e9OGY3QVE6ZD2eYkQ6VAQQ7z/hZacduws5hC/Prtj9m/GmQifx1pG7KGmv21 RA0SRS4d6SYDom5M+8N8iQVRmM5tTju4P5/ikBe6avpkqe/nBCQaWGEYTCWe+hvxzxkt 2TSQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ytP13Gl64JFAwriGV8x2mCJjir2yJaQn5QnGdupCrjA=; fh=FOikBL1V3RnFQJI9jQ29I/lBdpzpYMc00t6QvNIv7UA=; b=g1XoLLq9R4kwrHiqnpvUVEkQCyo5msbJxdJjm/Gp40b7dgpswXFKbJGH6ZF/6IW6Zp dFn0BI2VTFJhg8JMKZJv7DBU/kXigXtbUyOR8WYGtJGSfDxt//vJ4BYdin8z2098vagt V4+u/Xxg91wRnB8BdhNnM/WyPvTETeu8n2LU36TM4J9l5ihvadi2O53muUcbMm3BWISm TReZSLkCQ+ruvBvw+/FB9Vaw1pIiyhNSYy8sd7FXzA92Q2rlorr+aQ4oK1hDTHTJk2BH l3DTBUYDZiKRe3xaaV8Iiqdr6N9wVrOcB2L0K+BXG43pmV5eXth+OKTmsJahlgNNTwH2 Sa2w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=MBAb4wq6; arc=pass (i=1 spf=pass spfdomain=sang-engineering.com dkim=pass dkdomain=sang-engineering.com); spf=pass (google.com: domain of linux-kernel+bounces-198874-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198874-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-70249988e63si5626146b3a.164.2024.06.03.02.30.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 02:30:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198874-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=MBAb4wq6; arc=pass (i=1 spf=pass spfdomain=sang-engineering.com dkim=pass dkdomain=sang-engineering.com); spf=pass (google.com: domain of linux-kernel+bounces-198874-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198874-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1E0F8283693 for ; Mon, 3 Jun 2024 09:30:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1CB0C84D15; Mon, 3 Jun 2024 09:28:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="MBAb4wq6" Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 873CF83CD4 for ; Mon, 3 Jun 2024 09:28:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.117.254.33 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717406937; cv=none; b=Wzi/OImff92FUoFoMQa0QKF8VaLQdwLSDqP1YJMpTwGFgY/yD7iLcl6ujl/2oZJnVwPqSKzPRHVd/qwchCyX+RbhMJog63C6Kkc2KqAZjYiO2wZranTa8LS9e32UBAZAH543SSACkOTrAgMUnx4UwNlpz9k8pv3qePUdt6p0RT8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717406937; c=relaxed/simple; bh=C/9KYYddj4qZHqa8y2yNasr0MNOy2tpH9zFMadog84M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZCgj5wSWlsAXcnBy31LUZKhElYpQvWfT7VnKhsMZPnrmPpY8Fxdkma9IHWFQyTVIL/kVD8CrSLoKxexx9lMJTE4n68v0oN0rd9UJG2lczueYiCIrjYNWNZON1Hfl5zPfnidInHaHHGVza/sQvlDBEAL4K4Vn03U0aD4SkIWK7KA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com; spf=pass smtp.mailfrom=sang-engineering.com; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b=MBAb4wq6; arc=none smtp.client-ip=194.117.254.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sang-engineering.com 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=ytP13Gl64JFAwriGV8x2mCJjir2yJaQn5QnGdupCrjA=; b=MBAb4w q69zxA+YcZZEOrgzDEnFtr6xBSFn364fpPZ6+qK6Y/su7ZXQFcmRwJIFNww3OzwF RAUa94ILtECzH37bOtAQu37FdSUImWbUcfU7p0BjjFiEQq0Ab8ab1IpBH8AEFvP8 kVcz6xUCj4+/40Q2q8Sh/1aBUtDtTB1Ki0Z+uuwlUMHO3n+g99NRrbjOW4a0CDh3 deVPj18S4Ym2IlHtrHdJDEMLBmmTpJdvFHDcSOMa5TzJKe+qewd7KQInb0LH6s1m fN8aC4iwhdUo/khS/xSVkI/0k2K6i1OFAb791YJDTqRMBQ+uDzMbVziamd0m7wZI c9L5H/3ullyFP1Wg== Received: (qmail 1903270 invoked from network); 3 Jun 2024 11:28:51 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 3 Jun 2024 11:28:51 +0200 X-UD-Smtp-Session: l3s3148p1@HZUS9vgZPNcgAwDPXzLGAH1eNELjOc3g From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Bluecherry Maintainers , Anton Sviridenko , Andrey Utkin , Ismael Luceno , Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: [PATCH 6/8] media: solo6x10: use 'time_left' variable with wait_for_completion_timeout() Date: Mon, 3 Jun 2024 11:28:37 +0200 Message-ID: <20240603092841.9500-7-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240603092841.9500-1-wsa+renesas@sang-engineering.com> References: <20240603092841.9500-1-wsa+renesas@sang-engineering.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Fix to the proper variable type 'unsigned long' while here. Signed-off-by: Wolfram Sang --- drivers/media/pci/solo6x10/solo6x10-p2m.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/pci/solo6x10/solo6x10-p2m.c b/drivers/media/pci/solo6x10/solo6x10-p2m.c index ca70a864a3ef..5f100e5e03d9 100644 --- a/drivers/media/pci/solo6x10/solo6x10-p2m.c +++ b/drivers/media/pci/solo6x10/solo6x10-p2m.c @@ -57,7 +57,7 @@ int solo_p2m_dma_desc(struct solo_dev *solo_dev, int desc_cnt) { struct solo_p2m_dev *p2m_dev; - unsigned int timeout; + unsigned long time_left; unsigned int config = 0; int ret = 0; unsigned int p2m_id = 0; @@ -99,12 +99,12 @@ int solo_p2m_dma_desc(struct solo_dev *solo_dev, desc[1].ctrl); } - timeout = wait_for_completion_timeout(&p2m_dev->completion, - solo_dev->p2m_jiffies); + time_left = wait_for_completion_timeout(&p2m_dev->completion, + solo_dev->p2m_jiffies); if (WARN_ON_ONCE(p2m_dev->error)) ret = -EIO; - else if (timeout == 0) { + else if (time_left == 0) { solo_dev->p2m_timeouts++; ret = -EAGAIN; } -- 2.43.0