Skip to content

Commit 4578be1

Browse files
keithbuschkees
authored andcommitted
overflow: Correct check_shl_overflow() comment
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> Fixes: 0c66847 ("overflow.h: Add arithmetic shift helper") Link: https://lore.kernel.org/r/20210401160629.1941787-1-kbusch@kernel.org
1 parent a38fd87 commit 4578be1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/linux/overflow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ static inline bool __must_check __must_check_overflow(bool overflow)
235235
* - 'a << s' sets the sign bit, if any, in '*d'.
236236
*
237237
* '*d' will hold the results of the attempted shift, but is not
238-
* considered "safe for use" if false is returned.
238+
* considered "safe for use" if true is returned.
239239
*/
240240
#define check_shl_overflow(a, s, d) __must_check_overflow(({ \
241241
typeof(a) _a = a; \

0 commit comments

Comments
 (0)