* [PATCH][next] net/handshake: remove redundant assignment to variable ret
@ 2024-04-15 10:07 Colin Ian King
2024-04-15 12:01 ` Jason Xing
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Colin Ian King @ 2024-04-15 10:07 UTC (permalink / raw)
To: Chuck Lever, David S . Miller, Eric Dumazet, Jakub Kicinski,
kernel-tls-handshake, netdev
Cc: kernel-janitors, linux-kernel
The variable is being assigned an value and then is being re-assigned
a new value in the next statement. The assignment is redundant and can
be removed.
Cleans up clang scan build warning:
net/handshake/tlshd.c:216:2: warning: Value stored to 'ret' is never
read [deadcode.DeadStores]
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
net/handshake/tlshd.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/handshake/tlshd.c b/net/handshake/tlshd.c
index d697f68c598c..d6f52839827e 100644
--- a/net/handshake/tlshd.c
+++ b/net/handshake/tlshd.c
@@ -213,7 +213,6 @@ static int tls_handshake_accept(struct handshake_req *req,
if (!hdr)
goto out_cancel;
- ret = -EMSGSIZE;
ret = nla_put_s32(msg, HANDSHAKE_A_ACCEPT_SOCKFD, fd);
if (ret < 0)
goto out_cancel;
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH][next] net/handshake: remove redundant assignment to variable ret
2024-04-15 10:07 [PATCH][next] net/handshake: remove redundant assignment to variable ret Colin Ian King
@ 2024-04-15 12:01 ` Jason Xing
2024-04-15 13:30 ` Chuck Lever
2024-04-17 0:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Jason Xing @ 2024-04-15 12:01 UTC (permalink / raw)
To: Colin Ian King
Cc: Chuck Lever, David S . Miller, Eric Dumazet, Jakub Kicinski,
kernel-tls-handshake, netdev, kernel-janitors, linux-kernel
On Mon, Apr 15, 2024 at 6:08 PM Colin Ian King <colin.i.king@gmail.com> wrote:
>
> The variable is being assigned an value and then is being re-assigned
> a new value in the next statement. The assignment is redundant and can
> be removed.
>
> Cleans up clang scan build warning:
> net/handshake/tlshd.c:216:2: warning: Value stored to 'ret' is never
> read [deadcode.DeadStores]
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][next] net/handshake: remove redundant assignment to variable ret
2024-04-15 10:07 [PATCH][next] net/handshake: remove redundant assignment to variable ret Colin Ian King
2024-04-15 12:01 ` Jason Xing
@ 2024-04-15 13:30 ` Chuck Lever
2024-04-17 0:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Chuck Lever @ 2024-04-15 13:30 UTC (permalink / raw)
To: Colin Ian King
Cc: David S . Miller, Eric Dumazet, Jakub Kicinski,
kernel-tls-handshake, netdev, kernel-janitors, linux-kernel
On Mon, Apr 15, 2024 at 11:07:13AM +0100, Colin Ian King wrote:
> The variable is being assigned an value and then is being re-assigned
> a new value in the next statement. The assignment is redundant and can
> be removed.
>
> Cleans up clang scan build warning:
> net/handshake/tlshd.c:216:2: warning: Value stored to 'ret' is never
> read [deadcode.DeadStores]
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
> net/handshake/tlshd.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/net/handshake/tlshd.c b/net/handshake/tlshd.c
> index d697f68c598c..d6f52839827e 100644
> --- a/net/handshake/tlshd.c
> +++ b/net/handshake/tlshd.c
> @@ -213,7 +213,6 @@ static int tls_handshake_accept(struct handshake_req *req,
> if (!hdr)
> goto out_cancel;
>
> - ret = -EMSGSIZE;
> ret = nla_put_s32(msg, HANDSHAKE_A_ACCEPT_SOCKFD, fd);
> if (ret < 0)
> goto out_cancel;
> --
> 2.39.2
>
>
Acked-by: Chuck Lever <chuck.lever@oracle.com>
--
Chuck Lever
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][next] net/handshake: remove redundant assignment to variable ret
2024-04-15 10:07 [PATCH][next] net/handshake: remove redundant assignment to variable ret Colin Ian King
2024-04-15 12:01 ` Jason Xing
2024-04-15 13:30 ` Chuck Lever
@ 2024-04-17 0:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-04-17 0:20 UTC (permalink / raw)
To: Colin Ian King
Cc: chuck.lever, davem, edumazet, kuba, kernel-tls-handshake, netdev,
kernel-janitors, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 15 Apr 2024 11:07:13 +0100 you wrote:
> The variable is being assigned an value and then is being re-assigned
> a new value in the next statement. The assignment is redundant and can
> be removed.
>
> Cleans up clang scan build warning:
> net/handshake/tlshd.c:216:2: warning: Value stored to 'ret' is never
> read [deadcode.DeadStores]
>
> [...]
Here is the summary with links:
- [next] net/handshake: remove redundant assignment to variable ret
https://git.kernel.org/netdev/net-next/c/c2b640529ec7
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] 4+ messages in thread
end of thread, other threads:[~2024-04-17 0:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-15 10:07 [PATCH][next] net/handshake: remove redundant assignment to variable ret Colin Ian King
2024-04-15 12:01 ` Jason Xing
2024-04-15 13:30 ` Chuck Lever
2024-04-17 0:20 ` patchwork-bot+netdevbpf
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.