From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Kees Cook <kees@kernel.org>, Andy Shevchenko <andy@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Subject: [PATCH v1 1/1] string: Add missing Return sections
Date: Wed, 3 Jun 2026 09:15:52 +0200 [thread overview]
Message-ID: <20260603071648.106679-2-andriy.shevchenko@linux.intel.com> (raw)
The kernel-doc unfortunately can't catch some corner cases. Hence
the commit 645b9ad2dc6b ("string: Add missing kernel-doc return descriptions")
missed that. On top there is no consistency in use of Return/Returns.
Address both problems here. Choose Returns over Return as it will be
less invasive change.
Fixes: 645b9ad2dc6b ("string: Add missing kernel-doc return descriptions")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
Cc'ed to the Documentation and kernel-doc people to point out on this
kernel-doc corner cases. It didn't complain on the macros that return
a value. Also it would be nice to have file level consistency on
the naming of the same type of sections, e.g., Returns vs. Return.
Kees, feel free to drop Fixes whilst applying in case you think it not
worth it. The commit message still has a pointer.
include/linux/string.h | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/include/linux/string.h b/include/linux/string.h
index b850bd91b3d8..549f327e33fb 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -25,7 +25,7 @@ extern void *memdup_user_nul(const void __user *, size_t);
* @n: number of array members to copy
* @size: size of one array member
*
- * Return: an ERR_PTR() on failure. Result is physically
+ * Returns: an ERR_PTR() on failure. Result is physically
* contiguous, to be freed by kfree().
*/
static inline __realloc_size(2, 3)
@@ -45,7 +45,7 @@ void *memdup_array_user(const void __user *src, size_t n, size_t size)
* @n: number of array members to copy
* @size: size of one array member
*
- * Return: an ERR_PTR() on failure. Result may be not
+ * Returns: an ERR_PTR() on failure. Result may be not
* physically contiguous. Use kvfree() to free.
*/
static inline __realloc_size(2, 3)
@@ -106,7 +106,8 @@ ssize_t sized_strscpy(char *, const char *, size_t);
* doesn't unnecessarily force the tail of the destination buffer to be
* zero padded. If padding is desired please use strscpy_pad().
*
- * Returns the number of characters copied in @dst (not including the
+ * Returns:
+ * The number of characters copied in @dst (not including the
* trailing %NUL) or -E2BIG if @size is 0 or the copy from @src was
* truncated.
*/
@@ -289,7 +290,7 @@ char *strreplace(char *str, char old, char new);
* @s: The memory area
* @n: The size of the area
*
- * Return: True if the area of memory is all 0's.
+ * Returns: True if the area of memory is all 0's.
*/
static inline bool mem_is_zero(const void *s, size_t n)
{
@@ -332,6 +333,10 @@ int __sysfs_match_string(const char * const *array, size_t n, const char *s);
* @_s: string to match with
*
* Helper for __sysfs_match_string(). Calculates the size of @a automatically.
+ *
+ * Returns:
+ * The index of the matching string in the array or negative error code
+ * otherwise.
*/
#define sysfs_match_string(_a, _s) __sysfs_match_string(_a, ARRAY_SIZE(_a), _s)
--
2.50.1
next reply other threads:[~2026-06-03 7:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-03 7:15 Andy Shevchenko [this message]
2026-06-03 7:43 ` [PATCH v1 1/1] string: Add missing Return sections Andy Shevchenko
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=20260603071648.106679-2-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=andy@kernel.org \
--cc=corbet@lwn.net \
--cc=kees@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@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