mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 23:05:39 +00:00
code: Fix checkpatch.pl warnings since v0.1
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
@@ -31,7 +31,7 @@ static int nlmsg_receive(char *buf, int len, int (*cb)(struct nlmsghdr *, void *
|
||||
if (hdr->nlmsg_type == NLMSG_DONE)
|
||||
return 0;
|
||||
if (hdr->nlmsg_type == NLMSG_ERROR) {
|
||||
struct nlmsgerr *err = (struct nlmsgerr*)NLMSG_DATA(hdr);
|
||||
struct nlmsgerr *err = (struct nlmsgerr *)NLMSG_DATA(hdr);
|
||||
|
||||
if (hdr->nlmsg_len - sizeof(*hdr) < sizeof(struct nlmsgerr)) {
|
||||
pr_err("ERROR truncated\n");
|
||||
@@ -66,7 +66,7 @@ int do_rtnl_req(int nl, void *req, int size,
|
||||
msg.msg_iovlen = 1;
|
||||
|
||||
memset(&nladdr, 0, sizeof(nladdr));
|
||||
nladdr.nl_family= AF_NETLINK;
|
||||
nladdr.nl_family = AF_NETLINK;
|
||||
|
||||
iov.iov_base = req;
|
||||
iov.iov_len = size;
|
||||
@@ -120,7 +120,7 @@ int addattr_l(struct nlmsghdr *n, int maxlen, int type, const void *data,
|
||||
struct rtattr *rta;
|
||||
|
||||
if (NLMSG_ALIGN(n->nlmsg_len) + RTA_ALIGN(len) > maxlen) {
|
||||
pr_err("addattr_l ERROR: message exceeded bound of %d\n",maxlen);
|
||||
pr_err("addattr_l ERROR: message exceeded bound of %d\n", maxlen);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
2
net.c
2
net.c
@@ -78,7 +78,7 @@ static int dump_one_link(struct nlmsghdr *hdr, void *arg)
|
||||
struct cr_fdset *fds = arg;
|
||||
struct ifinfomsg *ifi;
|
||||
int ret = 0, len = hdr->nlmsg_len - NLMSG_LENGTH(sizeof(*ifi));
|
||||
struct rtattr * tb[IFLA_MAX+1];
|
||||
struct rtattr *tb[IFLA_MAX + 1];
|
||||
|
||||
ifi = NLMSG_DATA(hdr);
|
||||
|
||||
|
@@ -685,9 +685,12 @@ err:
|
||||
|
||||
static char nybble(const char n)
|
||||
{
|
||||
if (n >= '0' && n <= '9') return n - '0';
|
||||
else if (n >= 'A' && n <= 'F') return n - ('A' - 10);
|
||||
else if (n >= 'a' && n <= 'f') return n - ('a' - 10);
|
||||
if (n >= '0' && n <= '9')
|
||||
return n - '0';
|
||||
else if (n >= 'A' && n <= 'F')
|
||||
return n - ('A' - 10);
|
||||
else if (n >= 'a' && n <= 'f')
|
||||
return n - ('a' - 10);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -319,12 +319,12 @@ static int inet_validate_address(InetSkEntry *ie)
|
||||
if ((ie->family == AF_INET) &&
|
||||
/* v0.1 had 4 in ipv4 addr len */
|
||||
(ie->n_src_addr >= PB_ALEN_INET) &&
|
||||
(ie->n_dst_addr >= PB_ALEN_INET) )
|
||||
(ie->n_dst_addr >= PB_ALEN_INET))
|
||||
return 0;
|
||||
|
||||
if ((ie->family == AF_INET6) &&
|
||||
(ie->n_src_addr == PB_ALEN_INET6) &&
|
||||
(ie->n_dst_addr == PB_ALEN_INET6) )
|
||||
(ie->n_dst_addr == PB_ALEN_INET6))
|
||||
return 0;
|
||||
|
||||
pr_err("Addr len mismatch f %d ss %lu ds %lu\n", ie->family,
|
||||
|
Reference in New Issue
Block a user