Skip to contentSkip to conversation

net/rds: Drop duplicate sin and sin6 assignments

PATCH Applied Yejune Deng 2 participants 2 messages Mar 10, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/rds: Drop duplicate sin and sin6 assignments

There is no need to assign the msg->msg_name to sin or sin6, because there is DECLARE_SOCKADDR statement.

---
 net/rds/recv.c | 4 ----
 1 file changed, 4 deletions(-)
net/rds/recv.c +0 -4
index aba4afe4dfed..4db109fb6ec2 100644
@@ -722,8 +722,6 @@ int rds_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
 
 		if (msg->msg_name) {
 			if (ipv6_addr_v4mapped(&inc->i_saddr)) {
-				sin = (struct sockaddr_in *)msg->msg_name;
-
 				sin->sin_family = AF_INET;
 				sin->sin_port = inc->i_hdr.h_sport;
 				sin->sin_addr.s_addr =
@@ -731,8 +729,6 @@ int rds_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
 				memset(sin->sin_zero, 0, sizeof(sin->sin_zero));
 				msg->msg_namelen = sizeof(*sin);
 			} else {
-				sin6 = (struct sockaddr_in6 *)msg->msg_name;
-
 				sin6->sin6_family = AF_INET6;
 				sin6->sin6_port = inc->i_hdr.h_sport;
 				sin6->sin6_addr = inc->i_saddr;
Signature · 1 line
2.29.0
#1 lore raw
This patch was applied to netdev/net-next.git (refs/heads/master):

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

Quoted 7 lines · On Wed, 10 Mar 2021 11:23:43 +0800 you wrote:

There is no need to assign the msg->msg_name to sin or sin6, because there is DECLARE_SOCKADDR statement.

---
 net/rds/recv.c | 4 ----
 1 file changed, 4 deletions(-)

Here is the summary with links:
- net/rds: Drop duplicate sin and sin6 assignments

    https://git.kernel.org/netdev/net-next/c/3e6f20e09a45

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html