Re: [PATCH v3 5/5] string: Make strprefix() const-qualifier-generic
From: Joe Perches
Date: Tue Nov 10 2026 - 12:48:24 EST
On Tue, 2026-11-10 at 16:33 +0100, Alejandro Colomar wrote:
no commit description on proposed patch
> Suggested-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
> Signed-off-by: Alejandro Colomar <alx@xxxxxxxxxx>
> ---
> include/linux/string.h | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/string.h b/include/linux/string.h
> index 9e59f9697c9e..55ca4cb5122c 100644
> --- a/include/linux/string.h
> +++ b/include/linux/string.h
> @@ -590,7 +590,9 @@ void memcpy_and_pad(void *dest, size_t dest_len, const void *src, size_t count,
> * * @s+strlen(@prefix) if @s starts with @prefix
> * * NULL if @s does not start with @prefix
> */
> -static inline char *strprefix(const char *s, const char *prefix)
> +#define strprefix(s, pfx) const_cast(CQChar_of(s) *, strprefix(s, pfx))
> +
> +static inline char *(strprefix)(const char *s, const char *prefix)
Why introduce a new coding style?