tc: replace left side comparison

The kernel (and iproute2) don't use the if (NULL == x) style
and instead prefer if (!x)

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
Stephen Hemminger 2019-01-25 09:30:14 +13:00 committed by David Ahern
parent b45664e064
commit 6f1940da8e
4 changed files with 4 additions and 6 deletions

View File

@ -363,7 +363,7 @@ tc_print_action(FILE *f, const struct rtattr *arg, unsigned short tot_acts)
parse_rtattr_nested(tb, tot_acts, arg);
if (tab_flush && NULL != tb[0] && NULL == tb[1])
if (tab_flush && tb[0] && !tb[1])
return tc_print_action_flush(f, tb[0]);
open_json_array(PRINT_JSON, "actions");

View File

@ -299,9 +299,8 @@ static int parse_ipt(struct action_util *a, int *argc_p,
int i;
for (i = 0; i < rargc; i++) {
if (NULL == argv[i] || 0 == strcmp(argv[i], "action")) {
if (!argv[i] || strcmp(argv[i], "action") == 0)
break;
}
}
iargc = argc = i;
}

View File

@ -224,9 +224,8 @@ static int parse_ipt(struct action_util *a, int *argc_p,
int i;
for (i = 0; i < rargc; i++) {
if (NULL == argv[i] || 0 == strcmp(argv[i], "action")) {
if (!argv[i] || strcmp(argv[i], "action") == 0)
break;
}
}
iargc = argc = i;
}

View File

@ -857,7 +857,7 @@ void print_tcstats_attr(FILE *fp, struct rtattr *tb[], char *prefix, struct rtat
if (tb[TCA_STATS2]) {
print_tcstats2_attr(fp, tb[TCA_STATS2], prefix, xstats);
if (xstats && NULL == *xstats)
if (xstats && !*xstats)
goto compat_xstats;
return;
}