* [PATCH] smb: client: remove unused variable 'server'
@ 2023-07-02 13:03 Tom Rix
2023-07-02 23:36 ` Steve French
0 siblings, 1 reply; 2+ messages in thread
From: Tom Rix @ 2023-07-02 13:03 UTC (permalink / raw)
To: sfrench, pc, lsahlber, sprasad, tom
Cc: linux-cifs, samba-technical, linux-kernel, Tom Rix
gcc with W=1 reports
fs/smb/client/dfs.c: In function ‘__dfs_mount_share’:
fs/smb/client/dfs.c:146:33: error: variable ‘server
set but not used [-Werror=unused-but-set-variable]
146 | struct TCP_Server_Info *server;
| ^~~~~~
This variable is not used, so remove it.
Signed-off-by: Tom Rix <trix@redhat.com>
---
fs/smb/client/dfs.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/fs/smb/client/dfs.c b/fs/smb/client/dfs.c
index 26d14dd0482e..1403a2d1ab17 100644
--- a/fs/smb/client/dfs.c
+++ b/fs/smb/client/dfs.c
@@ -143,7 +143,6 @@ static int __dfs_mount_share(struct cifs_mount_ctx *mnt_ctx)
struct smb3_fs_context *ctx = mnt_ctx->fs_ctx;
char *ref_path = NULL, *full_path = NULL;
struct dfs_cache_tgt_iterator *tit;
- struct TCP_Server_Info *server;
struct cifs_tcon *tcon;
char *origin_fullpath = NULL;
char sep = CIFS_DIR_SEP(cifs_sb);
@@ -214,7 +213,6 @@ static int __dfs_mount_share(struct cifs_mount_ctx *mnt_ctx)
} while (rc == -EREMOTE);
if (!rc) {
- server = mnt_ctx->server;
tcon = mnt_ctx->tcon;
spin_lock(&tcon->tc_lock);
--
2.27.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] smb: client: remove unused variable 'server'
2023-07-02 13:03 [PATCH] smb: client: remove unused variable 'server' Tom Rix
@ 2023-07-02 23:36 ` Steve French
0 siblings, 0 replies; 2+ messages in thread
From: Steve French @ 2023-07-02 23:36 UTC (permalink / raw)
To: Tom Rix
Cc: sfrench, pc, lsahlber, sprasad, tom, linux-cifs, samba-technical,
linux-kernel, Colin Ian King
Good catch - but this was removed a few days ago by Colin's patch
smfrench@smfrench-ThinkPad-P52:~/cifs-2.6$ git log fs/smb/client/dfs.c
commit dfbf0ee092a5d7a9301c81e815b5e50b7c0aeeda
Author: Colin Ian King <colin.i.king@gmail.com>
Date: Fri Jun 30 12:33:37 2023 +0100
smb: client: remove redundant pointer 'server'
The pointer 'server' is assigned but never read, the pointer is
redundant and can be removed. Cleans up clang scan build warning:
fs/smb/client/dfs.c:217:3: warning: Value stored to 'server' is
never read [deadcode.DeadStores]
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
On Sun, Jul 2, 2023 at 8:43 AM Tom Rix <trix@redhat.com> wrote:
>
> gcc with W=1 reports
> fs/smb/client/dfs.c: In function ‘__dfs_mount_share’:
> fs/smb/client/dfs.c:146:33: error: variable ‘server
> set but not used [-Werror=unused-but-set-variable]
> 146 | struct TCP_Server_Info *server;
> | ^~~~~~
>
> This variable is not used, so remove it.
>
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
> fs/smb/client/dfs.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/fs/smb/client/dfs.c b/fs/smb/client/dfs.c
> index 26d14dd0482e..1403a2d1ab17 100644
> --- a/fs/smb/client/dfs.c
> +++ b/fs/smb/client/dfs.c
> @@ -143,7 +143,6 @@ static int __dfs_mount_share(struct cifs_mount_ctx *mnt_ctx)
> struct smb3_fs_context *ctx = mnt_ctx->fs_ctx;
> char *ref_path = NULL, *full_path = NULL;
> struct dfs_cache_tgt_iterator *tit;
> - struct TCP_Server_Info *server;
> struct cifs_tcon *tcon;
> char *origin_fullpath = NULL;
> char sep = CIFS_DIR_SEP(cifs_sb);
> @@ -214,7 +213,6 @@ static int __dfs_mount_share(struct cifs_mount_ctx *mnt_ctx)
> } while (rc == -EREMOTE);
>
> if (!rc) {
> - server = mnt_ctx->server;
> tcon = mnt_ctx->tcon;
>
> spin_lock(&tcon->tc_lock);
> --
> 2.27.0
>
--
Thanks,
Steve
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-02 23:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-02 13:03 [PATCH] smb: client: remove unused variable 'server' Tom Rix
2023-07-02 23:36 ` Steve French
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®