Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp842710lqj; Mon, 3 Jun 2024 02:29:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXtNLW/DQAGNO3qFuoEB9mNiA+2T97GTdHOOpXE0rGm43agJTACdX9zxMDKnmRS7ASSuEI+Tgpp/CHLEwCLuGkhfA3/dncjTF2fvESMbw== X-Google-Smtp-Source: AGHT+IHuofFLvznivMW37+x+XUFHB6jLOsQ0pZIjCP/QvINF8KrTiPpkXKNlMHqxUgG0gUVKFJA+ X-Received: by 2002:a05:6214:3d8c:b0:6af:3f53:d813 with SMTP id 6a1803df08f44-6af3f53da1bmr58204386d6.33.1717406996167; Mon, 03 Jun 2024 02:29:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717406996; cv=pass; d=google.com; s=arc-20160816; b=w/mi5+vrba/2TQWYlX0Dku2VKD5esH2MVYKhmQLEIoQCNn+jGvGJjgn2TJiFkH6yoV +xQfLLtyPoQcGlhFzup9xv6dYnbITUcVidThWSwlFSAFRUSg8b/7GffdzyuGXfHnzi9t ISjKupH0VoFLlbLIfgkVE1s/wawKE6436fvK3f4e9SibTzfSnoewxFhxdkJrCC8GCcBO tcO2CYqoNhgQGS2TsuJTVRFQwiviwMnFBh5UBo2k3VdRmpyHNGPmgiB2Jrks8vTtIAgA PraUjdnn2dDG8R8krXzoZHmcTUHYWe90HA0hPfWzi5ev8Py+VYJsBhLrNvftBQ6ZhQ1q vHiA== 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=QCf4T93K+AST5Yzjmn6q110PbPP55ZAkL6pQUZlJaj4=; fh=IY72pAUOjzWzEHon7DSZ2ATOh1+moGw1G2E+OHhfJsA=; b=vCjBzh9cr6hXqe8/u8GJYZy5hdHJ3nT55MFRAQRlbhicHsoF0y+1WZCs8dUd+KdNWv nUJ4SF0U1N8Zf2eFDfSVGcK+ble73BuNELjuIU/HZKWetmKflXjc1AFrWufBQgcvEqN4 C1m7ZPR24NTp5nR+gHOXizWhaiIwMqILFPHHfGR1cFbUu52OLQPuk0Ry2dWtqpf91v1c zmDOnm570qL17UfxIAOH13qR550BdYlOD183NCqunuus2ZH+MoE2yD1henSx4fGY+JHd PdUTVeYrgoJxWvq0E+W4LGSvWjzTxtxA+DVve5z+Q6CiZ7z0sNs2fWkKWVQoPAvOVewo HAWg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=OKShxnkY; 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-198871-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198871-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b42c667si81224646d6.528.2024.06.03.02.29.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 02:29:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198871-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@sang-engineering.com header.s=k1 header.b=OKShxnkY; 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-198871-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198871-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D76C11C214DE for ; Mon, 3 Jun 2024 09:29:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0706183CB4; Mon, 3 Jun 2024 09:28:55 +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="OKShxnkY" 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 642118286F for ; Mon, 3 Jun 2024 09:28:51 +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=1717406934; cv=none; b=IXSRp70WZHm+VOPVP37GSfPnFvOEspH7xSY1NuIIlIrKit2VJwSRhHWhP2lwwAVxmBuNamH37C+3AGmuInOh9WuQWQSEl2Kdv2KvJ2O7lIRH17I95Pd0cmgbV4h37Xq9MqlL99llMNdiEDXTFewS2w+Yyh5Jqy+/ld2GOrHfvjs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717406934; c=relaxed/simple; bh=OYEtGeODvKcwFc43M2FBJnSYNnGPH7r/JT/azuNX9PQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=s9069OnqiRu58fq37htZ4RHGMPbeSKNUi8LMK9oUH/pZT6dqGoQBlb5IYi6S1C2OAeNhE4kIS0/baHTEKRq2P9SiCAGk9V7TLzErgVuaVWXVvZFw2LgDh4a1YDhvvqIb7h2abV5/02cUnEB/ZLLaZH2DXpbqEl+u7MdG0inpeE8= 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=OKShxnkY; 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=QCf4T93K+AST5Yzjmn6q110PbPP55ZAkL6pQUZlJaj4=; b=OKShxn kY4bHndg8pVOTPAfVNHBXaM6pwrJl5nqRPTZxmuFdcslkGzcUcMVPNpMPWCHdPeH ZRZ/a+TURC8cZQbbDvzkTsGbg23rY5ISCDDQLIPN8Hu9mSDL5sshb/R6SqLOrPtU 3zVGclh4HcTgAPnqZLaGXmoiWVjh0LNYX3ZjhxT/AKdFUW7b0IAc/ZwhzVBvRJ7d u2zNOu3A30Kc9S0jgJ6YLmUZjtybFPohBCNBH0+RX4AL73xEEGZn3TELx2EypJdj avjiJfxPJ+1X4tddSBlwnMTveE/lLLD+z3Gzb3SMTquYaTlTeze6DyIuoL9L/lDL tB30nYZ+1glTJaAQ== Received: (qmail 1903179 invoked from network); 3 Jun 2024 11:28:49 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 3 Jun 2024 11:28:49 +0200 X-UD-Smtp-Session: l3s3148p1@xi/u9fgZMJEgAwDPXzLGAH1eNELjOc3g From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Fabien Dessenne , Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: [PATCH 3/8] media: bdisp: use 'time_left' variable with wait_event_timeout() Date: Mon, 3 Jun 2024 11:28:34 +0200 Message-ID: <20240603092841.9500-4-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_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/st/sti/bdisp/bdisp-v4l2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c index 1328b4eb6b9f..c7ee6e1a4451 100644 --- a/drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c +++ b/drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c @@ -1160,7 +1160,7 @@ static void bdisp_irq_timeout(struct work_struct *ptr) static int bdisp_m2m_suspend(struct bdisp_dev *bdisp) { unsigned long flags; - int timeout; + long time_left; spin_lock_irqsave(&bdisp->slock, flags); if (!test_bit(ST_M2M_RUNNING, &bdisp->state)) { @@ -1171,13 +1171,13 @@ static int bdisp_m2m_suspend(struct bdisp_dev *bdisp) set_bit(ST_M2M_SUSPENDING, &bdisp->state); spin_unlock_irqrestore(&bdisp->slock, flags); - timeout = wait_event_timeout(bdisp->irq_queue, - test_bit(ST_M2M_SUSPENDED, &bdisp->state), - BDISP_WORK_TIMEOUT); + time_left = wait_event_timeout(bdisp->irq_queue, + test_bit(ST_M2M_SUSPENDED, &bdisp->state), + BDISP_WORK_TIMEOUT); clear_bit(ST_M2M_SUSPENDING, &bdisp->state); - if (!timeout) { + if (!time_left) { dev_err(bdisp->dev, "%s IRQ timeout\n", __func__); return -EAGAIN; } -- 2.43.0