mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2026-01-27 22:37:23 +00:00
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:
parent
b45664e064
commit
6f1940da8e
@ -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");
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user