smb: Remove unnecessary variables
Subsystems (2)
PATCH 1/1 smb: Remove unnecessary variables
Remove unneeded variable:ret and return 0 at the end of the function
Signed-off-by Lu Hongfei <[email protected]>
--- fs/smb/server/vfs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) mode change 100644 => 100755 fs/smb/server/vfs.c
fs/smb/server/vfs.c +1 -3
@@ -120,8 +120,6 @@ static int ksmbd_vfs_path_lookup_locked(struct ksmbd_share_config *share_conf,int ksmbd_vfs_query_maximal_access (struct mnt_idmap *idmap,struct dentry *dentry,__le32 *daccess) { -int ret =0 ; - *daccess =cpu_to_le32 (FILE_READ_ATTRIBUTES |READ_CONTROL );if (!inode_permission (idmap,d_inode (dentry),MAY_OPEN |MAY_WRITE ))
@@ -139,7 +137,7 @@ int ksmbd_vfs_query_maximal_access(struct mnt_idmap *idmap,if (!inode_permission (idmap,d_inode (dentry->d_parent),MAY_EXEC |MAY_WRITE )) *daccess |=FILE_DELETE_LE ; -return ret; +return 0 ; }/**
Signature · 1 line
2.39.0
Tom Talpey
reviewerQuoted 22 lines · Lu Hongfei
Remove unneeded variable:ret and return 0 at the end of the function
Signed-off-by Lu Hongfei <[email protected]>--- fs/smb/server/vfs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)mode change 100644 => 100755
fs/smb/server/vfs.cfs/smb/server/vfs.c +0
-2@@ -120,8 +120,6 @@ static int ksmbd_vfs_path_lookup_locked(struct ksmbd_share_config *share_conf,int ksmbd_vfs_query_maximal_access (struct mnt_idmap *idmap,struct dentry *dentry,__le32 *daccess) { -int ret =0 ; - *daccess =cpu_to_le32 (FILE_READ_ATTRIBUTES |READ_CONTROL );if (!inode_permission (idmap,d_inode (dentry),MAY_OPEN |MAY_WRITE ))
fs/smb/server/vfs.c int ksmbd_vfs_query_maximal_access(struct mnt_idmap *idmap, · line 141
Quoted 6 lines
fs/smb/server/vfs.c +1
-1@@ -139,7 +137,7 @@ int ksmbd_vfs_query_maximal_access(struct mnt_idmap *idmap,if (!inode_permission (idmap,d_inode (dentry->d_parent),MAY_EXEC |MAY_WRITE )) *daccess |=FILE_DELETE_LE ; -return ret; +return 0 ; }
I don't see this function being called at all. Let's either delete it, or change it to void.
Tom.