mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: linux-kernel@vger.kernel.org
Cc: "André Almeida" <andrealmeid@igalia.com>,
	"Darren Hart" <dvhart@infradead.org>,
	"Davidlohr Bueso" <dave@stgolabs.net>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Juri Lelli" <juri.lelli@redhat.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Valentin Schneider" <vschneid@redhat.com>,
	"Waiman Long" <longman@redhat.com>,
	"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>
Subject: [PATCH v2 5/5] futex: Correct the kernedoc return value for futex_wait_setup().
Date: Sat, 17 May 2025 17:14:55 +0200	[thread overview]
Message-ID: <20250517151455.1065363-6-bigeasy@linutronix.de> (raw)
In-Reply-To: <20250517151455.1065363-1-bigeasy@linutronix.de>

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.

Reviewed-by: André Almeida <andrealmeid@igalia.com>
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


  parent reply	other threads:[~2025-05-17 15:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-17 15:14 [PATCH v2 0/5] futex: Random fixes after the private-hash series Sebastian Andrzej Siewior
2025-05-17 15:14 ` [PATCH v2 1/5] selftests/futex: Use TAP output in futex_priv_hash Sebastian Andrzej Siewior
2025-05-21 12:06   ` [tip: locking/futex] " tip-bot2 for Sebastian Andrzej Siewior
2025-05-17 15:14 ` [PATCH v2 2/5] selftests/futex: Use TAP output in futex_numa_mpol Sebastian Andrzej Siewior
2025-05-21 12:06   ` [tip: locking/futex] " tip-bot2 for Sebastian Andrzej Siewior
2025-05-17 15:14 ` [PATCH v2 3/5] futex: Use RCU_INIT_POINTER() in futex_mm_init() Sebastian Andrzej Siewior
2025-05-21 12:06   ` [tip: locking/futex] " tip-bot2 for Sebastian Andrzej Siewior
2025-05-17 15:14 ` [PATCH v2 4/5] tools headers: Synchronize prctl.h ABI header Sebastian Andrzej Siewior
2025-05-21 12:06   ` [tip: locking/futex] " tip-bot2 for Sebastian Andrzej Siewior
2025-05-17 15:14 ` Sebastian Andrzej Siewior [this message]
2025-05-21 12:06   ` [tip: locking/futex] futex: Correct the kernedoc return value for futex_wait_setup() tip-bot2 for Sebastian Andrzej Siewior

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=20250517151455.1065363-6-bigeasy@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=andrealmeid@igalia.com \
    --cc=dave@stgolabs.net \
    --cc=dvhart@infradead.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=vschneid@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®