diff options
| author | Christos Gkekas <chris.gekas@gmail.com> | 2017-07-09 06:45:04 -0400 |
|---|---|---|
| committer | Steve French <smfrench@gmail.com> | 2017-07-10 00:38:00 -0400 |
| commit | 68a6afa7fad2644e6b575aba2f2fbda81e730e5b (patch) | |
| tree | d710ce28f56988eab32da723fbeae265b7d51da4 | |
| parent | eef914a9eb5eb83e60eb498315a491cd1edc13a1 (diff) | |
cifs: Clean up unused variables in smb2pdu.c
There are multiple unused variables struct TCP_Server_Info *server
defined in many methods in smb2pdu.c. They should be removed and related
logic simplified.
Signed-off-by: Christos Gkekas <chris.gekas@gmail.com>
Signed-off-by: Steve French <smfrench@gmail.com>
| -rw-r--r-- | fs/cifs/smb2pdu.c | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index c3c8eaff56df..5fb2fc2d0080 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c | |||
| @@ -1167,15 +1167,12 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, | |||
| 1167 | int rc = 0; | 1167 | int rc = 0; |
| 1168 | int resp_buftype; | 1168 | int resp_buftype; |
| 1169 | int unc_path_len; | 1169 | int unc_path_len; |
| 1170 | struct TCP_Server_Info *server; | ||
| 1171 | __le16 *unc_path = NULL; | 1170 | __le16 *unc_path = NULL; |
| 1172 | int flags = 0; | 1171 | int flags = 0; |
| 1173 | 1172 | ||
| 1174 | cifs_dbg(FYI, "TCON\n"); | 1173 | cifs_dbg(FYI, "TCON\n"); |
| 1175 | 1174 | ||
| 1176 | if ((ses->server) && tree) | 1175 | if (!(ses->server) || !tree) |
| 1177 | server = ses->server; | ||
| 1178 | else | ||
| 1179 | return -EIO; | 1176 | return -EIO; |
| 1180 | 1177 | ||
| 1181 | unc_path = kmalloc(MAX_SHARENAME_LENGTH * 2, GFP_KERNEL); | 1178 | unc_path = kmalloc(MAX_SHARENAME_LENGTH * 2, GFP_KERNEL); |
| @@ -1294,15 +1291,12 @@ SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon) | |||
| 1294 | { | 1291 | { |
| 1295 | struct smb2_tree_disconnect_req *req; /* response is trivial */ | 1292 | struct smb2_tree_disconnect_req *req; /* response is trivial */ |
| 1296 | int rc = 0; | 1293 | int rc = 0; |
| 1297 | struct TCP_Server_Info *server; | ||
| 1298 | struct cifs_ses *ses = tcon->ses; | 1294 | struct cifs_ses *ses = tcon->ses; |
| 1299 | int flags = 0; | 1295 | int flags = 0; |
| 1300 | 1296 | ||
| 1301 | cifs_dbg(FYI, "Tree Disconnect\n"); | 1297 | cifs_dbg(FYI, "Tree Disconnect\n"); |
| 1302 | 1298 | ||
| 1303 | if (ses && (ses->server)) | 1299 | if (!ses || !(ses->server)) |
| 1304 | server = ses->server; | ||
| 1305 | else | ||
| 1306 | return -EIO; | 1300 | return -EIO; |
| 1307 | 1301 | ||
| 1308 | if ((tcon->need_reconnect) || (tcon->ses->need_reconnect)) | 1302 | if ((tcon->need_reconnect) || (tcon->ses->need_reconnect)) |
| @@ -1794,7 +1788,6 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, | |||
| 1794 | struct smb2_ioctl_req *req; | 1788 | struct smb2_ioctl_req *req; |
| 1795 | struct smb2_ioctl_rsp *rsp; | 1789 | struct smb2_ioctl_rsp *rsp; |
| 1796 | struct smb2_sync_hdr *shdr; | 1790 | struct smb2_sync_hdr *shdr; |
| 1797 | struct TCP_Server_Info *server; | ||
| 1798 | struct cifs_ses *ses; | 1791 | struct cifs_ses *ses; |
| 1799 | struct kvec iov[2]; | 1792 | struct kvec iov[2]; |
| 1800 | struct kvec rsp_iov; | 1793 | struct kvec rsp_iov; |
| @@ -1817,9 +1810,7 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, | |||
| 1817 | else | 1810 | else |
| 1818 | return -EIO; | 1811 | return -EIO; |
| 1819 | 1812 | ||
| 1820 | if (ses && (ses->server)) | 1813 | if (!ses || !(ses->server)) |
| 1821 | server = ses->server; | ||
| 1822 | else | ||
| 1823 | return -EIO; | 1814 | return -EIO; |
| 1824 | 1815 | ||
| 1825 | rc = small_smb2_init(SMB2_IOCTL, tcon, (void **) &req); | 1816 | rc = small_smb2_init(SMB2_IOCTL, tcon, (void **) &req); |
| @@ -1977,7 +1968,6 @@ SMB2_close(const unsigned int xid, struct cifs_tcon *tcon, | |||
| 1977 | { | 1968 | { |
| 1978 | struct smb2_close_req *req; | 1969 | struct smb2_close_req *req; |
| 1979 | struct smb2_close_rsp *rsp; | 1970 | struct smb2_close_rsp *rsp; |
| 1980 | struct TCP_Server_Info *server; | ||
| 1981 | struct cifs_ses *ses = tcon->ses; | 1971 | struct cifs_ses *ses = tcon->ses; |
| 1982 | struct kvec iov[1]; | 1972 | struct kvec iov[1]; |
| 1983 | struct kvec rsp_iov; | 1973 | struct kvec rsp_iov; |
| @@ -1987,9 +1977,7 @@ SMB2_close(const unsigned int xid, struct cifs_tcon *tcon, | |||
| 1987 | 1977 | ||
| 1988 | cifs_dbg(FYI, "Close\n"); | 1978 | cifs_dbg(FYI, "Close\n"); |
| 1989 | 1979 | ||
| 1990 | if (ses && (ses->server)) | 1980 | if (!ses || !(ses->server)) |
| 1991 | server = ses->server; | ||
| 1992 | else | ||
| 1993 | return -EIO; | 1981 | return -EIO; |
| 1994 | 1982 | ||
| 1995 | rc = small_smb2_init(SMB2_CLOSE, tcon, (void **) &req); | 1983 | rc = small_smb2_init(SMB2_CLOSE, tcon, (void **) &req); |
| @@ -2091,15 +2079,12 @@ query_info(const unsigned int xid, struct cifs_tcon *tcon, | |||
| 2091 | struct kvec rsp_iov; | 2079 | struct kvec rsp_iov; |
| 2092 | int rc = 0; | 2080 | int rc = 0; |
| 2093 | int resp_buftype; | 2081 | int resp_buftype; |
| 2094 | struct TCP_Server_Info *server; | ||
| 2095 | struct cifs_ses *ses = tcon->ses; | 2082 | struct cifs_ses *ses = tcon->ses; |
| 2096 | int flags = 0; | 2083 | int flags = 0; |
| 2097 | 2084 | ||
| 2098 | cifs_dbg(FYI, "Query Info\n"); | 2085 | cifs_dbg(FYI, "Query Info\n"); |
| 2099 | 2086 | ||
| 2100 | if (ses && (ses->server)) | 2087 | if (!ses || !(ses->server)) |
| 2101 | server = ses->server; | ||
| 2102 | else | ||
| 2103 | return -EIO; | 2088 | return -EIO; |
| 2104 | 2089 | ||
| 2105 | rc = small_smb2_init(SMB2_QUERY_INFO, tcon, (void **) &req); | 2090 | rc = small_smb2_init(SMB2_QUERY_INFO, tcon, (void **) &req); |
| @@ -2311,7 +2296,6 @@ SMB2_flush(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, | |||
| 2311 | u64 volatile_fid) | 2296 | u64 volatile_fid) |
| 2312 | { | 2297 | { |
| 2313 | struct smb2_flush_req *req; | 2298 | struct smb2_flush_req *req; |
| 2314 | struct TCP_Server_Info *server; | ||
| 2315 | struct cifs_ses *ses = tcon->ses; | 2299 | struct cifs_ses *ses = tcon->ses; |
| 2316 | struct kvec iov[1]; | 2300 | struct kvec iov[1]; |
| 2317 | struct kvec rsp_iov; | 2301 | struct kvec rsp_iov; |
| @@ -2321,9 +2305,7 @@ SMB2_flush(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, | |||
| 2321 | 2305 | ||
| 2322 | cifs_dbg(FYI, "Flush\n"); | 2306 | cifs_dbg(FYI, "Flush\n"); |
| 2323 | 2307 | ||
| 2324 | if (ses && (ses->server)) | 2308 | if (!ses || !(ses->server)) |
| 2325 | server = ses->server; | ||
| 2326 | else | ||
| 2327 | return -EIO; | 2309 | return -EIO; |
| 2328 | 2310 | ||
| 2329 | rc = small_smb2_init(SMB2_FLUSH, tcon, (void **) &req); | 2311 | rc = small_smb2_init(SMB2_FLUSH, tcon, (void **) &req); |
| @@ -3011,13 +2993,10 @@ send_set_info(const unsigned int xid, struct cifs_tcon *tcon, | |||
| 3011 | int rc = 0; | 2993 | int rc = 0; |
| 3012 | int resp_buftype; | 2994 | int resp_buftype; |
| 3013 | unsigned int i; | 2995 | unsigned int i; |
| 3014 | struct TCP_Server_Info *server; | ||
| 3015 | struct cifs_ses *ses = tcon->ses; | 2996 | struct cifs_ses *ses = tcon->ses; |
| 3016 | int flags = 0; | 2997 | int flags = 0; |
| 3017 | 2998 | ||
| 3018 | if (ses && (ses->server)) | 2999 | if (!ses || !(ses->server)) |
| 3019 | server = ses->server; | ||
| 3020 | else | ||
| 3021 | return -EIO; | 3000 | return -EIO; |
| 3022 | 3001 | ||
| 3023 | if (!num) | 3002 | if (!num) |
