diff mbox series

smb: Remove unnecessary variables

Message ID 20230530092055.16919-1-luhongfei@vivo.com (mailing list archive)
State New, archived
Headers show
Series smb: Remove unnecessary variables | expand

Commit Message

Lu Hongfei May 30, 2023, 9:20 a.m. UTC
Remove unneeded variable:ret and return 0 at the end of the function

Signed-off-by: Lu Hongfei <luhongfei@vivo.com>
---
 fs/smb/server/vfs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
 mode change 100644 => 100755 fs/smb/server/vfs.c

Comments

Tom Talpey May 30, 2023, 11:21 a.m. UTC | #1
On 5/30/2023 5:20 AM, Lu Hongfei wrote:
> Remove unneeded variable:ret and return 0 at the end of the function
> 
> Signed-off-by: Lu Hongfei <luhongfei@vivo.com>
> ---
>   fs/smb/server/vfs.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>   mode change 100644 => 100755 fs/smb/server/vfs.c
> 
> diff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c
> index 778c152708e4..cb3fc71cc59f
> --- a/fs/smb/server/vfs.c
> +++ b/fs/smb/server/vfs.c
> @@ -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;
>   }

I don't see this function being called at all. Let's either
delete it, or change it to void.

Tom.
diff mbox series

Patch

diff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c
index 778c152708e4..cb3fc71cc59f
--- a/fs/smb/server/vfs.c
+++ b/fs/smb/server/vfs.c
@@ -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;
 }
 
 /**