diff mbox series

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

Message ID fdbbd11b8aa2363f01e6748f23d9dc253ba31e18.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 9e9267da28a2..2ea7e211391f 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -2524,9 +2524,9 @@  create_query_id_buf(void)
 
 /* See MS-SMB2 2.2.13.2.9 */
 static int
-add_query_id_context(struct kvec *iov, unsigned int *num_iovec)
+add_query_id_context(struct smb2_create_req *req,
+		     struct kvec *iov, unsigned int *num_iovec)
 {
-	struct smb2_create_req *req = iov[0].iov_base;
 	unsigned int num = *num_iovec;
 
 	iov[num].iov_base = create_query_id_buf();
@@ -2922,7 +2922,7 @@  SMB2_open_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server,
 			(struct create_context *)iov[n_iov-1].iov_base;
 		ccontext->Next = cpu_to_le32(iov[n_iov-1].iov_len);
 	}
-	add_query_id_context(iov, &n_iov);
+	add_query_id_context(req, iov, &n_iov);
 
 	rqst->rq_nvec = n_iov;
 	return 0;