From: Jiri Pirko <jiri@resnulli.us>
To: walter harms <wharms@bfs.de>
Cc: Colin King <colin.king@canonical.com>,
Jamal Hadi Salim <jhs@mojatatu.com>,
Cong Wang <xiyou.wangcong@gmail.com>,
netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] net/sched: remove redundant null check on head
Date: Wed, 03 May 2017 15:12:12 +0000 [thread overview]
Message-ID: <20170503151212.GD2077@nanopsycho.orion> (raw)
In-Reply-To: <5909E75B.30305@bfs.de>
Wed, May 03, 2017 at 04:21:15PM CEST, wharms@bfs.de wrote:
>
>
>Am 03.05.2017 15:50, schrieb Colin King:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> head is previously null checked and so the 2nd null check on head
>> is redundant and therefore can be removed.
>>
>> Detected by CoverityScan, CID#1399505 ("Logically dead code")
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>> net/sched/cls_matchall.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c
>> index 2efb36c08f2a..dee469fed967 100644
>> --- a/net/sched/cls_matchall.c
>> +++ b/net/sched/cls_matchall.c
>> @@ -203,8 +203,7 @@ static int mall_change(struct net *net, struct sk_buff *in_skb,
>>
>> *arg = (unsigned long) head;
>> rcu_assign_pointer(tp->root, new);
>> - if (head)
>> - call_rcu(&head->rcu, mall_destroy_rcu);
>> + call_rcu(&head->rcu, mall_destroy_rcu);
>> return 0;
>>
>> err_replace_hw_filter:
>
>
>if someone cares .. the err=0 in the the line above the patch is also useless
>because err is never used again. Merging both if will save 1 indent level.
>
> err = mall_replace_hw_filter(tp, new, (unsigned long) new);
> if (err && tc_skip_sw(flags) )
> goto errout;
true, however unrelated to this patch :)
Please submit as a separate patch.
Thanks.
next prev parent reply other threads:[~2017-05-03 15:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-03 13:50 [PATCH] net/sched: remove redundant null check on head Colin King
2017-05-03 14:15 ` Jiri Pirko
2017-05-03 14:21 ` walter harms
2017-05-03 15:12 ` Jiri Pirko [this message]
2017-05-03 17:20 ` walter harms
2017-05-04 15:01 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170503151212.GD2077@nanopsycho.orion \
--to=jiri@resnulli.us \
--cc=colin.king@canonical.com \
--cc=jhs@mojatatu.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=wharms@bfs.de \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox