Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1078995lqj; Mon, 3 Jun 2024 09:29:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV6+z8PYdIaRV9WndkF/Fvk00rjhO4W5d2yspQ6T1fhBvrGL6iXUDB0mTScoZM4mfGGn1WEKKy1X4I/YxAtOUk0LuV3ehKOtEF9bi0jcA== X-Google-Smtp-Source: AGHT+IFCcI8NQ6iPplYkma8stMN0Kz/F41Vk8alGGq/9TqCqMU9NScIK/ThUQRLed3gkVsuoGpln X-Received: by 2002:a05:6214:2f11:b0:6ad:7360:7d4b with SMTP id 6a1803df08f44-6aecd6d9910mr121167616d6.51.1717432187076; Mon, 03 Jun 2024 09:29:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717432187; cv=pass; d=google.com; s=arc-20160816; b=w5mxFVni88Sxl7ljwTuSIs9JGaY6QnPyTJtcVL5iqj1cajwD2pcG8eiOcEh7mAm8QI KwlrrAmaHjcIoUbg/DfkxGc5ocSNBDLW2tuc68J+NtBtgZ3UWzEUSWPCvBG8/Budpm1W tkdnsrJPl1BQUQpfXCra1pQieR2nap/2caemqCulyIAWphE5PokYYBJFIfKArtXWp6Dt wlCf4X3npYAt0cu9V0HPUN6ChR1/vJBnf+LccPQ6Lj7tXsw2TIaqNNCu5lkLe8l7WPLB HCCITn6FiZFT5y9ANDWMcaIT0jl+IIwiwiMlMlOYJSOwcfUDqYTf7PdGI6shwR+YclBO FZnw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=vO1n/lWawnfw0jSxKsAxSYA2vEqJjiWJN8Gwv2/S4NQ=; fh=rldNpSZdIVm09os20YUTk4jMKDSQl5EF+TqyTq4TECw=; b=kpQMEDGhv+4/7VrFwBt17KA+/5dVpOIBGd7LzNqxn8WodvrckdkJ/es/WK7NT6VDjv M3cZcD7VC44rjBjTkIPMJ8EpLX2swNR9OeWo6lhvwd2ZuYgWit8mofyE2nYfoPO/fG0B N9XYRp1Wy3ZFJKigkiWTCdMHxmtzONAMrMADCueO3vp4melHaav5A0e13iAk5ymdV3cO GqMVNMi8oViGl8crb/KmTu5elNDDk1vGhAJvRsBKLz+3FoYjqqHAFGdb0qHDuJMk9q2n YzO4l6jjONJF3lymT6M7wywkpT0nkOLyezUN3ovYYDpD/QLoXbMbQKk3e4WzF4deCJSU YdVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=iodev.co.uk dmarc=pass fromdomain=iodev.co.uk); spf=pass (google.com: domain of linux-kernel+bounces-199445-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199445-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=iodev.co.uk Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b42b8cfsi92775966d6.516.2024.06.03.09.29.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 09:29:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199445-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=iodev.co.uk dmarc=pass fromdomain=iodev.co.uk); spf=pass (google.com: domain of linux-kernel+bounces-199445-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199445-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=iodev.co.uk 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E77441C225D6 for ; Mon, 3 Jun 2024 16:28:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 37C7B13698E; Mon, 3 Jun 2024 16:28:38 +0000 (UTC) Received: from iodev.co.uk (iodev.co.uk [46.30.189.100]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6714313664B; Mon, 3 Jun 2024 16:28:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.30.189.100 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717432117; cv=none; b=qTim4ydLnesTr7Xy2QYVHkzOiV9t9mtpa9IL12foYjNks/ygOM8M7sI66wjV/4M3SMFwr0Pz/rG/KpzJME7wkuzQvZIpO3hutjAey2o8ExuflNDzM4S2n1FknrtdzHg4fSsruye5R3YX19A9YrUMYBaFdKxjUxVaDsCNV+ReuxE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717432117; c=relaxed/simple; bh=S41KtMNy578ooBZOlpzT9d0b338WCUrzYp5MEJGF7PE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=i4t/KUjVxm301QzuuMUktFzY2+CWiSH2eN6wynzcAPVgMzuBBgYq1Hzh1puYKBeBCnVzYvez0dDK+im4K4eZnja+8D5CXsGzA5UH5TAegeJK45sGAB/68psdNfNw4h/ojV3eppRLcloz5V/Zt4GuU+wSq0iU5V23FsBtKT2gCVs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=iodev.co.uk; spf=pass smtp.mailfrom=iodev.co.uk; arc=none smtp.client-ip=46.30.189.100 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=iodev.co.uk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iodev.co.uk Received: from pirotess (222.red-83-46-228.dynamicip.rima-tde.net [83.46.228.222]) by iodev.co.uk (Postfix) with ESMTPSA id 1C0222EF964; Mon, 03 Jun 2024 18:28:34 +0200 (CEST) Date: Mon, 3 Jun 2024 18:28:32 +0200 From: Ismael Luceno To: Wolfram Sang Cc: linux-kernel@vger.kernel.org, Bluecherry Maintainers , Anton Sviridenko , Andrey Utkin , Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: Re: [PATCH 6/8] media: solo6x10: use 'time_left' variable with wait_for_completion_timeout() Message-ID: References: <20240603092841.9500-1-wsa+renesas@sang-engineering.com> <20240603092841.9500-7-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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On 03/Jun/2024 18:25, Ismael Luceno wrote: > On 03/Jun/2024 11:28, Wolfram Sang wrote: > > 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; > > } > > Signed-off-by: Ismael Luceno Sorry, I meant Acked-by.