Skip to content

Commit

Permalink
rds: remove redundant variable total_payload_len
Browse files Browse the repository at this point in the history
Variable total_payload_len is being used to accumulate payload lengths
however it is never read or used afterwards. It is redundant and can
be removed.

Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
ColinIanKing authored and davem330 committed Nov 4, 2022
1 parent b380927 commit d28c0e7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/rds/send.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len)
struct rds_conn_path *cpath;
struct in6_addr daddr;
__u32 scope_id = 0;
size_t total_payload_len = payload_len, rdma_payload_len = 0;
size_t rdma_payload_len = 0;
bool zcopy = ((msg->msg_flags & MSG_ZEROCOPY) &&
sock_flag(rds_rs_to_sk(rs), SOCK_ZEROCOPY));
int num_sgs = DIV_ROUND_UP(payload_len, PAGE_SIZE);
Expand Down Expand Up @@ -1243,7 +1243,6 @@ int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len)
if (ret)
goto out;

total_payload_len += rdma_payload_len;
if (max_t(size_t, payload_len, rdma_payload_len) > RDS_MAX_MSG_SIZE) {
ret = -EMSGSIZE;
goto out;
Expand Down

0 comments on commit d28c0e7

Please sign in to comment.