diff mbox series

[core-next] net/core: remove unneeded variable

Message ID 20211210022012.423994-1-chi.minghao@zte.com.cn (mailing list archive)
State Rejected
Delegated to: Netdev Maintainers
Headers show
Series [core-next] net/core: remove unneeded variable | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit fail Errors and warnings before: 3 this patch: 7
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang fail Errors and warnings before: 20 this patch: 6
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn fail Errors and warnings before: 5 this patch: 7
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 12 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

CGEL Dec. 10, 2021, 2:20 a.m. UTC
From: Minghao Chi <chi.minghao@zte.com.cn>

Return status directly from function called.

Reported-by: Zeal Robot <zealci@zte.com.cm>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
---
 net/core/lwtunnel.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Jakub Kicinski Dec. 10, 2021, 2:50 a.m. UTC | #1
On Fri, 10 Dec 2021 02:20:12 +0000 cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> Return status directly from function called.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cm>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> ---
>  net/core/lwtunnel.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/net/core/lwtunnel.c b/net/core/lwtunnel.c
> index 2820aca2173a..c34248e358ac 100644
> --- a/net/core/lwtunnel.c
> +++ b/net/core/lwtunnel.c
> @@ -63,11 +63,7 @@ static const char *lwtunnel_encap_str(enum lwtunnel_encap_types encap_type)
>  
>  struct lwtunnel_state *lwtunnel_state_alloc(int encap_len)
>  {
> -	struct lwtunnel_state *lws;
> -
> -	lws = kzalloc(sizeof(*lws) + encap_len, GFP_ATOMIC);
> -
> -	return lws;
> +	return kzalloc(sizeof(*lws) + encap_len, GFP_ATOMIC);
>  }
>  EXPORT_SYMBOL_GPL(lwtunnel_state_alloc);

I don't think any of your "remove unneeded variable" patches are worth
applying, sorry.

This one doesn't even build.
diff mbox series

Patch

diff --git a/net/core/lwtunnel.c b/net/core/lwtunnel.c
index 2820aca2173a..c34248e358ac 100644
--- a/net/core/lwtunnel.c
+++ b/net/core/lwtunnel.c
@@ -63,11 +63,7 @@  static const char *lwtunnel_encap_str(enum lwtunnel_encap_types encap_type)
 
 struct lwtunnel_state *lwtunnel_state_alloc(int encap_len)
 {
-	struct lwtunnel_state *lws;
-
-	lws = kzalloc(sizeof(*lws) + encap_len, GFP_ATOMIC);
-
-	return lws;
+	return kzalloc(sizeof(*lws) + encap_len, GFP_ATOMIC);
 }
 EXPORT_SYMBOL_GPL(lwtunnel_state_alloc);