aboutsummaryrefslogtreecommitdiff
path: root/fs/cifs
diff options
context:
space:
mode:
authorQinglang Miao2020-07-25 16:56:01 +0800
committerSteve French2020-08-02 18:00:26 -0500
commit1a0e7f7c3c573a79bcd787d8a05e80651041b815 (patch)
treee07a318c3d5e4a0553c6dca3e1eab49508e5a22b /fs/cifs
parenta03f507de5f44673cd7c67e24f64b479057c2ce0 (diff)
cifs: convert to use be32_add_cpu()
Convert cpu_to_be32(be32_to_cpu(E1) + E2) to use be32_add_cpu(). Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/connect.c3
-rw-r--r--fs/cifs/sess.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index a61abde09ffe..fe4b55977dd8 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 6708ab0aad1c..69cd5856621b 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,