From patchwork Fri Mar 17 11:15:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volker Lendecke X-Patchwork-Id: 1758207 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (3072-bit key; secure) header.d=samba.org header.i=@samba.org header.a=rsa-sha256 header.s=42 header.b=DYUM9HlS; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4PdM4z3BRsz247X for ; Fri, 17 Mar 2023 22:16:03 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229603AbjCQLQA (ORCPT ); Fri, 17 Mar 2023 07:16:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229499AbjCQLPz (ORCPT ); Fri, 17 Mar 2023 07:15:55 -0400 Received: from hr2.samba.org (hr2.samba.org [IPv6:2a01:4f8:192:486::2:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74C294DBD0 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=AaQ2ehI8xzojdsdE7qs7SRgxVJu6qK7rBlsn99MWtAE=; b=DYUM9HlSQ4p1Xdew48KMh7C7I9 PCYtDuh21MWXSyXAiWddJpZBeX7OvpMHg6TD4KH/wHZZ2CY06ch8M3iNcGqQZQaB7pFYC3vpgObeR y8RsKEFT26SmXlj/h8jtJvrj0fwj0E4dJMHtxbv7SRnQCOXh1b167xm3vLoWZgtx/WVU7ZXCsv4ku nd8c4Q1OqUr8iC87ifhxDWPK0pTIDyi8r9VlkuIG4tTlcl05BKSJUfCWjIbp6QZrzmZ5oUi4Buw5j 3BISiRehvAlIjhIeuhzfvkvZKwkcI3rND307xFkUzI93LyBx5j/DHCHUQd2YQVI4GGKi0mLjYqnLG LA2yi6nHnMpD+CXzjJwK+qKBaS7FqTkC2NVUov3z5FuG3NjEvSQSMbV9zpH8d6RQMi6tVa0llqRbp 3anjXfiBv29sQOwklxcDYMsMhCxY3ev7V/bRFeK09Lnw7Hgu3YUjelg7nclFVIn84X/q5qwoVpPyr UXmxx/pGHgx/hx1adgGKiaGU; Received: from [2a01:4f8:252:410e::177:224] (port=37520 helo=atb-devel-224..) by hr2.samba.org with esmtp (Exim) id 1pd83o-003p4x-Fn; Fri, 17 Mar 2023 11:15:48 +0000 From: Volker Lendecke To: linux-cifs@vger.kernel.org Cc: Volker Lendecke Subject: [PATCH 5/7] cifs: Avoid a cast in add_durable_v2_context() Date: Fri, 17 Mar 2023 11:15:26 +0000 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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) {