linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eliav Farber <farbere@amazon.com>
To: <luc.vanoostenryck@gmail.com>, <rostedt@goodmis.org>,
	<mingo@redhat.com>, <natechancellor@gmail.com>,
	<ndesaulniers@google.com>, <keescook@chromium.org>,
	<sashal@kernel.org>, <akpm@linux-foundation.org>,
	<ojeda@kernel.org>, <elver@google.com>,
	<gregkh@linuxfoundation.org>, <kbusch@kernel.org>,
	<sj@kernel.org>, <bvanassche@acm.org>, <leon@kernel.org>,
	<jgg@ziepe.ca>, <linux-kernel@vger.kernel.org>,
	<linux-sparse@vger.kernel.org>,
	<clang-built-linux@googlegroups.com>, <stable@vger.kernel.org>
Cc: <jonnyc@amazon.com>, <farbere@amazon.com>
Subject: [PATCH v2 1/4 5.10.y] overflow: Correct check_shl_overflow() comment
Date: Fri, 12 Sep 2025 15:30:35 +0000	[thread overview]
Message-ID: <20250912153040.26691-2-farbere@amazon.com> (raw)
In-Reply-To: <20250912153040.26691-1-farbere@amazon.com>

From: Keith Busch <kbusch@kernel.org>

[ Upstream commit 4578be130a6470d85ff05b13b75a00e6224eeeeb ]

A 'false' return means the value was safely set, so the comment should
say 'true' for when it is not considered safe.

Cc: Jason Gunthorpe <jgg@ziepe.ca>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Eliav Farber <farbere@amazon.com>
Fixes: 0c66847793d1 ("overflow.h: Add arithmetic shift helper")
Link: https://lore.kernel.org/r/20210401160629.1941787-1-kbusch@kernel.org
---
 include/linux/overflow.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/overflow.h b/include/linux/overflow.h
index 35af574d006f..d1dd039fe1c3 100644
--- a/include/linux/overflow.h
+++ b/include/linux/overflow.h
@@ -235,7 +235,7 @@ static inline bool __must_check __must_check_overflow(bool overflow)
  * - 'a << s' sets the sign bit, if any, in '*d'.
  *
  * '*d' will hold the results of the attempted shift, but is not
- * considered "safe for use" if false is returned.
+ * considered "safe for use" if true is returned.
  */
 #define check_shl_overflow(a, s, d) __must_check_overflow(({		\
 	typeof(a) _a = a;						\
-- 
2.47.3


  reply	other threads:[~2025-09-12 15:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-12 15:30 [PATCH v2 0/4 5.10.y] overflow: Allow mixed type arguments in overflow macros Eliav Farber
2025-09-12 15:30 ` Eliav Farber [this message]
2025-09-12 15:30 ` [PATCH v2 2/4 5.10.y] compiler.h: drop fallback overflow checkers Eliav Farber
2025-09-12 15:30 ` [PATCH v2 3/4 5.10.y] overflow: Allow mixed type arguments Eliav Farber
2025-09-12 15:30 ` [PATCH v2 4/4 5.10.y] tracing: Define the is_signed_type() macro once Eliav Farber
2025-09-12 15:46 ` [PATCH v2 0/4 5.10.y] overflow: Allow mixed type arguments in overflow macros Bart Van Assche
2025-09-12 16:52 ` Sasha Levin
2025-09-12 18:56   ` Farber, Eliav

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=20250912153040.26691-2-farbere@amazon.com \
    --to=farbere@amazon.com \
    --cc=akpm@linux-foundation.org \
    --cc=bvanassche@acm.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=elver@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jgg@ziepe.ca \
    --cc=jonnyc@amazon.com \
    --cc=kbusch@kernel.org \
    --cc=keescook@chromium.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=mingo@redhat.com \
    --cc=natechancellor@gmail.com \
    --cc=ndesaulniers@google.com \
    --cc=ojeda@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=sashal@kernel.org \
    --cc=sj@kernel.org \
    --cc=stable@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).