From patchwork Fri Mar 17 11:15:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volker Lendecke X-Patchwork-Id: 13178917 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23E34C76196 for ; Fri, 17 Mar 2023 11:16:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229560AbjCQLQA (ORCPT ); Fri, 17 Mar 2023 07:16:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229652AbjCQLP5 (ORCPT ); Fri, 17 Mar 2023 07:15:57 -0400 Received: from hr2.samba.org (hr2.samba.org [IPv6:2a01:4f8:192:486::2:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DBF35550C for ; Fri, 17 Mar 2023 04:15:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=samba.org; s=42; h=Message-Id:Date:Cc:To:From; bh=zQWewxIqdzIXhHn7HsZjdcXiI+j/t7AbiYxHsi/YCRk=; b=OpZVlBpAsgbA+rvmzwul10Pfd7 KsLm7IlLX/NzHFIPBX1CgMGaQkLCrQ6l3q3ACPngltCGUmmPjHaGhC9TlQBY5JC8KUM+CZMMtTgz/ 63T6zxaYGcRvjV/SzKW3TGs6ZfMgKvMk9J8+re+1wxBR9/PDjcK3LF1U5xkcxkqy1PkTNIp+4Nez8 fSUO4zE5/jmcLf0PZ39E1RgHr8QNlW4wFZHNI9nChHwmE1CxZLZOtmwD2VQa2qSJbay77/bNJRIc+ OPgPHTEnthbwZXo397hZSk3Nizaa4QpycVqg4d5dAOWzPgD83VDxJsFLeX+N7OUA7BoPw/Zq1iA79 UvrYh+XlsR+NqjZAqUdn4Fg8ZseMySN++C1bm1fb3ziiqaQTCNVSVJCG6sKAU0Q8aJGkmnJJzejZT uRy0CgPvCvl6ZhsBRePVc8utT1xpEgAxGYiszzpOJIOaqSrnQoSy3bqIUCxpP4UEoBsPo+S9jWg+l vCh0w9fpMBvmCC1MTl3Upz8l; Received: from [2a01:4f8:252:410e::177:224] (port=37520 helo=atb-devel-224..) by hr2.samba.org with esmtp (Exim) id 1pd83o-003p4x-S7; Fri, 17 Mar 2023 11:15:49 +0000 From: Volker Lendecke To: linux-cifs@vger.kernel.org Cc: Volker Lendecke Subject: [PATCH 7/7] cifs: Avoid a cast in add_query_id_context() Date: Fri, 17 Mar 2023 11:15:28 +0000 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org We have the correctly-typed struct smb2_create_req * available in the caller. Signed-off-by: Volker Lendecke --- fs/cifs/smb2pdu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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;