* [PATCH] string: Fix missing kernel-doc descriptions in string.h
@ 2025-11-18 18:00 Kriish Sharma
2025-11-18 18:27 ` Andy Shevchenko
0 siblings, 1 reply; 3+ messages in thread
From: Kriish Sharma @ 2025-11-18 18:00 UTC (permalink / raw)
To: kees, andy; +Cc: linux-hardening, linux-kernel, Kriish Sharma
While running kernel-doc validation, several warnings were emitted for
functions in include/linux/string.h due to missing return value
documentation or missing parameter descriptions:
Warning: include/linux/string.h:375 No description found for return value of 'kbasename'
Warning: include/linux/string.h:560 No description found for return value of 'strstarts'
WARNING: include/linux/string.h:573 function parameter 'str' not described in 'strends'
WARNING: include/linux/string.h:573 function parameter 'suffix' not described in 'strends'
This patch adds the missing "Returns:" sections for kbasename() and
strstarts(), and provides parameter descriptions for strends().
These changes resolve all kernel-doc warnings in this header.
Signed-off-by: Kriish Sharma <kriish.sharma2006@gmail.com>
---
include/linux/string.h | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/include/linux/string.h b/include/linux/string.h
index 929d05d1247c..3597e2801463 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -371,6 +371,10 @@ static inline void memzero_explicit(void *s, size_t count)
* kbasename - return the last part of a pathname.
*
* @path: path to extract the filename from.
+ *
+ * Returns:
+ * Pointer to the filename portion inside @path. If no '/' exists,
+ * returns @path unchanged.
*/
static inline const char *kbasename(const char *path)
{
@@ -556,6 +560,9 @@ static __always_inline size_t str_has_prefix(const char *str, const char *prefix
* strstarts - does @str start with @prefix?
* @str: string to examine
* @prefix: prefix to look for.
+ *
+ * Returns:
+ * True if @str begins with @prefix. False in all other cases.
*/
static inline bool strstarts(const char *str, const char *prefix)
{
@@ -564,8 +571,8 @@ static inline bool strstarts(const char *str, const char *prefix)
/**
* strends - Check if a string ends with another string.
- * @str - NULL-terminated string to check against @suffix
- * @suffix - NULL-terminated string defining the suffix to look for in @str
+ * @str: NULL-terminated string to check against @suffix
+ * @suffix: NULL-terminated string defining the suffix to look for in @str
*
* Returns:
* True if @str ends with @suffix. False in all other cases.
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] string: Fix missing kernel-doc descriptions in string.h
2025-11-18 18:00 [PATCH] string: Fix missing kernel-doc descriptions in string.h Kriish Sharma
@ 2025-11-18 18:27 ` Andy Shevchenko
2025-11-18 18:39 ` Kriish Sharma
0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2025-11-18 18:27 UTC (permalink / raw)
To: Kriish Sharma; +Cc: kees, andy, linux-hardening, linux-kernel
On Tue, Nov 18, 2025 at 06:00:08PM +0000, Kriish Sharma wrote:
> While running kernel-doc validation, several warnings were emitted for
> functions in include/linux/string.h due to missing return value
> documentation or missing parameter descriptions:
>
> Warning: include/linux/string.h:375 No description found for return value of 'kbasename'
> Warning: include/linux/string.h:560 No description found for return value of 'strstarts'
> WARNING: include/linux/string.h:573 function parameter 'str' not described in 'strends'
> WARNING: include/linux/string.h:573 function parameter 'suffix' not described in 'strends'
>
> This patch adds the missing "Returns:" sections for kbasename() and
> strstarts(), and provides parameter descriptions for strends().
> These changes resolve all kernel-doc warnings in this header.
strends() fixes are in Bart's tree, will be soon in Linux Next I suppose.
The rest seems good.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] string: Fix missing kernel-doc descriptions in string.h
2025-11-18 18:27 ` Andy Shevchenko
@ 2025-11-18 18:39 ` Kriish Sharma
0 siblings, 0 replies; 3+ messages in thread
From: Kriish Sharma @ 2025-11-18 18:39 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: kees, andy, linux-hardening, linux-kernel
On Tue, Nov 18, 2025 at 11:57 PM Andy Shevchenko
<andriy.shevchenko@intel.com> wrote:
>
> strends() fixes are in Bart's tree, will be soon in Linux Next I suppose.
> The rest seems good.
Hi Andy,
Thanks for the review and for the heads-up.
I’ll drop the strends() changes since they’re already in Bart’s tree
and send a v2 with only the kbasename() and strstarts() kernel-doc
fixes.
Thanks again for the quick feedback.
--
With Best Regards,
Kriish Sharma
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-18 18:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-18 18:00 [PATCH] string: Fix missing kernel-doc descriptions in string.h Kriish Sharma
2025-11-18 18:27 ` Andy Shevchenko
2025-11-18 18:39 ` Kriish Sharma
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox