* [PATCH -next 0/2] net/rds: Minor cleanup for unused variables
@ 2022-10-10 3:09 Chen Zhongjin
2022-10-10 3:09 ` [PATCH -next 1/2] net/rds: Remove unused variable 'total_copied' Chen Zhongjin
2022-10-10 3:09 ` [PATCH -next 2/2] net/rds: Remove unused variable 'total_payload_len' Chen Zhongjin
0 siblings, 2 replies; 3+ messages in thread
From: Chen Zhongjin @ 2022-10-10 3:09 UTC (permalink / raw)
To: linux-kernel, netdev, linux-rdma, rds-devel
Cc: santosh.shilimkar, davem, edumazet, kuba, pabeni, chenzhongjin
Cleanup unused variables reported by Clang [-Wunused-but-set-variable]
Chen Zhongjin (2):
net/rds: Remove unused variable 'total_copied'
net/rds: Remove unused variable 'total_payload_len'
net/rds/message.c | 2 --
net/rds/send.c | 3 +--
2 files changed, 1 insertion(+), 4 deletions(-)
--
2.33.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH -next 1/2] net/rds: Remove unused variable 'total_copied'
2022-10-10 3:09 [PATCH -next 0/2] net/rds: Minor cleanup for unused variables Chen Zhongjin
@ 2022-10-10 3:09 ` Chen Zhongjin
2022-10-10 3:09 ` [PATCH -next 2/2] net/rds: Remove unused variable 'total_payload_len' Chen Zhongjin
1 sibling, 0 replies; 3+ messages in thread
From: Chen Zhongjin @ 2022-10-10 3:09 UTC (permalink / raw)
To: linux-kernel, netdev, linux-rdma, rds-devel
Cc: santosh.shilimkar, davem, edumazet, kuba, pabeni, chenzhongjin
Reported by Clang [-Wunused-but-set-variable]
'commit 0cebaccef3ac ("rds: zerocopy Tx support.")'
This commit introduced the variable 'dest_frames'. However this variable
is never used by other code except iterates itself, so remove it.
Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
---
net/rds/message.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/net/rds/message.c b/net/rds/message.c
index d74be4e3f3fa..eee2e674d5c0 100644
--- a/net/rds/message.c
+++ b/net/rds/message.c
@@ -366,7 +366,6 @@ static int rds_message_zcopy_from_user(struct rds_message *rm, struct iov_iter *
struct scatterlist *sg;
int ret = 0;
int length = iov_iter_count(from);
- int total_copied = 0;
struct rds_msg_zcopy_info *info;
rm->m_inc.i_hdr.h_len = cpu_to_be32(iov_iter_count(from));
@@ -404,7 +403,6 @@ static int rds_message_zcopy_from_user(struct rds_message *rm, struct iov_iter *
ret = -EFAULT;
goto err;
}
- total_copied += copied;
length -= copied;
sg_set_page(sg, pages, copied, start);
rm->data.op_nents++;
--
2.33.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH -next 2/2] net/rds: Remove unused variable 'total_payload_len'
2022-10-10 3:09 [PATCH -next 0/2] net/rds: Minor cleanup for unused variables Chen Zhongjin
2022-10-10 3:09 ` [PATCH -next 1/2] net/rds: Remove unused variable 'total_copied' Chen Zhongjin
@ 2022-10-10 3:09 ` Chen Zhongjin
1 sibling, 0 replies; 3+ messages in thread
From: Chen Zhongjin @ 2022-10-10 3:09 UTC (permalink / raw)
To: linux-kernel, netdev, linux-rdma, rds-devel
Cc: santosh.shilimkar, davem, edumazet, kuba, pabeni, chenzhongjin
Reported by Clang [-Wunused-but-set-variable]
'commit f9fb69adb6c7 ("RDS: make message size limit compliant with spec")'
This commit introduced the variable 'total_copied'. However this variable
is never used by other code except iterates itself, so remove it.
Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
---
net/rds/send.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/rds/send.c b/net/rds/send.c
index 0c5504068e3c..5e57a1581dc6 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -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);
@@ -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;
--
2.33.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-09-30 11:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-10 3:09 [PATCH -next 0/2] net/rds: Minor cleanup for unused variables Chen Zhongjin
2022-10-10 3:09 ` [PATCH -next 1/2] net/rds: Remove unused variable 'total_copied' Chen Zhongjin
2022-10-10 3:09 ` [PATCH -next 2/2] net/rds: Remove unused variable 'total_payload_len' Chen Zhongjin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.