Unverified Commit a65febb0 by Tobin C. Harding Committed by Christian Brauner

cmd: Do not use comparison to NULL

checkpatch emits two warnings of type: CHECK: Comparison to NULL could be written "!foo" Prefer `(!foo)` instead of `(foo == NULL)`. Do not use comparison to NULL, use !foo Signed-off-by: 's avatarTobin C. Harding <me@tobin.cc>
parent 746eb137
...@@ -208,7 +208,7 @@ static int lxc_monitord_sock_accept(int fd, uint32_t events, void *data, ...@@ -208,7 +208,7 @@ static int lxc_monitord_sock_accept(int fd, uint32_t events, void *data,
clientfds = realloc(mon->clientfds, clientfds = realloc(mon->clientfds,
(mon->clientfds_size + CLIENTFDS_CHUNK) * sizeof(mon->clientfds[0])); (mon->clientfds_size + CLIENTFDS_CHUNK) * sizeof(mon->clientfds[0]));
if (clientfds == NULL) { if (!clientfds) {
ERROR("Failed to realloc memory for %d client file descriptors", ERROR("Failed to realloc memory for %d client file descriptors",
mon->clientfds_size + CLIENTFDS_CHUNK); mon->clientfds_size + CLIENTFDS_CHUNK);
goto err1; goto err1;
......
...@@ -752,7 +752,7 @@ static char *get_nic_if_avail(int fd, struct alloted_s *names, int pid, ...@@ -752,7 +752,7 @@ static char *get_nic_if_avail(int fd, struct alloted_s *names, int pid,
lxc_strmunmap(buf, sb.st_size); lxc_strmunmap(buf, sb.st_size);
} }
if (owner == NULL) if (!owner)
return NULL; return NULL;
ret = snprintf(nicname, sizeof(nicname), "vethXXXXXX"); ret = snprintf(nicname, sizeof(nicname), "vethXXXXXX");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment