[PATCH][net-next] net_sched: remove redundant assignment to ret

Subsystems: networking [general], tc subsystem, the rest

STALE3261d

3 messages, 3 authors, 2017-10-01 · open the first message on its own page

[PATCH][net-next] net_sched: remove redundant assignment to ret

From: Colin King <hidden>
Date: 2017-09-29 14:01:25

From: Colin Ian King <redacted>

The assignment of -EINVAL to variable ret is redundant as it
is being overwritten on the following error exit paths or
to the return value from the following call to basic_set_parms.
Fix this up by removing it. Cleans up clang warning message:

net/sched/cls_basic.c:185:2: warning: Value stored to 'err' is never read

Signed-off-by: Colin Ian King <redacted>
---
 net/sched/cls_basic.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c
index cfeb6f158566..700b345b07f9 100644
--- a/net/sched/cls_basic.c
+++ b/net/sched/cls_basic.c
@@ -182,7 +182,6 @@ static int basic_change(struct net *net, struct sk_buff *in_skb,
 	if (err < 0)
 		goto errout;
 
-	err = -EINVAL;
 	if (handle) {
 		fnew->handle = handle;
 		if (!fold) {
-- 
2.14.1

Re: [PATCH][net-next] net_sched: remove redundant assignment to ret

From: Cong Wang <hidden>
Date: 2017-09-29 17:35:43

On Fri, Sep 29, 2017 at 7:01 AM, Colin King [off-list ref] wrote:
From: Colin Ian King <redacted>

The assignment of -EINVAL to variable ret is redundant as it
is being overwritten on the following error exit paths or
to the return value from the following call to basic_set_parms.
Fix this up by removing it. Cleans up clang warning message:

net/sched/cls_basic.c:185:2: warning: Value stored to 'err' is never read

Signed-off-by: Colin Ian King <redacted>
Fixes: 1d8134fea2eb ("net_sched: use idr to allocate basic filter handles")

Acked-by: Cong Wang <redacted>

Re: [PATCH][net-next] net_sched: remove redundant assignment to ret

From: David Miller <davem@davemloft.net>
Date: 2017-10-01 03:08:31

From: Colin King <redacted>
Date: Fri, 29 Sep 2017 15:01:16 +0100
From: Colin Ian King <redacted>

The assignment of -EINVAL to variable ret is redundant as it
is being overwritten on the following error exit paths or
to the return value from the following call to basic_set_parms.
Fix this up by removing it. Cleans up clang warning message:

net/sched/cls_basic.c:185:2: warning: Value stored to 'err' is never read

Signed-off-by: Colin Ian King <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help