diff mbox series

[2/7] cifs: Avoid a cast in add_durable_context()

Message ID 01742c6a372345dce723d3511a41d21753b8aeee.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 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 3eb745237459..cebb8d9837d2 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -2285,10 +2285,10 @@  add_durable_reconnect_v2_context(struct kvec *iov, unsigned int *num_iovec,
 }
 
 static int
-add_durable_context(struct kvec *iov, unsigned int *num_iovec,
+add_durable_context(struct smb2_create_req *req,
+		    struct kvec *iov, unsigned int *num_iovec,
 		    struct cifs_open_parms *oparms, bool use_persistent)
 {
-	struct smb2_create_req *req = iov[0].iov_base;
 	unsigned int num = *num_iovec;
 
 	if (use_persistent) {
@@ -2849,7 +2849,7 @@  SMB2_open_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server,
 				cpu_to_le32(server->vals->create_lease_size);
 		}
 
-		rc = add_durable_context(iov, &n_iov, oparms,
+		rc = add_durable_context(req, iov, &n_iov, oparms,
 					tcon->use_persistent);
 		if (rc)
 			return rc;