net/rds: Drop duplicate sin and sin6 assignments
authorYejune Deng <yejune.deng@gmail.com>
Wed, 10 Mar 2021 03:23:43 +0000 (11:23 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Mar 2021 20:45:15 +0000 (12:45 -0800)
There is no need to assign the msg->msg_name to sin or sin6,
because there is DECLARE_SOCKADDR statement.

Signed-off-by: Yejune Deng <yejune.deng@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/recv.c

index aba4afe4dfedc22a6bdb45893f07a4d76f6cc2ed..4db109fb6ec28fdc8c323a5f37e9f687ece99373 100644 (file)
@@ -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;