[PATCH 5/5] futex: Correct the kernedoc return value for futex_wait_setup()

Sebastian Andrzej Siewior posted 5 patches 7 months, 1 week ago
There is a newer version of this series
[PATCH 5/5] futex: Correct the kernedoc return value for futex_wait_setup()
Posted by Sebastian Andrzej Siewior 7 months, 1 week ago
The kerneldoc for futex_wait_setup() states it can return "0" or "<1".
This isn't true because the error case is "<0" not less than 1.

Document that <0 is returned on error. Drop the possible return values
and state possible reasons.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 kernel/futex/waitwake.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/futex/waitwake.c b/kernel/futex/waitwake.c
index b3738fbe83c62..e2bbe5509ec27 100644
--- a/kernel/futex/waitwake.c
+++ b/kernel/futex/waitwake.c
@@ -585,7 +585,8 @@ int futex_wait_multiple(struct futex_vector *vs, unsigned int count,
  *
  * Return:
  *  -  0 - uaddr contains val and hb has been locked;
- *  - <1 - -EFAULT or -EWOULDBLOCK (uaddr does not contain val) and hb is unlocked
+ *  - <0 - On error and the hb is unlocked. A possible reason: the uaddr can not
+ *	   be read, does not contain the expected value or is not properly aligned.
  */
 int futex_wait_setup(u32 __user *uaddr, u32 val, unsigned int flags,
 		     struct futex_q *q, union futex_key *key2,
-- 
2.49.0
Re: [PATCH 5/5] futex: Correct the kernedoc return value for futex_wait_setup()
Posted by André Almeida 7 months ago
Em 16/05/2025 13:03, Sebastian Andrzej Siewior escreveu:
> The kerneldoc for futex_wait_setup() states it can return "0" or "<1".
> This isn't true because the error case is "<0" not less than 1.
> 
> Document that <0 is returned on error. Drop the possible return values
> and state possible reasons.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---

Reviewed-by: André Almeida <andrealmeid@igalia.com>