From patchwork Tue Apr 30 11:41:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 13648797 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1FA89C4345F for ; Tue, 30 Apr 2024 11:42:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=QdSPgENKGWDhv9P1+U5kVl8Pz5Ngt2Y2tj7ksoX640Y=; b=NFIYuCF+LrBzlS a/oGwil+2H1GfSlYrF9EhnxuEcGPYV3gj6S6go3QAsp3i8yI3xmnoRS6t887B5+kUgi3OvI9SgcIo 6ki5OsRVYaJXYHoNlWPfMV0c112WTgtLOA/IWm1c2k8C46jyakPhH7AOZpLPA7lwAljptmu0jj2vM 2UhZEKnZVq2sX0VXP2Yop35NMGbhjeRqhJQO5G6jRbbXAihe5ZIoG4jC5LhCzYbtW1fvxXOStV8sN eXiVDRg+LV9dnVlcpeJOBbjZt3UkhOlRCyphoNUTH1miJ+PhwKHn4V06ZjQ8YAQu8Ke21u6hr+BGS yZ59FDyNZro3NfVvyvag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1lry-00000006Cmv-2LVB; Tue, 30 Apr 2024 11:41:58 +0000 Received: from www.zeus03.de ([194.117.254.33] helo=mail.zeus03.de) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1lru-00000006ClD-1ePM for linux-arm-kernel@lists.infradead.org; Tue, 30 Apr 2024 11:41:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= sang-engineering.com; h=from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; s=k1; bh=kPt/8jXnSYDJet xC6X9ogQ5fhnFm9dtkiEVM3GdRJns=; b=YVaScdHdY4NjORBPNe4rjE3++GOIgS mp3Xp40IjXOJL79qL/N5AuU9Kuw/D7jU7bTQlh92OMpduNDuJmGpfMy0F1G3hmPy ItucPd/CXExTI3q97YTlNii0io20qNExkKqc7vGJgcwhkOmpusUZ7HohfE1yEKXZ 7nHdANP5rHWiEZupg3j8cWwPY8CAGgREcLwZcjE16z7WrBdYZfTUNyOaDGTFc2Ju F331rzsBI5SLvh5CZCWqzg3sNGhfysNDIXxkPttln6oqKMckPnNeSVVOQYwtY0VE utfvK3wLlflit7svPcNnW0jr+9XbqAZyVq6aQAxnMGDWj2zAkROVvheA== Received: (qmail 2617714 invoked from network); 30 Apr 2024 13:41:43 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 30 Apr 2024 13:41:43 +0200 X-UD-Smtp-Session: l3s3148p1@99ih2k4XpOhehhrb From: Wolfram Sang To: linux-spi@vger.kernel.org Cc: Wolfram Sang , Chen-Yu Tsai , imx@lists.linux.dev, Jernej Skrabec , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, Mark Brown , Samuel Holland , Sascha Hauer , Shawn Guo Subject: [PATCH v2 0/8] spi: use 'time_left' instead of 'timeout' with wait_for_*() functions Date: Tue, 30 Apr 2024 13:41:32 +0200 Message-ID: <20240430114142.28551-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_044155_227581_9D691D00 X-CRM114-Status: UNSURE ( 9.20 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_*() functions 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 obvious and self explaining. This is part of a tree-wide series. The rest of the patches can be found here (some parts may still be WIP): git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/time_left Because these patches are generated, I audit them before sending. This is why I will send series step by step. Build bot is happy with these patches, though. No functional changes intended. Changes since v1: * tags added (thanks!) * white space issue in sun6i driver fixed * add maintainers to coverletter Wolfram Sang (8): spi: armada-3700: use 'time_left' variable with wait_for_completion_timeout() spi: fsl-lpspi: use 'time_left' variable with wait_for_completion_timeout() spi: imx: use 'time_left' variable with wait_for_completion_timeout() spi: pic32-sqi: use 'time_left' variable with wait_for_completion_timeout() spi: pic32: use 'time_left' variable with wait_for_completion_timeout() spi: sun4i: use 'time_left' variable with wait_for_completion_timeout() spi: sun6i: use 'time_left' variable with wait_for_completion_timeout() spi: xlp: use 'time_left' variable with wait_for_completion_timeout() drivers/spi/spi-armada-3700.c | 8 ++++---- drivers/spi/spi-fsl-lpspi.c | 14 +++++++------- drivers/spi/spi-imx.c | 20 ++++++++++---------- drivers/spi/spi-pic32-sqi.c | 6 +++--- drivers/spi/spi-pic32.c | 6 +++--- drivers/spi/spi-sun4i.c | 9 +++++---- drivers/spi/spi-sun6i.c | 17 +++++++++-------- drivers/spi/spi-xlp.c | 8 ++++---- 8 files changed, 45 insertions(+), 43 deletions(-)