All of lore.kernel.org
 help / color / mirror / Atom feed
From: YueHaibing <yuehaibing@huawei.com>
To: kernel-janitors@vger.kernel.org
Subject: [PATCH -next] cifs: remove set but not used variable 'server'
Date: Tue, 18 Dec 2018 02:51:51 +0000	[thread overview]
Message-ID: <1545101511-73531-1-git-send-email-yuehaibing@huawei.com> (raw)
In-Reply-To: <1536198643-6123-1-git-send-email-yuehaibing@huawei.com>

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)

  parent reply	other threads:[~2018-12-18  2:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06  1:50 [PATCH -next] cifs: remove set but not used variable 'cifs_sb' YueHaibing
2018-09-06 17:57 ` Steve French
2018-11-08 11:36 ` [PATCH -next] cifs: remove set but not used variable 'cifsi' YueHaibing
2018-12-07  6:57 ` [PATCH -next] cifs: remove set but not used variable 'smb_buf' YueHaibing
2018-12-07  7:27 ` Steve French
2018-12-18  1:35 ` [PATCH -next] cifs: remove set but not used variable 'sep' YueHaibing
2018-12-18  1:59 ` Steve French
2018-12-18  2:51 ` YueHaibing [this message]
2018-12-18  4:20 ` [PATCH -next] cifs: remove set but not used variable 'server' Steve French
2019-10-17  3:53 [PATCH -next] CIFS: remove set but not used variables 'cinode' and 'netfid' YueHaibing
2019-10-17  3:53 ` YueHaibing
2019-10-19 15:32 ` Steve French
2019-10-19 15:32   ` Steve French
2020-01-17  2:57 [PATCH -next] cifs: remove set but not used variable 'server' YueHaibing
2020-01-17  7:53 ` Steve French

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1545101511-73531-1-git-send-email-yuehaibing@huawei.com \
    --to=yuehaibing@huawei.com \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.