diff mbox series

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

Message ID 7344eac4bab0f3d162ca5a401d9620d468ea3292.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 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index cebb8d9837d2..6b6790d8d0ee 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -795,9 +795,9 @@  create_posix_buf(umode_t mode)
 }
 
 static int
-add_posix_context(struct kvec *iov, unsigned int *num_iovec, umode_t mode)
+add_posix_context(struct smb2_create_req *req,
+		  struct kvec *iov, unsigned int *num_iovec, umode_t mode)
 {
-	struct smb2_create_req *req = iov[0].iov_base;
 	unsigned int num = *num_iovec;
 
 	iov[num].iov_base = create_posix_buf(mode);
@@ -2694,7 +2694,7 @@  int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
 
 	if (tcon->posix_extensions) {
 		/* resource #3: posix buf */
-		rc = add_posix_context(iov, &n_iov, mode);
+		rc = add_posix_context(req, iov, &n_iov, mode);
 		if (rc)
 			goto err_free_req;
 		pc_buf = iov[n_iov-1].iov_base;
@@ -2863,7 +2863,7 @@  SMB2_open_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server,
 				cpu_to_le32(iov[n_iov-1].iov_len);
 		}
 
-		rc = add_posix_context(iov, &n_iov, oparms->mode);
+		rc = add_posix_context(req, iov, &n_iov, oparms->mode);
 		if (rc)
 			return rc;
 	}