From nobody Fri Feb 13 03:18:59 2026 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 8EA2880632 for ; Mon, 3 Jun 2024 09:28:49 +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=1717406931; cv=none; b=vF7YoOvvycmB478QKRrKE6uy8/nAkm3G3Jvm4jkEyoeyXrTaMau2TmlJrxXqz4ue3TKBDZPF7PL7GWEz+lqcjsmICQpjC2RmgSBQ/iLS8eSjl37mR4KlMwCZViliXUjb6vEoyj2BW94mANM+Qu9XA9F1VlCmgCfzZrRdtdjmpvs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717406931; c=relaxed/simple; bh=x9r0dvx+56ChurBzQtcPwM6yk15IGheGZCWCnh6mNHA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q7uvIgVRfFd/bVd+w3aQ1NOixJ4CA1XDCVniOMv+scPA6C73rcbgKCE2cz68zfxvdVpJymPlEXcOdFpVIbj4rOywpOYQSD+lYbrmHaLhLrEhf0kOmlPLY9EtMLb8Uj7CB1ctIL9T7S5+kj7RuxDNVuholX93xFIBODrf6N76/9c= 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=T070ACYu; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="T070ACYu" 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=iFHQTiqeEFBKGd3rXHXp+vfm+qP+/anhPmfCS1jdQd0=; b=T070AC Yufs91XsFUkr/ELMMEqHsbPILzNjkR7rWGeS6jHFW4J7rl+9RbDnsxxuH8uGxbtC ogmYFstDR8L4X7Sy5UWLlEUtBRChLRqeqOa5ent6sg/tX2bKV3PztASsPY7wiDYC Z13IVD81ZU9dYRl8a3XS3S9/mJr2ty2UF0nqt6TWrkOeE1AduhRMFH1DcRgdgKhK r09nPqP7eV62Q9NzevD4OzPPGLxT2M/5ljWjCxTJqel0cZknO0gFPVbjmozH7EPP bhFJ8nBbeWjiZi1/iKO9uJheZKSevpsJhrDkVYtNNkHDGHafRnkafnJFZIzshKhb L215QOyW1KOQk7Zw== Received: (qmail 1903109 invoked from network); 3 Jun 2024 11:28:47 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 3 Jun 2024 11:28:47 +0200 X-UD-Smtp-Session: l3s3148p1@nYzW9fgZIpEgAwDPXzLGAH1eNELjOc3g From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: [PATCH 1/8] media: allegro: use 'time_left' variable with wait_for_completion_timeout() Date: Mon, 3 Jun 2024 11:28:32 +0200 Message-ID: <20240603092841.9500-2-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: quoted-printable Content-Type: text/plain; charset="utf-8" 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 =3D wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the c= ode self explaining. Signed-off-by: Wolfram Sang --- .../media/platform/allegro-dvt/allegro-core.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/allegro-dvt/allegro-core.c b/drivers/me= dia/platform/allegro-dvt/allegro-core.c index da61f9beb6b4..4016aef5fdb9 100644 --- a/drivers/media/platform/allegro-dvt/allegro-core.c +++ b/drivers/media/platform/allegro-dvt/allegro-core.c @@ -2481,14 +2481,14 @@ static void allegro_mcu_interrupt(struct allegro_de= v *dev) static void allegro_destroy_channel(struct allegro_channel *channel) { struct allegro_dev *dev =3D channel->dev; - unsigned long timeout; + unsigned long time_left; =20 if (channel_exists(channel)) { reinit_completion(&channel->completion); allegro_mcu_send_destroy_channel(dev, channel); - timeout =3D wait_for_completion_timeout(&channel->completion, - msecs_to_jiffies(5000)); - if (timeout =3D=3D 0) + time_left =3D wait_for_completion_timeout(&channel->completion, + msecs_to_jiffies(5000)); + if (time_left =3D=3D 0) v4l2_warn(&dev->v4l2_dev, "channel %d: timeout while destroying\n", channel->mcu_channel_id); @@ -2544,7 +2544,7 @@ static void allegro_destroy_channel(struct allegro_ch= annel *channel) static int allegro_create_channel(struct allegro_channel *channel) { struct allegro_dev *dev =3D channel->dev; - unsigned long timeout; + unsigned long time_left; =20 if (channel_exists(channel)) { v4l2_warn(&dev->v4l2_dev, @@ -2595,9 +2595,9 @@ static int allegro_create_channel(struct allegro_chan= nel *channel) =20 reinit_completion(&channel->completion); allegro_mcu_send_create_channel(dev, channel); - timeout =3D wait_for_completion_timeout(&channel->completion, - msecs_to_jiffies(5000)); - if (timeout =3D=3D 0) + time_left =3D wait_for_completion_timeout(&channel->completion, + msecs_to_jiffies(5000)); + if (time_left =3D=3D 0) channel->error =3D -ETIMEDOUT; if (channel->error) goto err; --=20 2.43.0 From nobody Fri Feb 13 03:18:59 2026 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 690147E765 for ; Mon, 3 Jun 2024 09:28:49 +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=1717406932; cv=none; b=q3l/qG5/cbzm5OsbTjUxKehWMcx4ZSICUzmU4fwzD8329+/p6WkC62/w1IhE+gDzD4DbzjJ8deBkMZqdbJ4jSSz5OlhLEaRqERk2/B664a4VDsz+UzKHdRDziRuJnw0rRNNrq9GDaI1gJLK1VmxoGBxxH3UsklBz10+4c3hLAXM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717406932; c=relaxed/simple; bh=cPm8nay+S+hqLs3f8cNpHCw2GMY1g39P/OB0hXA/nCc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N6TllATAqZzJKcaSZNhiS4gspBWFVYX8Ya6HaA8bS669P3vIeeYwqFbA1D0OUCOERU531pXCwRvqj2Jt7kKHp/ObSMxnVCQCWCXUz2qrk9unEytGN4CrogFWdIbJGyTNPm67Na8KbBuoTfpV+eLK4mr1g0eLOPWcdk6Eu99vA14= 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=bxG7t3kp; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="bxG7t3kp" 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=02MpfbTZVRydFuk89P1aOhV4C4DMB1o7ZOvFwGaqMGs=; b=bxG7t3 kpQIQVQE3TWsriU15meiNvVk4iG7R15bW1JuP+JQ+n2TA97JXbcLpYzPrtEJ6ASK x27KQPobYtdMijUH6vr/ngZVV5fsZpJGiqyE0oWL/Sh7oWhOmNjI4IzsDauwY3pW J9yDTnW6nYeok7rzjcvRaGq3yWt3kWe2TWSOsEFFvfNSUprYU2HsObj7tfFpIACu e0zEntDSNvMTCfDx7W4qX3Lh7Vvgs1XgG7yGY/nG7me7Uz589p/OxbaNu9wloDsD wyWozHSOHXirX+cAfcKHJAW/vyiO6qbNI1bBU76iTxCbfLQJdjWx6KSujSQ5JEaS W2HnHXb8ZAJopRHg== Received: (qmail 1903150 invoked from network); 3 Jun 2024 11:28:48 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 3 Jun 2024 11:28:48 +0200 X-UD-Smtp-Session: l3s3148p1@8ZXi9fgZLpEgAwDPXzLGAH1eNELjOc3g From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Eugen Hristev , Mauro Carvalho Chehab , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/8] media: atmel-isi: use 'time_left' variable with wait_for_completion_timeout() Date: Mon, 3 Jun 2024 11:28:33 +0200 Message-ID: <20240603092841.9500-3-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: quoted-printable Content-Type: text/plain; charset="utf-8" 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 =3D wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the c= ode 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/platf= orm/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); } =20 - timeout =3D wait_for_completion_timeout(&isi->complete, - msecs_to_jiffies(500)); - if (timeout =3D=3D 0) + time_left =3D wait_for_completion_timeout(&isi->complete, + msecs_to_jiffies(500)); + if (time_left =3D=3D 0) return -ETIMEDOUT; =20 return 0; --=20 2.43.0 From nobody Fri Feb 13 03:18:59 2026 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="OKShxnkY" 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: quoted-printable Content-Type: text/plain; charset="utf-8" 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 =3D wait_event_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the c= ode 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/med= ia/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; =20 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 *bdis= p) set_bit(ST_M2M_SUSPENDING, &bdisp->state); spin_unlock_irqrestore(&bdisp->slock, flags); =20 - timeout =3D wait_event_timeout(bdisp->irq_queue, - test_bit(ST_M2M_SUSPENDED, &bdisp->state), - BDISP_WORK_TIMEOUT); + time_left =3D wait_event_timeout(bdisp->irq_queue, + test_bit(ST_M2M_SUSPENDED, &bdisp->state), + BDISP_WORK_TIMEOUT); =20 clear_bit(ST_M2M_SUSPENDING, &bdisp->state); =20 - if (!timeout) { + if (!time_left) { dev_err(bdisp->dev, "%s IRQ timeout\n", __func__); return -EAGAIN; } --=20 2.43.0 From nobody Fri Feb 13 03:18:59 2026 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 872C97E777 for ; Mon, 3 Jun 2024 09:28:52 +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=ZDI4lQMcG1X3SA3upGbiPEp7IYzzewXe1VPbQ1EMa1Qq6IydizxQ+7mHgpRXv1emwmZKN+XB2NOYhNs9gTuQW4F0g2VdwTxVCD9kXqCxWY2iiTiKLL2CRHqOLeyClVGyHelQ4hxXDxVRB68zCCaVeeBIQQlAY1KA6PUTYVJkS+A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717406934; c=relaxed/simple; bh=W8gUTFBPD+tA7+2ntE/n8EE7HfRzoEX/4t2fRFR4E9M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ioUuDX3Dn51ytRS1hN4qda0vXnRmvYjk5LxbQr0URWr+7oeZS9MgaGsEcJCvxV/usAoAsshbBKct2eyHI4QJ7wKUabNCBJ3z8DK27K2nYW2A66htnjEazSdJmDusOOIAzHaILCcmzFAHvcTPHfK80iJuIYAuHl9fTyTTpzhKAQI= 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=fQB2+Ibi; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="fQB2+Ibi" 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=4+VZY6xjdqQ6MPEiVx+onjPOBE5C0+HNWuhGThWPvSk=; b=fQB2+I biy9mHMKRTPDStBkikrLnU0hfgMdvNhMT2rmlOYGYxMXc7N8l0yLOBYqZi00nOCF d1sLYdZL2KQxkzHaJF4gr6Dt94KuMWaXyY65PU/pDgVlHMu2ohgkQ4QHVjY3aaWc aPqLcI1PcUdLtzFY72c+KTYM5FOfkC1EcjsopY0u4C+w6JQmhy/9Cv7I9y0inDyY 6+upC0BWM32QWgKLhRWQyP72RxMv1r7yPBac37aVZ1w/udPX8MYMnCYhmTHSj0M+ y/ZXqwu6hjLpk7jEu9biTUq76Pnej8lFUptyt16nJwn1mb29q7DwMCztQloyMXOU HfY6NbPkwLbTEpdw== Received: (qmail 1903205 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@cWH69fgZMpEgAwDPXzLGAH1eNELjOc3g From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski , Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 4/8] media: fimc-is: use 'time_left' variable with wait_event_timeout() Date: Mon, 3 Jun 2024 11:28:35 +0200 Message-ID: <20240603092841.9500-5-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: quoted-printable Content-Type: text/plain; charset="utf-8" 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 =3D wait_event_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the c= ode self explaining. Fix to the proper variable type 'long' while here. Signed-off-by: Wolfram Sang --- drivers/media/platform/samsung/exynos4-is/fimc-core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-core.c b/driver= s/media/platform/samsung/exynos4-is/fimc-core.c index aae74b501a42..adfc2d73d04b 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-core.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-core.c @@ -822,7 +822,7 @@ static int fimc_clk_get(struct fimc_dev *fimc) static int fimc_m2m_suspend(struct fimc_dev *fimc) { unsigned long flags; - int timeout; + long time_left; =20 spin_lock_irqsave(&fimc->slock, flags); if (!fimc_m2m_pending(fimc)) { @@ -833,12 +833,12 @@ static int fimc_m2m_suspend(struct fimc_dev *fimc) set_bit(ST_M2M_SUSPENDING, &fimc->state); spin_unlock_irqrestore(&fimc->slock, flags); =20 - timeout =3D wait_event_timeout(fimc->irq_queue, - test_bit(ST_M2M_SUSPENDED, &fimc->state), - FIMC_SHUTDOWN_TIMEOUT); + time_left =3D wait_event_timeout(fimc->irq_queue, + test_bit(ST_M2M_SUSPENDED, &fimc->state), + FIMC_SHUTDOWN_TIMEOUT); =20 clear_bit(ST_M2M_SUSPENDING, &fimc->state); - return timeout =3D=3D 0 ? -EAGAIN : 0; + return time_left =3D=3D 0 ? -EAGAIN : 0; } =20 static int fimc_m2m_resume(struct fimc_dev *fimc) --=20 2.43.0 From nobody Fri Feb 13 03:18:59 2026 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 B39E882D89 for ; Mon, 3 Jun 2024 09:28:53 +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=1717406935; cv=none; b=NoPJ32HL3Aovu3MDhv0A9oKl8GxAWAsOFPmjL+nqg5ii+c+EApJmzWuDar/CjAuKPq7moDY2SykVNDD8H3CCs8lQYlK7oKm6Jj3RlDLMWQ0FRjDdo/SFHbDMBw/qbbwp/20rgvO6YNqSjga6j75hIzUvLDeZq7HdlfnbhE1hCjM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717406935; c=relaxed/simple; bh=cXNr8lvilFqgnUnNUc6PKltH1qdIyJCwlrLCI0cyV1c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lo5oUpZmT0KFBObWd7HtISMjQV8f/SXhrzhVtTVGaGiPTeDf7/j5u2d2Smf9proS57OA3For+lHtPQfMvjblyPnHE2+L/MXQxHACMR+wRWD1DWO4QKaCJIH4/hJWREnmXjWYOx4MPMcsfiW37MasytZlbrCc/rI4zCbL7p/ju0k= 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=Ui6X3A16; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="Ui6X3A16" 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=zB4c4eCfnz+o1bXx+7F5PGzh74D33KxHOsl6JG4Vi7Q=; b=Ui6X3A 16IW+rxfswIUoOxPQdNpXJb1qt3Ej/swGYi6cEelNUy/BktzD+4Tpu7wJwctJTNZ ItJTxPDmyhlfxRD4fstRaD5jZooxNJcLWCqTNaSTX4PBsYJCqZlV1AqXbAD3icee lsCQyGA3knPCwkO75kFOVX0+UIPFAhzwOa9pz/zG9KmMuRzxI2TWUHE6X1nKzONJ uv5pxs7ovC83bXEGAdmEomI5n5gYKO9VpyifUCNlqOVoLa9N6AFM+/fn2Htl4lxU xwRnPPwCRdoOum2yV5w7b/k7ODs2L8BgriX+kYIyCS1uxEtR3Z+kLN9CrsV0Yn5A nhe8Xl1j2VQdAtDA== Received: (qmail 1903230 invoked from network); 3 Jun 2024 11:28:50 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 3 Jun 2024 11:28:50 +0200 X-UD-Smtp-Session: l3s3148p1@LNQF9vgZPJEgAwDPXzLGAH1eNELjOc3g From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Mauro Carvalho Chehab , Krzysztof Kozlowski , Alim Akhtar , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 5/8] media: platform: exynos-gsc: use 'time_left' variable with wait_event_timeout() Date: Mon, 3 Jun 2024 11:28:36 +0200 Message-ID: <20240603092841.9500-6-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: quoted-printable Content-Type: text/plain; charset="utf-8" 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 =3D wait_event_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the c= ode 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; =20 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); =20 - timeout =3D wait_event_timeout(gsc->irq_queue, - test_bit(ST_M2M_SUSPENDED, &gsc->state), - GSC_SHUTDOWN_TIMEOUT); + time_left =3D wait_event_timeout(gsc->irq_queue, + test_bit(ST_M2M_SUSPENDED, &gsc->state), + GSC_SHUTDOWN_TIMEOUT); =20 clear_bit(ST_M2M_SUSPENDING, &gsc->state); - return timeout =3D=3D 0 ? -EAGAIN : 0; + return time_left =3D=3D 0 ? -EAGAIN : 0; } =20 static void gsc_m2m_resume(struct gsc_dev *gsc) --=20 2.43.0 From nobody Fri Feb 13 03:18:59 2026 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="MBAb4wq6" 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: quoted-printable Content-Type: text/plain; charset="utf-8" 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 =3D wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the c= ode 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 =3D 0; int ret =3D 0; unsigned int p2m_id =3D 0; @@ -99,12 +99,12 @@ int solo_p2m_dma_desc(struct solo_dev *solo_dev, desc[1].ctrl); } =20 - timeout =3D wait_for_completion_timeout(&p2m_dev->completion, - solo_dev->p2m_jiffies); + time_left =3D wait_for_completion_timeout(&p2m_dev->completion, + solo_dev->p2m_jiffies); =20 if (WARN_ON_ONCE(p2m_dev->error)) ret =3D -EIO; - else if (timeout =3D=3D 0) { + else if (time_left =3D=3D 0) { solo_dev->p2m_timeouts++; ret =3D -EAGAIN; } --=20 2.43.0 From nobody Fri Feb 13 03:18:59 2026 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 76D7C84A39 for ; Mon, 3 Jun 2024 09:28:56 +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=1717406938; cv=none; b=fH1vPu6+acE4qSwoFIJHxdWFK4b3dHNtP2bd+f+3pYH0b0AxTcBUFnBfxoftYaBVdTqZXrQegNY3btdzUUeNv6xqhgcAe32doezgAb5mbOXiXEut01Vrr0/AdhLOArl0wuEZLNkJ2uTaVdFc5RXukE5aKwK0xF8Fy5Ym1I8QGOc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717406938; c=relaxed/simple; bh=ExH1RE6J3JZqUHzT1HZoynPSJurb8BdI2ZdsEFrAr1M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dwivHzBjz611Y9D//OPgBkb31r+OAX/Y7dAm5TrZcDvjf0dFfYICiWYEkoxqgPUiFhlI9xt/+ad+53wAo0kF0pe6GWvkySGgw75LLVmCSf/iG42PBNI+jbskwpvWZ8sQAjTfXHVGhLVCkVrHMOhUkZob2H/WWcA2DhGCJyXaQA4= 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=Sdyff3U0; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="Sdyff3U0" 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=V8NJYfnjjH8D2WEiTjZz2n/d2672IqQpNfvAhuAj1sg=; b=Sdyff3 U0BTaHQsInCDZHb8Bc6RezKDiKWcUl+GncS01OVtJJXemT86Zz4nJJ6z8Wtid6UW a5gPSRulJRF/feBG4xDzLHuowjSJOxwSt1x/+a2EyHG9aoYVm/rVatjP5ey3bWmb xY4D9dzyp+G76rEJhbAa9kwAewMGd43vOm/IHhgKZoWr2QlbvNooMGXMW6ajwNTv hT5GB5UOyj6O6MZD09GEEfyVNTZzGxpdmhul6iNLYN6Zbn9Yy/nUgapB3g8u6/nO 3JTLagJbbT27B2TPx+rcftPLiloTndT2sdbeys9p7t8Ce9OGURCEdlWFeFgPnK/9 NDNsZDeoOIewy0aQ== Received: (qmail 1903301 invoked from network); 3 Jun 2024 11:28:52 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 3 Jun 2024 11:28:52 +0200 X-UD-Smtp-Session: l3s3148p1@0WEe9vgZRtcgAwDPXzLGAH1eNELjOc3g From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Dmitry Osipenko , Mauro Carvalho Chehab , Thierry Reding , Jonathan Hunter , linux-media@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 7/8] media: tegra-vde: use 'time_left' variable with wait_for_completion_interruptible_timeout() Date: Mon, 3 Jun 2024 11:28:38 +0200 Message-ID: <20240603092841.9500-8-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: quoted-printable Content-Type: text/plain; charset="utf-8" There is a confusing pattern in the kernel to use a variable named 'timeout= ' to store the result of wait_for_completion_interruptible_timeout() causing pat= terns like: timeout =3D wait_for_completion_interruptible_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the c= ode self explaining. Signed-off-by: Wolfram Sang Acked-by: Thierry Reding --- drivers/media/platform/nvidia/tegra-vde/h264.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/nvidia/tegra-vde/h264.c b/drivers/media= /platform/nvidia/tegra-vde/h264.c index cfea5572a1b8..d20b7b9fb79c 100644 --- a/drivers/media/platform/nvidia/tegra-vde/h264.c +++ b/drivers/media/platform/nvidia/tegra-vde/h264.c @@ -628,14 +628,14 @@ static int tegra_vde_decode_end(struct tegra_vde *vde) unsigned int read_bytes, macroblocks_nb; struct device *dev =3D vde->dev; dma_addr_t bsev_ptr; - long timeout; + long time_left; int ret; =20 - timeout =3D wait_for_completion_interruptible_timeout( + time_left =3D wait_for_completion_interruptible_timeout( &vde->decode_completion, msecs_to_jiffies(1000)); - if (timeout < 0) { - ret =3D timeout; - } else if (timeout =3D=3D 0) { + if (time_left < 0) { + ret =3D time_left; + } else if (time_left =3D=3D 0) { bsev_ptr =3D tegra_vde_readl(vde, vde->bsev, 0x10); macroblocks_nb =3D tegra_vde_readl(vde, vde->sxe, 0xC8) & 0x1FFF; read_bytes =3D bsev_ptr ? bsev_ptr - vde->bitstream_data_addr : 0; --=20 2.43.0 From nobody Fri Feb 13 03:18:59 2026 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 46E9E84A5C for ; Mon, 3 Jun 2024 09:28:57 +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=1717406939; cv=none; b=qP5pxxHECGzBSFU3s9UuRonqYtrW43Fqw4TyeWZWIydpF5sfwdAjp1MwNl8zmLQTyEDZ33h6+dDqR/tSE2BRX355G/9DRcaLq5JUnaWDH3n74NtK5/qJd5ewf2Y0sgd4I8uNERt3LJWWP60+9Frdo4JakGLOprW9kbZL4+462ME= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717406939; c=relaxed/simple; bh=Mnmt1ogL9b7vULUwW/DFVNwc/+O/QYY2bGNMf1Qj9Zk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pOHc1mTro0TSz2TKymnYMF7s5hCrHoVRV2NfF/8gU/heF90OPshfZSHnWTET27cA58F2HCc8xzqJvzK/2ziYbTk+2ofnFZxIIvjY+juZri6EgOe+jP3TpIe7f87U5n+scBWBpMcye9jaUoV6/CCbxyaJ+JGWTH1E49a3ZHQ57AA= 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=ikqnVyD0; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="ikqnVyD0" 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=A8oaKiWsS3ONtbUCaXMsPkJITTTFUHiuQzwOzERPisU=; b=ikqnVy D0A3MUpqKSyfow3btR4Hat4yA9Ct8sqzLtY7C4EtypSFiV4mhzzQwdPl6XuHMc3j +6IW793Kbud9/v+HoiZSdbn0nf51seTj6ACROWLEx4BMFo6g+cBcljouIe2ACkRu Ju7k1xeK8ZQe4XUdLc1wK3R1FcTWLjbQdzioXYlYaqndd0gP+EHONgNqX3qFvxDD 58kWi5A1QUR2KE5gP02NrH9TPKqjrBWk4l9h9/gLr0/kqwkGvgP/CI//J/x89gg+ auRMZsQJ76BUwJv2ic0P/h9ig7d4EA4/OD66XlePb5BjkkHdublFgcXpRk9o0cFW Me/tDDPJ3bZ8NuyA== Received: (qmail 1903325 invoked from network); 3 Jun 2024 11:28:53 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 3 Jun 2024 11:28:53 +0200 X-UD-Smtp-Session: l3s3148p1@v/sr9vgZUNcgAwDPXzLGAH1eNELjOc3g From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Benoit Parrot , Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: [PATCH 8/8] media: ti: cal: use 'time_left' variable with wait_event_timeout() Date: Mon, 3 Jun 2024 11:28:39 +0200 Message-ID: <20240603092841.9500-9-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: quoted-printable Content-Type: text/plain; charset="utf-8" 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 =3D wait_event_timeout(...) if (!timeout) return -ETIMEDOUT; with all kinds of permutations. Use 'time_left' as a variable to make the c= ode self explaining. Signed-off-by: Wolfram Sang --- drivers/media/platform/ti/cal/cal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/ti/cal/cal.c b/drivers/media/platform/t= i/cal/cal.c index 528909ae4bd6..5c2c04142aee 100644 --- a/drivers/media/platform/ti/cal/cal.c +++ b/drivers/media/platform/ti/cal/cal.c @@ -549,7 +549,7 @@ void cal_ctx_start(struct cal_ctx *ctx) void cal_ctx_stop(struct cal_ctx *ctx) { struct cal_camerarx *phy =3D ctx->phy; - long timeout; + long time_left; =20 WARN_ON(phy->vc_enable_count[ctx->vc] =3D=3D 0); =20 @@ -565,9 +565,9 @@ void cal_ctx_stop(struct cal_ctx *ctx) ctx->dma.state =3D CAL_DMA_STOP_REQUESTED; spin_unlock_irq(&ctx->dma.lock); =20 - timeout =3D wait_event_timeout(ctx->dma.wait, cal_ctx_wr_dma_stopped(ctx), - msecs_to_jiffies(500)); - if (!timeout) { + time_left =3D wait_event_timeout(ctx->dma.wait, cal_ctx_wr_dma_stopped(ct= x), + msecs_to_jiffies(500)); + if (!time_left) { ctx_err(ctx, "failed to disable dma cleanly\n"); cal_ctx_wr_dma_disable(ctx); } --=20 2.43.0