public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] net/sched: remove redundant null check on head
Date: Wed, 03 May 2017 17:20:32 +0000	[thread overview]
Message-ID: <590A1160.8050802@bfs.de> (raw)
In-Reply-To: <20170503135040.32023-1-colin.king@canonical.com>



Am 03.05.2017 17:12, schrieb Jiri Pirko:
> 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.
> 

I have no linux git tree available, some one may take this.

re,
 wh

  parent reply	other threads:[~2017-05-03 17:20 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
2017-05-03 17:20 ` walter harms [this message]
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=590A1160.8050802@bfs.de \
    --to=wharms@bfs.de \
    --cc=kernel-janitors@vger.kernel.org \
    /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