netdev
[Top] [All Lists]

Re: [PATCH 2/9] PKT_SCHED: tc filter extension API

To: Patrick McHardy <kaber@xxxxxxxxx>
Subject: Re: [PATCH 2/9] PKT_SCHED: tc filter extension API
From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxxxxxxxx>
Date: Fri, 31 Dec 2004 00:04:29 -0200
Cc: Thomas Graf <tgraf@xxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Jamal Hadi Salim <hadi@xxxxxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <41D4A4D2.4000109@xxxxxxxxx>
Organization: Conectiva S.A.
References: <20041230122652.GM32419@xxxxxxxxxxxxxx> <20041230123023.GO32419@xxxxxxxxxxxxxx> <41D4A4D2.4000109@xxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla Thunderbird 0.9 (X11/20041103)
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

<Prev in Thread] Current Thread [Next in Thread>