All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] cifs: remove set but not used variable 'server'
@ 2020-01-17  2:57 YueHaibing
  2020-01-17  7:53 ` Steve French
  0 siblings, 1 reply; 4+ messages in thread
From: YueHaibing @ 2020-01-17  2:57 UTC (permalink / raw)
  To: sfrench, pshilov, lsahlber
  Cc: linux-cifs, samba-technical, linux-kernel, YueHaibing

fs/cifs/smb2pdu.c: In function 'SMB2_query_directory':
fs/cifs/smb2pdu.c:4444:26: warning:
 variable 'server' set but not used [-Wunused-but-set-variable]
  struct TCP_Server_Info *server;

It is not used, so remove it.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 fs/cifs/smb2pdu.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index a23ca3d..64d5a36 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -4441,13 +4441,10 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon,
 	int resp_buftype = CIFS_NO_BUFFER;
 	struct kvec rsp_iov;
 	int rc = 0;
-	struct TCP_Server_Info *server;
 	struct cifs_ses *ses = tcon->ses;
 	int flags = 0;
 
-	if (ses && (ses->server))
-		server = ses->server;
-	else
+	if (!ses || !(ses->server))
 		return -EIO;
 
 	if (smb3_encryption_required(tcon))
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] cifs: remove set but not used variable 'server'
  2020-01-17  2:57 [PATCH -next] cifs: remove set but not used variable 'server' YueHaibing
@ 2020-01-17  7:53 ` Steve French
  0 siblings, 0 replies; 4+ messages in thread
From: Steve French @ 2020-01-17  7:53 UTC (permalink / raw)
  To: YueHaibing
  Cc: Steve French, Pavel Shilovskiy, Ronnie Sahlberg, CIFS,
	samba-technical, LKML

merged into cifs-2.6.git for-next

On Thu, Jan 16, 2020 at 10:01 PM YueHaibing <yuehaibing@huawei.com> wrote:
>
> fs/cifs/smb2pdu.c: In function 'SMB2_query_directory':
> fs/cifs/smb2pdu.c:4444:26: warning:
>  variable 'server' set but not used [-Wunused-but-set-variable]
>   struct TCP_Server_Info *server;
>
> It is not used, so remove it.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  fs/cifs/smb2pdu.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
> index a23ca3d..64d5a36 100644
> --- a/fs/cifs/smb2pdu.c
> +++ b/fs/cifs/smb2pdu.c
> @@ -4441,13 +4441,10 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon,
>         int resp_buftype = CIFS_NO_BUFFER;
>         struct kvec rsp_iov;
>         int rc = 0;
> -       struct TCP_Server_Info *server;
>         struct cifs_ses *ses = tcon->ses;
>         int flags = 0;
>
> -       if (ses && (ses->server))
> -               server = ses->server;
> -       else
> +       if (!ses || !(ses->server))
>                 return -EIO;
>
>         if (smb3_encryption_required(tcon))
> --
> 2.7.4
>
>


-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] cifs: remove set but not used variable 'server'
  2018-09-06  1:50 [PATCH -next] cifs: remove set but not used variable 'cifs_sb' YueHaibing
  2018-12-18  2:51 ` [PATCH -next] cifs: remove set but not used variable 'server' YueHaibing
@ 2018-12-18  4:20 ` Steve French
  1 sibling, 0 replies; 4+ messages in thread
From: Steve French @ 2018-12-18  4:20 UTC (permalink / raw)
  To: kernel-janitors

merged into cifs-2.6.git for-next

On Mon, Dec 17, 2018 at 8:44 PM YueHaibing <yuehaibing@huawei.com> wrote:
>
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> fs/cifs/smb2pdu.c: In function 'smb311_posix_mkdir':
> fs/cifs/smb2pdu.c:2040:26: warning:
>  variable 'server' set but not used [-Wunused-but-set-variable]
>
> fs/cifs/smb2pdu.c: In function 'build_qfs_info_req':
> fs/cifs/smb2pdu.c:4067:26: warning:
>  variable 'server' set but not used [-Wunused-but-set-variable]
>
> The first 'server' never used since commit bea851b8babe ("smb3: Fix mode on
> mkdir on smb311 mounts")
> And the second not used since commit 1fc6ad2f10ad ("cifs: remove
> header_preamble_size where it is always 0")
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  fs/cifs/smb2pdu.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
> index 69e99b6..e283590 100644
> --- a/fs/cifs/smb2pdu.c
> +++ b/fs/cifs/smb2pdu.c
> @@ -2037,7 +2037,6 @@ int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
>         struct smb_rqst rqst;
>         struct smb2_create_req *req;
>         struct smb2_create_rsp *rsp = NULL;
> -       struct TCP_Server_Info *server;
>         struct cifs_ses *ses = tcon->ses;
>         struct kvec iov[3]; /* make sure at least one for each open context */
>         struct kvec rsp_iov = {NULL, 0};
> @@ -2060,9 +2059,7 @@ int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
>         if (!utf16_path)
>                 return -ENOMEM;
>
> -       if (ses && (ses->server))
> -               server = ses->server;
> -       else {
> +       if (!ses || !(ses->server)) {
>                 rc = -EIO;
>                 goto err_free_path;
>         }
> @@ -4064,7 +4061,6 @@ void smb2_reconnect_server(struct work_struct *work)
>  build_qfs_info_req(struct kvec *iov, struct cifs_tcon *tcon, int level,
>                    int outbuf_len, u64 persistent_fid, u64 volatile_fid)
>  {
> -       struct TCP_Server_Info *server;
>         int rc;
>         struct smb2_query_info_req *req;
>         unsigned int total_len;
> @@ -4074,8 +4070,6 @@ void smb2_reconnect_server(struct work_struct *work)
>         if ((tcon->ses = NULL) || (tcon->ses->server = NULL))
>                 return -EIO;
>
> -       server = tcon->ses->server;
> -
>         rc = smb2_plain_req_init(SMB2_QUERY_INFO, tcon, (void **) &req,
>                              &total_len);
>         if (rc)
>
>
>


-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH -next] cifs: remove set but not used variable 'server'
  2018-09-06  1:50 [PATCH -next] cifs: remove set but not used variable 'cifs_sb' YueHaibing
@ 2018-12-18  2:51 ` YueHaibing
  2018-12-18  4:20 ` Steve French
  1 sibling, 0 replies; 4+ messages in thread
From: YueHaibing @ 2018-12-18  2:51 UTC (permalink / raw)
  To: kernel-janitors

Fixes gcc '-Wunused-but-set-variable' warning:

fs/cifs/smb2pdu.c: In function 'smb311_posix_mkdir':
fs/cifs/smb2pdu.c:2040:26: warning:
 variable 'server' set but not used [-Wunused-but-set-variable]

fs/cifs/smb2pdu.c: In function 'build_qfs_info_req':
fs/cifs/smb2pdu.c:4067:26: warning:
 variable 'server' set but not used [-Wunused-but-set-variable]

The first 'server' never used since commit bea851b8babe ("smb3: Fix mode on
mkdir on smb311 mounts")
And the second not used since commit 1fc6ad2f10ad ("cifs: remove
header_preamble_size where it is always 0")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 fs/cifs/smb2pdu.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 69e99b6..e283590 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -2037,7 +2037,6 @@ int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
 	struct smb_rqst rqst;
 	struct smb2_create_req *req;
 	struct smb2_create_rsp *rsp = NULL;
-	struct TCP_Server_Info *server;
 	struct cifs_ses *ses = tcon->ses;
 	struct kvec iov[3]; /* make sure at least one for each open context */
 	struct kvec rsp_iov = {NULL, 0};
@@ -2060,9 +2059,7 @@ int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
 	if (!utf16_path)
 		return -ENOMEM;
 
-	if (ses && (ses->server))
-		server = ses->server;
-	else {
+	if (!ses || !(ses->server)) {
 		rc = -EIO;
 		goto err_free_path;
 	}
@@ -4064,7 +4061,6 @@ void smb2_reconnect_server(struct work_struct *work)
 build_qfs_info_req(struct kvec *iov, struct cifs_tcon *tcon, int level,
 		   int outbuf_len, u64 persistent_fid, u64 volatile_fid)
 {
-	struct TCP_Server_Info *server;
 	int rc;
 	struct smb2_query_info_req *req;
 	unsigned int total_len;
@@ -4074,8 +4070,6 @@ void smb2_reconnect_server(struct work_struct *work)
 	if ((tcon->ses = NULL) || (tcon->ses->server = NULL))
 		return -EIO;
 
-	server = tcon->ses->server;
-
 	rc = smb2_plain_req_init(SMB2_QUERY_INFO, tcon, (void **) &req,
 			     &total_len);
 	if (rc)

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-01-17  7:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-17  2:57 [PATCH -next] cifs: remove set but not used variable 'server' YueHaibing
2020-01-17  7:53 ` Steve French
  -- strict thread matches above, loose matches on Subject: below --
2018-09-06  1:50 [PATCH -next] cifs: remove set but not used variable 'cifs_sb' YueHaibing
2018-12-18  2:51 ` [PATCH -next] cifs: remove set but not used variable 'server' YueHaibing
2018-12-18  4:20 ` Steve French

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.