From patchwork Sat Jul 25 08:56:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qinglang Miao X-Patchwork-Id: 11684899 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 89366912 for ; Sat, 25 Jul 2020 08:52:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 74629206D8 for ; Sat, 25 Jul 2020 08:52:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726704AbgGYIwp (ORCPT ); Sat, 25 Jul 2020 04:52:45 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8825 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726613AbgGYIwo (ORCPT ); Sat, 25 Jul 2020 04:52:44 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id BAC998CBAC9638A81EB8; Sat, 25 Jul 2020 16:52:38 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Sat, 25 Jul 2020 16:52:35 +0800 From: Qinglang Miao To: Steve French , Greg Kroah-Hartman CC: , Subject: [PATCH -next] cifs: convert to use be32_add_cpu() Date: Sat, 25 Jul 2020 16:56:01 +0800 Message-ID: <20200725085601.98074-1-miaoqinglang@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Convert cpu_to_be32(be32_to_cpu(E1) + E2) to use be32_add_cpu(). Signed-off-by: Qinglang Miao --- fs/cifs/connect.c | 3 +-- fs/cifs/sess.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 889fee586..552975420 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -5114,8 +5114,7 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *ses, bcc_ptr += strlen("?????"); bcc_ptr += 1; count = bcc_ptr - &pSMB->Password[0]; - pSMB->hdr.smb_buf_length = cpu_to_be32(be32_to_cpu( - pSMB->hdr.smb_buf_length) + count); + be32_add_cpu(&pSMB->hdr.smb_buf_length, count); pSMB->ByteCount = cpu_to_le16(count); rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response, &length, diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 6708ab0aa..69cd58566 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -938,8 +938,7 @@ sess_sendreceive(struct sess_data *sess_data) struct kvec rsp_iov = { NULL, 0 }; count = sess_data->iov[1].iov_len + sess_data->iov[2].iov_len; - smb_buf->smb_buf_length = - cpu_to_be32(be32_to_cpu(smb_buf->smb_buf_length) + count); + be32_add_cpu(&smb_buf->smb_buf_length, count); put_bcc(count, smb_buf); rc = SendReceive2(sess_data->xid, sess_data->ses,