* [PATCH net-next 0/2] rds: Minor updates for spelling and endian
@ 2025-06-19 13:58 Simon Horman
2025-06-19 13:58 ` [PATCH net-next 1/2] rds: Correct endian annotation of port and addr assignments Simon Horman
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Simon Horman @ 2025-06-19 13:58 UTC (permalink / raw)
To: Allison Henderson
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
netdev, linux-rdma, rds-devel, Simon Horman
Hi,
This short series addressses some cosmetic issues in rds.
1. Some spelling errors, as flagged by spellcheck
2. Some endianness annotation errors, which are not bugs,
flagged by Sparse
---
Simon Horman (2):
rds: Correct endian annotation of port and addr assignments
rds: Correct spelling
net/rds/af_rds.c | 2 +-
net/rds/send.c | 2 +-
net/rds/tcp_listen.c | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
base-commit: fc4842cd0f117042a648cf565da4db0c04a604be
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net-next 1/2] rds: Correct endian annotation of port and addr assignments
2025-06-19 13:58 [PATCH net-next 0/2] rds: Minor updates for spelling and endian Simon Horman
@ 2025-06-19 13:58 ` Simon Horman
2025-06-20 23:15 ` Allison Henderson
2025-06-19 13:58 ` [PATCH net-next 2/2] rds: Correct spelling Simon Horman
2025-06-21 15:00 ` [PATCH net-next 0/2] rds: Minor updates for spelling and endian patchwork-bot+netdevbpf
2 siblings, 1 reply; 6+ messages in thread
From: Simon Horman @ 2025-06-19 13:58 UTC (permalink / raw)
To: Allison Henderson
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
netdev, linux-rdma, rds-devel, Simon Horman
Correct the endianness annotation of port assignments:
A host byte order value (RDS_TCP_PORT) is correctly converted to
network byte order (big endian) using htons. But it is then cast back to
host byte order before assigning to a variable that expects a big endian
value. Address this by dropping the cast.
This is not a bug because, while the endian annotation is changed by
this patch, the assigned value is unchanged.
Also correct the endianness of address assignment.
A host byte order value (INADDR_ANY) is incorrectly assigned as-is to
a variable that expects a big endian value. Address this by converting
the value to network byte order (big endian).
This is not a bug because INADDR_ANY is 0, which is isomorphic
with regards to endian conversions. IOW, while the endian annotation
is changed by this patch, the assigned value is unchanged.
Incorrect endian annotations appear to date back to IPv4-only code added
by commit 70041088e3b9 ("RDS: Add TCP transport to RDS").
Flagged by Sparse.
Signed-off-by: Simon Horman <horms@kernel.org>
---
net/rds/tcp_listen.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/rds/tcp_listen.c b/net/rds/tcp_listen.c
index d89bd8d0c354..b5c801c629a4 100644
--- a/net/rds/tcp_listen.c
+++ b/net/rds/tcp_listen.c
@@ -298,15 +298,15 @@ struct socket *rds_tcp_listen_init(struct net *net, bool isv6)
sin6 = (struct sockaddr_in6 *)&ss;
sin6->sin6_family = PF_INET6;
sin6->sin6_addr = in6addr_any;
- sin6->sin6_port = (__force u16)htons(RDS_TCP_PORT);
+ sin6->sin6_port = htons(RDS_TCP_PORT);
sin6->sin6_scope_id = 0;
sin6->sin6_flowinfo = 0;
addr_len = sizeof(*sin6);
} else {
sin = (struct sockaddr_in *)&ss;
sin->sin_family = PF_INET;
- sin->sin_addr.s_addr = INADDR_ANY;
- sin->sin_port = (__force u16)htons(RDS_TCP_PORT);
+ sin->sin_addr.s_addr = htonl(INADDR_ANY);
+ sin->sin_port = htons(RDS_TCP_PORT);
addr_len = sizeof(*sin);
}
--
2.47.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next 2/2] rds: Correct spelling
2025-06-19 13:58 [PATCH net-next 0/2] rds: Minor updates for spelling and endian Simon Horman
2025-06-19 13:58 ` [PATCH net-next 1/2] rds: Correct endian annotation of port and addr assignments Simon Horman
@ 2025-06-19 13:58 ` Simon Horman
2025-06-20 23:16 ` Allison Henderson
2025-06-21 15:00 ` [PATCH net-next 0/2] rds: Minor updates for spelling and endian patchwork-bot+netdevbpf
2 siblings, 1 reply; 6+ messages in thread
From: Simon Horman @ 2025-06-19 13:58 UTC (permalink / raw)
To: Allison Henderson
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
netdev, linux-rdma, rds-devel, Simon Horman
Correct spelling as flagged by codespell.
With these changes in place codespell only flags false positives
in net/rds.
Signed-off-by: Simon Horman <horms@kernel.org>
---
net/rds/af_rds.c | 2 +-
net/rds/send.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c
index 8435a20968ef..086a13170e09 100644
--- a/net/rds/af_rds.c
+++ b/net/rds/af_rds.c
@@ -598,7 +598,7 @@ static int rds_connect(struct socket *sock, struct sockaddr *uaddr,
}
if (addr_type & IPV6_ADDR_LINKLOCAL) {
- /* If socket is arleady bound to a link local address,
+ /* If socket is already bound to a link local address,
* the peer address must be on the same link.
*/
if (sin6->sin6_scope_id == 0 ||
diff --git a/net/rds/send.c b/net/rds/send.c
index 09a280110654..42d991bc8543 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -232,7 +232,7 @@ int rds_send_xmit(struct rds_conn_path *cp)
* If not already working on one, grab the next message.
*
* cp_xmit_rm holds a ref while we're sending this message down
- * the connction. We can use this ref while holding the
+ * the connection. We can use this ref while holding the
* send_sem.. rds_send_reset() is serialized with it.
*/
if (!rm) {
--
2.47.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 1/2] rds: Correct endian annotation of port and addr assignments
2025-06-19 13:58 ` [PATCH net-next 1/2] rds: Correct endian annotation of port and addr assignments Simon Horman
@ 2025-06-20 23:15 ` Allison Henderson
0 siblings, 0 replies; 6+ messages in thread
From: Allison Henderson @ 2025-06-20 23:15 UTC (permalink / raw)
To: horms@kernel.org
Cc: linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com,
edumazet@google.com, davem@davemloft.net, kuba@kernel.org,
pabeni@redhat.com, netdev@vger.kernel.org
On Thu, 2025-06-19 at 14:58 +0100, Simon Horman wrote:
> Correct the endianness annotation of port assignments:
>
> A host byte order value (RDS_TCP_PORT) is correctly converted to
> network byte order (big endian) using htons. But it is then cast back to
> host byte order before assigning to a variable that expects a big endian
> value. Address this by dropping the cast.
>
> This is not a bug because, while the endian annotation is changed by
> this patch, the assigned value is unchanged.
>
> Also correct the endianness of address assignment.
>
> A host byte order value (INADDR_ANY) is incorrectly assigned as-is to
> a variable that expects a big endian value. Address this by converting
> the value to network byte order (big endian).
>
> This is not a bug because INADDR_ANY is 0, which is isomorphic
> with regards to endian conversions. IOW, while the endian annotation
> is changed by this patch, the assigned value is unchanged.
>
> Incorrect endian annotations appear to date back to IPv4-only code added
> by commit 70041088e3b9 ("RDS: Add TCP transport to RDS").
>
> Flagged by Sparse.
>
> Signed-off-by: Simon Horman <horms@kernel.org>
These changes look fine to me. Thanks for the catch!
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
> ---
> net/rds/tcp_listen.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/net/rds/tcp_listen.c b/net/rds/tcp_listen.c
> index d89bd8d0c354..b5c801c629a4 100644
> --- a/net/rds/tcp_listen.c
> +++ b/net/rds/tcp_listen.c
> @@ -298,15 +298,15 @@ struct socket *rds_tcp_listen_init(struct net *net, bool isv6)
> sin6 = (struct sockaddr_in6 *)&ss;
> sin6->sin6_family = PF_INET6;
> sin6->sin6_addr = in6addr_any;
> - sin6->sin6_port = (__force u16)htons(RDS_TCP_PORT);
> + sin6->sin6_port = htons(RDS_TCP_PORT);
> sin6->sin6_scope_id = 0;
> sin6->sin6_flowinfo = 0;
> addr_len = sizeof(*sin6);
> } else {
> sin = (struct sockaddr_in *)&ss;
> sin->sin_family = PF_INET;
> - sin->sin_addr.s_addr = INADDR_ANY;
> - sin->sin_port = (__force u16)htons(RDS_TCP_PORT);
> + sin->sin_addr.s_addr = htonl(INADDR_ANY);
> + sin->sin_port = htons(RDS_TCP_PORT);
> addr_len = sizeof(*sin);
> }
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 2/2] rds: Correct spelling
2025-06-19 13:58 ` [PATCH net-next 2/2] rds: Correct spelling Simon Horman
@ 2025-06-20 23:16 ` Allison Henderson
0 siblings, 0 replies; 6+ messages in thread
From: Allison Henderson @ 2025-06-20 23:16 UTC (permalink / raw)
To: horms@kernel.org
Cc: linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com,
edumazet@google.com, davem@davemloft.net, kuba@kernel.org,
pabeni@redhat.com, netdev@vger.kernel.org
On Thu, 2025-06-19 at 14:58 +0100, Simon Horman wrote:
> Correct spelling as flagged by codespell.
> With these changes in place codespell only flags false positives
> in net/rds.
>
> Signed-off-by: Simon Horman <horms@kernel.org>
This looks ok to me. Thanks for the cleanup!
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
> ---
> net/rds/af_rds.c | 2 +-
> net/rds/send.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c
> index 8435a20968ef..086a13170e09 100644
> --- a/net/rds/af_rds.c
> +++ b/net/rds/af_rds.c
> @@ -598,7 +598,7 @@ static int rds_connect(struct socket *sock, struct sockaddr *uaddr,
> }
>
> if (addr_type & IPV6_ADDR_LINKLOCAL) {
> - /* If socket is arleady bound to a link local address,
> + /* If socket is already bound to a link local address,
> * the peer address must be on the same link.
> */
> if (sin6->sin6_scope_id == 0 ||
> diff --git a/net/rds/send.c b/net/rds/send.c
> index 09a280110654..42d991bc8543 100644
> --- a/net/rds/send.c
> +++ b/net/rds/send.c
> @@ -232,7 +232,7 @@ int rds_send_xmit(struct rds_conn_path *cp)
> * If not already working on one, grab the next message.
> *
> * cp_xmit_rm holds a ref while we're sending this message down
> - * the connction. We can use this ref while holding the
> + * the connection. We can use this ref while holding the
> * send_sem.. rds_send_reset() is serialized with it.
> */
> if (!rm) {
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 0/2] rds: Minor updates for spelling and endian
2025-06-19 13:58 [PATCH net-next 0/2] rds: Minor updates for spelling and endian Simon Horman
2025-06-19 13:58 ` [PATCH net-next 1/2] rds: Correct endian annotation of port and addr assignments Simon Horman
2025-06-19 13:58 ` [PATCH net-next 2/2] rds: Correct spelling Simon Horman
@ 2025-06-21 15:00 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-21 15:00 UTC (permalink / raw)
To: Simon Horman
Cc: allison.henderson, davem, edumazet, kuba, pabeni, netdev,
linux-rdma, rds-devel
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 19 Jun 2025 14:58:31 +0100 you wrote:
> Hi,
>
> This short series addressses some cosmetic issues in rds.
>
> 1. Some spelling errors, as flagged by spellcheck
> 2. Some endianness annotation errors, which are not bugs,
> flagged by Sparse
>
> [...]
Here is the summary with links:
- [net-next,1/2] rds: Correct endian annotation of port and addr assignments
https://git.kernel.org/netdev/net-next/c/6e307a873d30
- [net-next,2/2] rds: Correct spelling
https://git.kernel.org/netdev/net-next/c/433dce0692a0
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-06-21 14:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-19 13:58 [PATCH net-next 0/2] rds: Minor updates for spelling and endian Simon Horman
2025-06-19 13:58 ` [PATCH net-next 1/2] rds: Correct endian annotation of port and addr assignments Simon Horman
2025-06-20 23:15 ` Allison Henderson
2025-06-19 13:58 ` [PATCH net-next 2/2] rds: Correct spelling Simon Horman
2025-06-20 23:16 ` Allison Henderson
2025-06-21 15:00 ` [PATCH net-next 0/2] rds: Minor updates for spelling and endian patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).