Re: [PATCH] dcache: use QSTR() instead of QSTR_INIT()

From: Jan Kara

Date: Wed Apr 22 2026 - 08:57:36 EST


On Wed 22-04-26 14:33:46, Thorsten Blum wrote:
> Drop the hard-coded length arguments and use the simpler QSTR().
>
> Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>

Sure. Feel free to add:

Reviewed-by: Jan Kara <jack@xxxxxxx>

Honza

> ---
> fs/dcache.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/dcache.c b/fs/dcache.c
> index 2c61aeea41f4..c5536da1634d 100644
> --- a/fs/dcache.c
> +++ b/fs/dcache.c
> @@ -89,11 +89,11 @@ EXPORT_SYMBOL(rename_lock);
> static struct kmem_cache *__dentry_cache __ro_after_init;
> #define dentry_cache runtime_const_ptr(__dentry_cache)
>
> -const struct qstr empty_name = QSTR_INIT("", 0);
> +const struct qstr empty_name = QSTR("");
> EXPORT_SYMBOL(empty_name);
> -const struct qstr slash_name = QSTR_INIT("/", 1);
> +const struct qstr slash_name = QSTR("/");
> EXPORT_SYMBOL(slash_name);
> -const struct qstr dotdot_name = QSTR_INIT("..", 2);
> +const struct qstr dotdot_name = QSTR("..");
> EXPORT_SYMBOL(dotdot_name);
>
> /*
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR