Received: with ECARTIS (v1.0.0; list netdev); Thu, 30 Dec 2004 17:53:50 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iBV1rGoe013579 for ; Thu, 30 Dec 2004 17:53:37 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CkC9I-0000bD-00; Fri, 31 Dec 2004 00:04:16 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 89296753A9; Fri, 31 Dec 2004 00:01:45 -0200 (BRST) Message-ID: <41D4B3AD.9080605@conectiva.com.br> Date: Fri, 31 Dec 2004 00:04:29 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Patrick McHardy Cc: Thomas Graf , "David S. Miller" , Jamal Hadi Salim , netdev@oss.sgi.com Subject: Re: [PATCH 2/9] PKT_SCHED: tc filter extension API References: <20041230122652.GM32419@postel.suug.ch> <20041230123023.GO32419@postel.suug.ch> <41D4A4D2.4000109@trash.net> In-Reply-To: <41D4A4D2.4000109@trash.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13264 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Patrick McHardy wrote: > Thomas Graf wrote: > >> +int >> +tcf_exts_validate(struct tcf_proto *tp, struct rtattr **tb, >> + struct rtattr *rate_tlv, struct tcf_exts *exts, >> + struct tcf_ext_map *map) >> +{ >> + memset(exts, 0, sizeof(*exts)); >> + >> +#ifdef CONFIG_NET_CLS_ACT >> + int err; >> + struct tc_action *act; >> + >> + if (map->police && tb[map->police-1] && rate_tlv) { >> + act = tcf_action_init_1(tb[map->police-1], rate_tlv, "police", >> + TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err); >> + if (NULL == act) > > > Please use act == NULL Agreed, but I understand the people who like this (ugly) style, it becomes less likely to become an "if (act = NULL)", but hey, compilers already helps us with a nice warning. - Arnaldo