[PATCH v2] namei: use QSTR() instead of QSTR_INIT() in path_pts

Thorsten Blum posted 1 patch 1 month, 3 weeks ago
There is a newer version of this series
fs/namei.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH v2] namei: use QSTR() instead of QSTR_INIT() in path_pts
Posted by Thorsten Blum 1 month, 3 weeks ago
Drop the hard-coded length argument and use the simpler QSTR(). Inline
the code and drop the local variable.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
Changes in v2:
- Inline QSTR() and drop the local variable as suggested by Al Viro
- v1: https://lore.kernel.org/lkml/20260422123002.99876-3-thorsten.blum@linux.dev/
---
 fs/namei.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/namei.c b/fs/namei.c
index c7fac83c9a85..01f3fbdf646c 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3617,7 +3617,6 @@ int path_pts(struct path *path)
 	 */
 	struct dentry *parent = dget_parent(path->dentry);
 	struct dentry *child;
-	struct qstr this = QSTR_INIT("pts", 3);
 
 	if (unlikely(!path_connected(path->mnt, parent))) {
 		dput(parent);
@@ -3625,7 +3624,7 @@ int path_pts(struct path *path)
 	}
 	dput(path->dentry);
 	path->dentry = parent;
-	child = d_hash_and_lookup(parent, &this);
+	child = d_hash_and_lookup(parent, &QSTR("pts"));
 	if (IS_ERR_OR_NULL(child))
 		return -ENOENT;