From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [patch net-next v3 02/10] net: sched: introduce tcf block infractructure Date: Tue, 16 May 2017 22:57:46 +0200 Message-ID: <20170516205746.GQ1939@nanopsycho.orion> References: <20170516172802.1317-1-jiri@resnulli.us> <20170516172802.1317-3-jiri@resnulli.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linux Kernel Network Developers , David Miller , Jamal Hadi Salim , David Ahern , Eric Dumazet , Stephen Hemminger , Daniel Borkmann , Alexander Duyck , Simon Horman , mlxsw@mellanox.com To: Cong Wang Return-path: Received: from mail-wr0-f196.google.com ([209.85.128.196]:34590 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752258AbdEPU5t (ORCPT ); Tue, 16 May 2017 16:57:49 -0400 Received: by mail-wr0-f196.google.com with SMTP id 6so15362788wrb.1 for ; Tue, 16 May 2017 13:57:48 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Tue, May 16, 2017 at 10:51:30PM CEST, xiyou.wangcong@gmail.com wrote: >On Tue, May 16, 2017 at 10:27 AM, Jiri Pirko wrote: >> +int tcf_block_get(struct tcf_block **p_block, >> + struct tcf_proto __rcu **p_filter_chain) >> +{ >> + struct tcf_block *block = kzalloc(sizeof(*block), GFP_KERNEL); >> + >> + if (!block) >> + return -ENOMEM; >> + block->p_filter_chain = p_filter_chain; >> + *p_block = block; >> + return 0; >> +} >> +EXPORT_SYMBOL(tcf_block_get); > > >XXX_get() is usually for refcnt'ing, here you only allocate >a block, so please rename it to tcf_block_alloc(). I already replied to the same Jamal's comment. > > >> + >> +void tcf_block_put(struct tcf_block *block) >> +{ >> + if (!block) >> + return; >> + tcf_destroy_chain(block->p_filter_chain); >> + kfree(block); >> +} >> +EXPORT_SYMBOL(tcf_block_put); > >Ditto, tcf_block_destroy().