[PATCH] cifs: remove redundant assignment to pointer p

Colin Ian King posted 1 patch 4 years, 6 months ago
fs/cifs/cifsfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] cifs: remove redundant assignment to pointer p
Posted by Colin Ian King 4 years, 6 months ago
The pointer p is being assigned with a value that is never read. The
pointer is being re-assigned a different value inside the do-while
loop. The assignment is redundant and can be removed.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 fs/cifs/cifsfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index d3f3acf340f1..61091eed8c65 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -775,7 +775,7 @@ cifs_get_root(struct smb3_fs_context *ctx, struct super_block *sb)
 
 	sep = CIFS_DIR_SEP(cifs_sb);
 	dentry = dget(sb->s_root);
-	p = s = full_path;
+	s = full_path;
 
 	do {
 		struct inode *dir = d_inode(dentry);
-- 
2.32.0

Re: [PATCH] cifs: remove redundant assignment to pointer p
Posted by Steve French 4 years, 6 months ago
merged into cifs-2.6.git for-next

On Mon, Dec 20, 2021 at 8:01 PM Colin Ian King <colin.i.king@gmail.com> wrote:
>
> The pointer p is being assigned with a value that is never read. The
> pointer is being re-assigned a different value inside the do-while
> loop. The assignment is redundant and can be removed.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>  fs/cifs/cifsfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
> index d3f3acf340f1..61091eed8c65 100644
> --- a/fs/cifs/cifsfs.c
> +++ b/fs/cifs/cifsfs.c
> @@ -775,7 +775,7 @@ cifs_get_root(struct smb3_fs_context *ctx, struct super_block *sb)
>
>         sep = CIFS_DIR_SEP(cifs_sb);
>         dentry = dget(sb->s_root);
> -       p = s = full_path;
> +       s = full_path;
>
>         do {
>                 struct inode *dir = d_inode(dentry);
> --
> 2.32.0
>


-- 
Thanks,

Steve