namei: use QSTR() instead of QSTR_INIT() in path_pts
PATCH 1/1 namei: use QSTR() instead of QSTR_INIT() in path_pts
Drop the hard-coded length argument and use the simpler QSTR().
Signed-off-by Thorsten Blum <[email protected]>
--- fs/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/namei.c +1 -1
@@ -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);
Quoted 3 lines · Thorsten Blum
Drop the hard-coded length argument and use the simpler
QSTR().Signed-off-by Thorsten Blum <[email protected]>
Looks good. Feel free to add:
Reviewed-by Jan Kara <[email protected]>
Honza
Quoted 17 lines
--- fs/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/namei.c +1
-1@@ -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);
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Al Viro
maintainerQuoted 12 lines · Thorsten Blum
Drop the hard-coded length argument and use the simpler
QSTR().Signed-off-by Thorsten Blum <[email protected]>--- fs/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/namei.c +0
-0
fs/namei.c int path_pts(struct path *path) · line 3623
Quoted 8 lines
fs/namei.c +1
-1@@ -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.