Skip to contentSkip to conversation

net/core: remove unneeded variable

PATCH In review [email protected] 2 participants 2 messages Dec 10, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/core: remove unneeded variable

From: Minghao Chi <[email protected]>

Return status directly from function called.

---
 net/core/lwtunnel.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
net/core/lwtunnel.c +1 -5
index 2820aca2173a..c34248e358ac 100644
@@ -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);
 
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 16 lines · On Fri, 10 Dec 2021 02:20:12 +0000 [email protected] wrote:

From: Minghao Chi <[email protected]>

Return status directly from function called.

---
 net/core/lwtunnel.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
net/core/lwtunnel.c +0 -0
index 2820aca2173a..c34248e358ac 100644
@@ -63,11 +63,7 @@ static const char *lwtunnel_encap_str(enum lwtunnel_encap_types encap_type)
 

net/core/lwtunnel.c static const char *lwtunnel_encap_str(enum lwtunnel_encap_types encap_type) · line 68

Quoted 10 lines
net/core/lwtunnel.c +1 -5
 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.