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>
This commit is contained in:
Qinglang Miao 2020-07-25 16:56:01 +08:00 committed by Steve French
parent a03f507de5
commit 1a0e7f7c3c
2 changed files with 2 additions and 4 deletions

View File

@ -5114,8 +5114,7 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *ses,
bcc_ptr += strlen("?????"); bcc_ptr += strlen("?????");
bcc_ptr += 1; bcc_ptr += 1;
count = bcc_ptr - &pSMB->Password[0]; count = bcc_ptr - &pSMB->Password[0];
pSMB->hdr.smb_buf_length = cpu_to_be32(be32_to_cpu( be32_add_cpu(&pSMB->hdr.smb_buf_length, count);
pSMB->hdr.smb_buf_length) + count);
pSMB->ByteCount = cpu_to_le16(count); pSMB->ByteCount = cpu_to_le16(count);
rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response, &length, rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response, &length,

View File

@ -938,8 +938,7 @@ sess_sendreceive(struct sess_data *sess_data)
struct kvec rsp_iov = { NULL, 0 }; struct kvec rsp_iov = { NULL, 0 };
count = sess_data->iov[1].iov_len + sess_data->iov[2].iov_len; count = sess_data->iov[1].iov_len + sess_data->iov[2].iov_len;
smb_buf->smb_buf_length = be32_add_cpu(&smb_buf->smb_buf_length, count);
cpu_to_be32(be32_to_cpu(smb_buf->smb_buf_length) + count);
put_bcc(count, smb_buf); put_bcc(count, smb_buf);
rc = SendReceive2(sess_data->xid, sess_data->ses, rc = SendReceive2(sess_data->xid, sess_data->ses,