From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id D906B3B2A4 for ; Mon, 29 Aug 2022 01:36:03 -0400 (EDT) Received: by mail-oi1-x233.google.com with SMTP id t140so9214433oie.8 for ; Sun, 28 Aug 2022 22:36:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=YPIk4Y6Ukvku/o4Tv5ZXhZ7lEnBtiiRp5ib7DSWGFM8=; b=Y2xNXQgUOvz57ZKdc/N+XMhEmLBm3bj1XlrpxOKnPOLBHuD5HmoY+DnVWRW0mN6ADh VPvL08VGntcxFZlFmTsY0KVnEMpTn2crFVNbylHVURnsprc1R4w+ono9iXtTBWTwWyXU x8EaxkKwqg9+puYxL/yEm3qTriPDWm74Z5kLYF+UgeKsEYEknMN/fCEXpHd8nt+8FljG nzbWg/aQakThnqhYoMXVVZk+TTTYsKC/Pg2YtsoOh64hr86qXWJR1my4Z5l93GMcQr1G fDMQleXph7i5wXyuigTsrEwfCeKUKZaIhPoezvyykO0QXPHnk1B0YvbB5JUSVdj3cIBl Gsrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=YPIk4Y6Ukvku/o4Tv5ZXhZ7lEnBtiiRp5ib7DSWGFM8=; b=0amUFEDPem1c2lqJYJikIossUWssay3sT2FlbZP55YW8Lc3cifqqliJNYUE/bEkPiY YA4tTIiLy5a3Tl59NY11lmGNxY+8XMU5k44G8NNcvOPUx6NVNc/bPPciBSqghw/ydG/v C2avdCio+ktgMDyWphAFWzHDA4ORv53+CzWu3YZJTUz4GXUfp8/Qptoznc1vh2U9fGkH JxTppJyrSDuY0FmXJtqDq0LWfGFLZbvEpQRtP8a+/G6urNu8sHXlmwf3C5r/4uFuHeea k4ydurulQ/bGHjqijqiEWrMVhL4c+56sOq7o9IxfbJKv1O4TNooEAYCg28UQQFT97dMv FS6A== X-Gm-Message-State: ACgBeo376N2JIwRTFI5Fdnpg8CDxAie716tCtToRzEuCkONJKoyvIcSG NZzJd5qkLUTgwGPHZEwqPBc= X-Google-Smtp-Source: AA6agR4GofH7Oodg45bBR88TpKCljUFomt/mN0bMVxq3I+QI5h2I1XrvzY/CghUNf0ozvIqP0b/nsA== X-Received: by 2002:a05:6808:1594:b0:343:2e08:ceaf with SMTP id t20-20020a056808159400b003432e08ceafmr6448552oiw.181.1661751363041; Sun, 28 Aug 2022 22:36:03 -0700 (PDT) Received: from localhost ([2600:1700:65a0:ab60:5e78:4de7:b681:c052]) by smtp.gmail.com with ESMTPSA id r65-20020a4a3744000000b00445313616aesm4592061oor.21.2022.08.28.22.36.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Aug 2022 22:36:02 -0700 (PDT) Date: Sun, 28 Aug 2022 22:36:00 -0700 From: Cong Wang To: Zhengchao Shao 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 Message-ID: References: <20220827014910.215062-1-shaozhengchao@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220827014910.215062-1-shaozhengchao@huawei.com> Subject: Re: [Cake] [PATCH net-next] net: sched: remove redundant NULL check in change hook function X-BeenThere: cake@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: Cake - FQ_codel the next generation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2022 05:36:04 -0000 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.