From nobody Tue Feb 10 05:48:32 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 8578E144D2F for ; Sat, 27 Apr 2024 20:36:17 +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=1714250180; cv=none; b=cOtoY/uxyyT7rJ1h59xkFB0a8OAEm2xTaFo/VXfYaaTQaGWQzz5NnGeFFzULJYsAMFepigeX58/+k+RklaFe0iUs5GloDsiVpCDfNkVD8vxOmKJrSm3LgVYzlTARgIV+psRZ1PvshuaRPZQhiTYYkjzVb2ujzVIHHrQs2j587tQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714250180; c=relaxed/simple; bh=h1YZllPsTaiaLlHfe955GjP37jjK7/WEfEpoM+4afYs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aJ9htb0US0aSGfC+aN1gtRswhDQRrcuniHnn5sjT53Fqa1o8+BIoUpxA6hsvpJGu3A2K8QnFzp32qq19W7nCwZVx9ZqNd5IIOxiSwouO/4uhzX+ybYbxzpczhgl+PIzwi2c3eQ7An+klrTz1FcIX6XMbxqy3W/UFQEq3uPCmDiQ= 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=jefq8255; 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="jefq8255" 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=ZLv8hXeiJlISzozbBZSXzJgescsNzyHh+xzwSX3kxuA=; b=jefq82 55sCtSyVsbvE4qhoIJRG1DsC8Hp+LjOZ9MhXyN/4kndV5BHe2xsXpRwPsggVXrhB lfcl1zRCCW1JxdLc9pIohqFaf8nMK/oSyqbtoXwwl0P3+eYd0Ox/N1BbNlmN1cKa IFfeG1Mi4UKfSM+4FpzqAxW5J1E6yl7MeQpMSwyLofFxDj5UNp++FkGtQgFJtN+x qfn0vMbp7b9dQjsVp7x9HZsNciSFYcaly07YAJyFv4XsdRHHFA5P5d6EZW74AtMw lDtXev+q36Sc7/AokIA5z/QLYTa+0CcUE7xQJcxu2ru6BR2nKbrYXb5h6OcXHF6N lNZGIvO4Rd3u+OVA== Received: (qmail 1781843 invoked from network); 27 Apr 2024 22:36:15 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 27 Apr 2024 22:36:15 +0200 X-UD-Smtp-Session: l3s3148p1@Wh/C+BkXuI9ehh9l From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: Wolfram Sang , Andi Shyti , Baruch Siach , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/15] i2c: digicolor: use 'time_left' variable with wait_for_completion_timeout() Date: Sat, 27 Apr 2024 22:35:54 +0200 Message-ID: <20240427203611.3750-3-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240427203611.3750-1-wsa+renesas@sang-engineering.com> References: <20240427203611.3750-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 Acked-by: Baruch Siach --- drivers/i2c/busses/i2c-digicolor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-digicolor.c b/drivers/i2c/busses/i2c-di= gicolor.c index 3462f2bc0fa8..737604ae11fc 100644 --- a/drivers/i2c/busses/i2c-digicolor.c +++ b/drivers/i2c/busses/i2c-digicolor.c @@ -213,7 +213,7 @@ static irqreturn_t dc_i2c_irq(int irq, void *dev_id) static int dc_i2c_xfer_msg(struct dc_i2c *i2c, struct i2c_msg *msg, int fi= rst, int last) { - unsigned long timeout =3D msecs_to_jiffies(TIMEOUT_MS); + unsigned long time_left =3D msecs_to_jiffies(TIMEOUT_MS); unsigned long flags; =20 spin_lock_irqsave(&i2c->lock, flags); @@ -227,9 +227,9 @@ static int dc_i2c_xfer_msg(struct dc_i2c *i2c, struct i= 2c_msg *msg, int first, dc_i2c_start_msg(i2c, first); spin_unlock_irqrestore(&i2c->lock, flags); =20 - timeout =3D wait_for_completion_timeout(&i2c->done, timeout); + time_left =3D wait_for_completion_timeout(&i2c->done, time_left); dc_i2c_set_irq(i2c, 0); - if (timeout =3D=3D 0) { + if (time_left =3D=3D 0) { i2c->state =3D STATE_IDLE; return -ETIMEDOUT; } --=20 2.43.0