From patchwork Mon Apr 29 11:28:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 13646639 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 EEC8FC4345F for ; Mon, 29 Apr 2024 11:29:09 +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=K3uhRH6dCnyX4z/Us2x7wmFbwQL3XmUUhWDwlVXvsnk=; b=Rpdm7QIT1niVXq qODtQ/kBizzKXAkMtwIwJIX8aHFsvRM4OaPodaF2SmJ8bSCz5CMhT/dECEVDBqLQbefWk5t3oiXiZ 1eMVO5Asmi7BXSny9oBHpccb63FPsE4OCOFnF0k0W+oLxlitF3TswxdN444JWYZUUq5aHWtsD7BAt ebw/fRkTIg6PwdJ636S8fadsYpuUX6MqMsN7zy75bSZHBxtV+zOVqHn9dZ2Mhu8euIGEq8+Uwvc18 IF3kczAVjjCkPlUoZCS8znllLDY+GNItmFnkisZSpaaocgcTvz7QvlmsHR1vGU6w1gd+FDXa0hYPq 16dolc7vWREZ64inHQZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1PBn-00000002RL1-15pW; Mon, 29 Apr 2024 11:28:55 +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 1s1PBj-00000002RIM-3jP5 for linux-arm-kernel@lists.infradead.org; Mon, 29 Apr 2024 11:28:54 +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=fAVKMqRoK3GEyb zsjMIQAuD5pNP2sMiRqK4blj9QPNs=; b=mFsf7TdVwL/397rbVrkXr2nBV8tMCW XHy9YScgS2ZQnBjtt3TOVqzHClpOGhxN7qMbIZThDZKEib3yuxqbiXJQ/RVQOXhi XVq61D9hQBt9dSB8QxIxvI9PENpSZqPTazwt6LYp2ADbtXc5hvCP0CnmexUQ8Aw5 yB5auSBygdg8jQfpPFdkzf3QvCFon727ZkRfED6dggWW0NiKQquqVJXObAfixcxg gz3L0ZILg/RiGoDHPTO71G7W1Tc8BXMAhs+XBl/Y4VQ9Pr/IBC9bvop6Zw4zn5Ia 9wKlUKh+HFHuI1/d6IqP6AGauU2movDEBKcWjjXKkFi8KuD3M+ORlGyg== Received: (qmail 2279485 invoked from network); 29 Apr 2024 13:28:43 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 29 Apr 2024 13:28:43 +0200 X-UD-Smtp-Session: l3s3148p1@KkJPjjoXgAptKPB4 From: Wolfram Sang To: linux-spi@vger.kernel.org Cc: Wolfram Sang , imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev Subject: [PATCH 0/8] spi: use 'time_left' instead of 'timeout' with wait_for_*() functions Date: Mon, 29 Apr 2024 13:28:33 +0200 Message-ID: <20240429112843.67628-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-20240429_042852_235609_1132C17B X-CRM114-Status: UNSURE ( 8.84 ) 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. 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(-)