Skip to content

Commit 1a0e7f7

Browse files
Qinglang Miaosmfrench
authored andcommitted
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 <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent a03f507 commit 1a0e7f7

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

fs/cifs/connect.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5114,8 +5114,7 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *ses,
51145114
bcc_ptr += strlen("?????");
51155115
bcc_ptr += 1;
51165116
count = bcc_ptr - &pSMB->Password[0];
5117-
pSMB->hdr.smb_buf_length = cpu_to_be32(be32_to_cpu(
5118-
pSMB->hdr.smb_buf_length) + count);
5117+
be32_add_cpu(&pSMB->hdr.smb_buf_length, count);
51195118
pSMB->ByteCount = cpu_to_le16(count);
51205119

51215120
rc = SendReceive(xid, ses, smb_buffer, smb_buffer_response, &length,

fs/cifs/sess.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -938,8 +938,7 @@ sess_sendreceive(struct sess_data *sess_data)
938938
struct kvec rsp_iov = { NULL, 0 };
939939

940940
count = sess_data->iov[1].iov_len + sess_data->iov[2].iov_len;
941-
smb_buf->smb_buf_length =
942-
cpu_to_be32(be32_to_cpu(smb_buf->smb_buf_length) + count);
941+
be32_add_cpu(&smb_buf->smb_buf_length, count);
943942
put_bcc(count, smb_buf);
944943

945944
rc = SendReceive2(sess_data->xid, sess_data->ses,

0 commit comments

Comments
 (0)