Re: [PATCH 2/9] PKT_SCHED: tc filter extension API
From: Arnaldo Carvalho de Melo <hidden>
Date: 2004-12-31 02:04:29
From: Arnaldo Carvalho de Melo <hidden>
Date: 2004-12-31 02:04:29
Patrick McHardy wrote:
Thomas Graf wrote:quoted
+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