All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>
Subject: Re: [PATCH 0/2] mtd: use 'time_left' instead of 'timeout' with wait_*() functions
Date: Wed, 5 Jun 2024 09:43:59 +0200	[thread overview]
Message-ID: <20240605094359.53a6d8ca@xps-13> (raw)
In-Reply-To: <20240604212919.5038-4-wsa+renesas@sang-engineering.com>

Hi Wolfram,

wsa+renesas@sang-engineering.com wrote on Tue,  4 Jun 2024 23:29:19
+0200:

> There is a confusing pattern in the kernel to use a variable named 'timeout' to
> store the result of wait_*() 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.

Good idea. The waiting functions are generally confusing because the
semantics of the return values are different, so this is a good first
step, I'll take them through mtd-next soon.

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>
Subject: Re: [PATCH 0/2] mtd: use 'time_left' instead of 'timeout' with wait_*() functions
Date: Wed, 5 Jun 2024 09:43:59 +0200	[thread overview]
Message-ID: <20240605094359.53a6d8ca@xps-13> (raw)
In-Reply-To: <20240604212919.5038-4-wsa+renesas@sang-engineering.com>

Hi Wolfram,

wsa+renesas@sang-engineering.com wrote on Tue,  4 Jun 2024 23:29:19
+0200:

> There is a confusing pattern in the kernel to use a variable named 'timeout' to
> store the result of wait_*() 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.

Good idea. The waiting functions are generally confusing because the
semantics of the return values are different, so this is a good first
step, I'll take them through mtd-next soon.

Thanks,
Miquèl

  parent reply	other threads:[~2024-06-05  7:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-04 21:29 [PATCH 0/2] mtd: use 'time_left' instead of 'timeout' with wait_*() functions Wolfram Sang
2024-06-04 21:29 ` Wolfram Sang
2024-06-04 21:29 ` [PATCH 1/2] mtd: nand: mxc_nand: use 'time_left' variable with wait_for_completion_timeout() Wolfram Sang
2024-06-04 21:29   ` Wolfram Sang
2024-07-01 12:00   ` Miquel Raynal
2024-07-01 12:00     ` Miquel Raynal
2024-06-04 21:29 ` [PATCH 2/2] mtd: rawnand: intel: " Wolfram Sang
2024-06-04 21:29   ` Wolfram Sang
2024-07-01 12:00   ` Miquel Raynal
2024-07-01 12:00     ` Miquel Raynal
2024-06-05  7:43 ` Miquel Raynal [this message]
2024-06-05  7:43   ` [PATCH 0/2] mtd: use 'time_left' instead of 'timeout' with wait_*() functions Miquel Raynal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240605094359.53a6d8ca@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.