fs/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Drop the hard-coded length argument and use the simpler QSTR().
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
fs/namei.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/namei.c b/fs/namei.c
index c7fac83c9a85..817bba800d7b 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3617,7 +3617,7 @@ int path_pts(struct path *path)
*/
struct dentry *parent = dget_parent(path->dentry);
struct dentry *child;
- struct qstr this = QSTR_INIT("pts", 3);
+ struct qstr this = QSTR("pts");
if (unlikely(!path_connected(path->mnt, parent))) {
dput(parent);
On Wed, Apr 22, 2026 at 02:30:03PM +0200, Thorsten Blum wrote:
> Drop the hard-coded length argument and use the simpler QSTR().
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> fs/namei.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/namei.c b/fs/namei.c
> index c7fac83c9a85..817bba800d7b 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -3617,7 +3617,7 @@ int path_pts(struct path *path)
> */
> struct dentry *parent = dget_parent(path->dentry);
> struct dentry *child;
> - struct qstr this = QSTR_INIT("pts", 3);
> + struct qstr this = QSTR("pts");
>
> if (unlikely(!path_connected(path->mnt, parent))) {
> dput(parent);
NAK. Compound literal is an l-value, so let's just use it:
child = d_hash_and_lookup(parent, &QSTR("pts"));
and to hell with the local variable.
On Wed 22-04-26 14:30:03, Thorsten Blum wrote:
> Drop the hard-coded length argument and use the simpler QSTR().
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/namei.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/namei.c b/fs/namei.c
> index c7fac83c9a85..817bba800d7b 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -3617,7 +3617,7 @@ int path_pts(struct path *path)
> */
> struct dentry *parent = dget_parent(path->dentry);
> struct dentry *child;
> - struct qstr this = QSTR_INIT("pts", 3);
> + struct qstr this = QSTR("pts");
>
> if (unlikely(!path_connected(path->mnt, parent))) {
> dput(parent);
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
© 2016 - 2026 Red Hat, Inc.