linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: shaozhengchao <shaozhengchao@huawei.com>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<toke@toke.dk>, <jhs@mojatatu.com>, <jiri@resnulli.us>,
	<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
	<pabeni@redhat.com>, <stephen@networkplumber.org>,
	<cake@lists.bufferbloat.net>, <weiyongjun1@huawei.com>,
	<yuehaibing@huawei.com>
Subject: Re: [PATCH net-next] net: sched: remove redundant NULL check in change hook function
Date: Mon, 29 Aug 2022 15:00:55 +0800	[thread overview]
Message-ID: <012b98b7-dd8f-2df6-6b78-a0da6dd8065a@huawei.com> (raw)
In-Reply-To: <YwxQQOzw/dGKJKyB@pop-os.localdomain>



On 2022/8/29 13:36, Cong Wang wrote:
> On Sat, Aug 27, 2022 at 09:49:10AM +0800, Zhengchao Shao wrote:
>> Currently, the change function can be called by two ways. The one way is
>> that qdisc_change() will call it. Before calling change function,
>> qdisc_change() ensures tca[TCA_OPTIONS] is not empty. The other way is
>> that .init() will call it. The opt parameter is also checked before
>> calling change function in .init(). Therefore, it's no need to check the
>> input parameter opt in change function.
>>
> 
> Right.. but the one below:
> 
>> diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
>> index c50a0853dcb9..e23d3dbb7272 100644
>> --- a/net/sched/sch_gred.c
>> +++ b/net/sched/sch_gred.c
>> @@ -413,9 +413,6 @@ static int gred_change_table_def(struct Qdisc *sch, struct nlattr *dps,
>>   	bool red_flags_changed;
>>   	int i;
>>   
>> -	if (!dps)
>> -		return -EINVAL;
>> -
> 
> I don't think anyone checks tb[TCA_GRED_DPS]. What you intended to patch
> is gred_change(), right?
> 
> Thanks.

Hi Wang:
	Thank you for your reply. You are right. I will send v2.

Zhengchao Shao

      reply	other threads:[~2022-08-29  7:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-27  1:49 [PATCH net-next] net: sched: remove redundant NULL check in change hook function Zhengchao Shao
2022-08-29  5:36 ` Cong Wang
2022-08-29  7:00   ` shaozhengchao [this message]

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=012b98b7-dd8f-2df6-6b78-a0da6dd8065a@huawei.com \
    --to=shaozhengchao@huawei.com \
    --cc=cake@lists.bufferbloat.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stephen@networkplumber.org \
    --cc=toke@toke.dk \
    --cc=weiyongjun1@huawei.com \
    --cc=xiyou.wangcong@gmail.com \
    --cc=yuehaibing@huawei.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;
as well as URLs for NNTP newsgroup(s).