linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Volker Lendecke <vl@samba.org>
To: linux-cifs@vger.kernel.org
Cc: Volker Lendecke <vl@samba.org>
Subject: [PATCH 02/10] cifs: Make "resp_buf_type" initialization consistent
Date: Wed, 15 Mar 2023 13:05:23 +0000	[thread overview]
Message-ID: <715459412f19853c56156b8c0ce39fe74f148860.1678885349.git.vl@samba.org> (raw)
In-Reply-To: <cover.1678885349.git.vl@samba.org>

The majority of cifs_send_recv() do not initialize resp_buf_type, make
this consistent in all callers. Probably does not make a difference in
performance, but the consistency improves readability.

Signed-off-by: Volker Lendecke <vl@samba.org>
---
 fs/cifs/cifssmb.c |  6 +++---
 fs/cifs/smb2pdu.c | 14 +++++++-------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index a43c78396dd8..1f02c66e5716 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -1378,7 +1378,7 @@ CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms,
 	READ_RSP *pSMBr = NULL;
 	char *pReadData = NULL;
 	int wct;
-	int resp_buf_type = 0;
+	int resp_buf_type;
 	struct kvec iov[1];
 	struct kvec rsp_iov;
 	__u32 pid = io_parms->pid;
@@ -1742,7 +1742,7 @@ CIFSSMBWrite2(const unsigned int xid, struct cifs_io_parms *io_parms,
 	WRITE_REQ *pSMB = NULL;
 	int wct;
 	int smb_hdr_len;
-	int resp_buf_type = 0;
+	int resp_buf_type;
 	__u32 pid = io_parms->pid;
 	__u16 netfid = io_parms->netfid;
 	__u64 offset = io_parms->offset;
@@ -1966,7 +1966,7 @@ CIFSSMBPosixLock(const unsigned int xid, struct cifs_tcon *tcon,
 	int rc = 0;
 	int timeout = 0;
 	int bytes_returned = 0;
-	int resp_buf_type = 0;
+	int resp_buf_type;
 	__u16 params, param_offset, offset, byte_count, count;
 	struct kvec iov[1];
 	struct kvec rsp_iov;
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 0e53265e1462..dede2d422c1f 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -2952,7 +2952,7 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path,
 	struct TCP_Server_Info *server = cifs_pick_channel(ses);
 	struct kvec iov[SMB2_CREATE_IOV_SIZE];
 	struct kvec rsp_iov = {NULL, 0};
-	int resp_buftype = CIFS_NO_BUFFER;
+	int resp_buftype;
 	int rc = 0;
 	int flags = 0;
 
@@ -3149,7 +3149,7 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
 	struct TCP_Server_Info *server;
 	struct kvec iov[SMB2_IOCTL_IOV_SIZE];
 	struct kvec rsp_iov = {NULL, 0};
-	int resp_buftype = CIFS_NO_BUFFER;
+	int resp_buftype;
 	int rc = 0;
 	int flags = 0;
 
@@ -3330,7 +3330,7 @@ __SMB2_close(const unsigned int xid, struct cifs_tcon *tcon,
 	struct TCP_Server_Info *server = cifs_pick_channel(ses);
 	struct kvec iov[1];
 	struct kvec rsp_iov;
-	int resp_buftype = CIFS_NO_BUFFER;
+	int resp_buftype;
 	int rc = 0;
 	int flags = 0;
 	bool query_attrs = false;
@@ -3514,7 +3514,7 @@ query_info(const unsigned int xid, struct cifs_tcon *tcon,
 	struct kvec iov[1];
 	struct kvec rsp_iov;
 	int rc = 0;
-	int resp_buftype = CIFS_NO_BUFFER;
+	int resp_buftype;
 	struct cifs_ses *ses = tcon->ses;
 	struct TCP_Server_Info *server;
 	int flags = 0;
@@ -3693,7 +3693,7 @@ SMB2_change_notify(const unsigned int xid, struct cifs_tcon *tcon,
 	struct smb2_change_notify_rsp *smb_rsp;
 	struct kvec iov[1];
 	struct kvec rsp_iov = {NULL, 0};
-	int resp_buftype = CIFS_NO_BUFFER;
+	int resp_buftype;
 	int flags = 0;
 	int rc = 0;
 
@@ -3983,7 +3983,7 @@ SMB2_flush(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
 	struct kvec iov[1];
 	struct kvec rsp_iov = {NULL, 0};
 	struct TCP_Server_Info *server = cifs_pick_channel(ses);
-	int resp_buftype = CIFS_NO_BUFFER;
+	int resp_buftype;
 	int flags = 0;
 	int rc = 0;
 
@@ -5016,7 +5016,7 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon,
 	struct smb_rqst rqst;
 	struct kvec iov[SMB2_QUERY_DIRECTORY_IOV_SIZE];
 	struct smb2_query_directory_rsp *rsp = NULL;
-	int resp_buftype = CIFS_NO_BUFFER;
+	int resp_buftype;
 	struct kvec rsp_iov;
 	int rc = 0;
 	struct cifs_ses *ses = tcon->ses;
-- 
2.30.2


  parent reply	other threads:[~2023-03-15 13:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-15 13:05 [PATCH 00/10] Some cleanups for fs/cifs Volker Lendecke
2023-03-15 13:05 ` [PATCH 01/10] cifs: Simplify some callers of compound_send_recv() Volker Lendecke
2023-03-15 13:05 ` Volker Lendecke [this message]
2023-03-15 19:33   ` [PATCH 02/10] cifs: Make "resp_buf_type" initialization consistent kernel test robot
2023-03-20  5:57   ` Dan Carpenter
2023-03-15 13:05 ` [PATCH 03/10] cifs: Slightly simplify cifs_readdir() Volker Lendecke
2023-03-15 13:05 ` [PATCH 04/10] " Volker Lendecke
2023-03-15 13:05 ` [PATCH 05/10] cifs: Simplify SMB2_OP_RMDIR with CREATE_DELETE_ON_CLOSE Volker Lendecke
2023-03-15 13:05 ` [PATCH 06/10] cifs: Slightly refactor smb2_compound_op() Volker Lendecke
2023-03-15 13:05 ` [PATCH 07/10] cifs: Reduce copy&paste in smb2_compound_op() Volker Lendecke
2023-03-15 13:05 ` [PATCH 08/10] cifs: Avoid two "else" branches Volker Lendecke
2023-03-15 13:05 ` [PATCH 09/10] cifs: Store smb3_create_tag_posix just once Volker Lendecke
2023-03-15 13:05 ` [PATCH 10/10] cifs: Use switch/case to dissect negprot reply ctxts Volker Lendecke
2023-03-15 14:49 ` [PATCH 00/10] Some cleanups for fs/cifs Tom Talpey

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=715459412f19853c56156b8c0ce39fe74f148860.1678885349.git.vl@samba.org \
    --to=vl@samba.org \
    --cc=linux-cifs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).