diff mbox series

[5/7] cifs: Avoid a cast in add_durable_v2_context()

Message ID ba67f406d3ef0e125995902e7de5a59a70e5a193.1679051552.git.vl@samba.org (mailing list archive)
State New, archived
Headers show
Series Avoid a few casts from void * | expand

Commit Message

Volker Lendecke March 17, 2023, 11:15 a.m. UTC
We have the correctly-typed struct smb2_create_req * available in the
caller.

Signed-off-by: Volker Lendecke <vl@samba.org>
---
 fs/cifs/smb2pdu.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 91fc0ad3e1b4..6d4a14efa79f 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -2241,10 +2241,10 @@  create_reconnect_durable_v2_buf(struct cifs_fid *fid)
 }
 
 static int
-add_durable_v2_context(struct kvec *iov, unsigned int *num_iovec,
+add_durable_v2_context(struct smb2_create_req *req,
+		       struct kvec *iov, unsigned int *num_iovec,
 		    struct cifs_open_parms *oparms)
 {
-	struct smb2_create_req *req = iov[0].iov_base;
 	unsigned int num = *num_iovec;
 
 	iov[num].iov_base = create_durable_v2_buf(oparms);
@@ -2296,7 +2296,8 @@  add_durable_context(struct smb2_create_req *req,
 			return add_durable_reconnect_v2_context(iov, num_iovec,
 								oparms);
 		else
-			return add_durable_v2_context(iov, num_iovec, oparms);
+			return add_durable_v2_context(req, iov, num_iovec,
+						      oparms);
 	}
 
 	if (oparms->reconnect) {