linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] spi: use 'time_left' instead of 'timeout' with wait_for_*() functions
@ 2024-04-29 11:28 Wolfram Sang
  2024-04-29 11:28 ` [PATCH 1/8] spi: armada-3700: use 'time_left' variable with wait_for_completion_timeout() Wolfram Sang
                   ` (8 more replies)
  0 siblings, 9 replies; 17+ messages in thread
From: Wolfram Sang @ 2024-04-29 11:28 UTC (permalink / raw)
  To: linux-spi; +Cc: Wolfram Sang, imx, linux-arm-kernel, linux-kernel, linux-sunxi

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(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-05-02  3:57 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-29 11:28 [PATCH 0/8] spi: use 'time_left' instead of 'timeout' with wait_for_*() functions Wolfram Sang
2024-04-29 11:28 ` [PATCH 1/8] spi: armada-3700: use 'time_left' variable with wait_for_completion_timeout() Wolfram Sang
2024-04-29 15:15   ` Mark Brown
2024-04-29 11:28 ` [PATCH 2/8] spi: fsl-lpspi: " Wolfram Sang
2024-04-29 11:28 ` [PATCH 3/8] spi: imx: " Wolfram Sang
2024-04-30  1:35   ` Peng Fan
2024-04-29 11:28 ` [PATCH 4/8] spi: pic32-sqi: " Wolfram Sang
2024-04-29 11:28 ` [PATCH 5/8] spi: pic32: " Wolfram Sang
2024-04-29 11:28 ` [PATCH 6/8] spi: sun4i: " Wolfram Sang
2024-04-29 12:14   ` Andre Przywara
2024-04-29 15:19   ` Jernej Škrabec
2024-04-29 11:28 ` [PATCH 7/8] spi: sun6i: " Wolfram Sang
2024-04-29 12:16   ` Andre Przywara
2024-04-29 14:36     ` Wolfram Sang
2024-04-29 15:20   ` Jernej Škrabec
2024-04-29 11:28 ` [PATCH 8/8] spi: xlp: " Wolfram Sang
2024-05-02  3:57 ` [PATCH 0/8] spi: use 'time_left' instead of 'timeout' with wait_for_*() functions Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).