diff mbox series

[next] net/handshake: remove redundant assignment to variable ret

Message ID 20240415100713.483399-1-colin.i.king@gmail.com (mailing list archive)
State Accepted
Commit c2b640529ec7595b4f82f1630da1ac9697a0c927
Delegated to: Netdev Maintainers
Headers show
Series [next] net/handshake: remove redundant assignment to variable ret | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 928 this patch: 928
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 6 maintainers not CCed: pabeni@redhat.com nathan@kernel.org justinstitt@google.com ndesaulniers@google.com llvm@lists.linux.dev morbo@google.com
netdev/build_clang success Errors and warnings before: 938 this patch: 938
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 939 this patch: 939
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 7 this patch: 7
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-04-15--15-00 (tests: 961)

Commit Message

Colin Ian King April 15, 2024, 10:07 a.m. UTC
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(-)

Comments

Jason Xing April 15, 2024, 12:01 p.m. UTC | #1
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>
Chuck Lever III April 15, 2024, 1:30 p.m. UTC | #2
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>
patchwork-bot+netdevbpf@kernel.org April 17, 2024, 12:20 a.m. UTC | #3
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!
diff mbox series

Patch

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;