]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tipc: Drop unused variable 'genl'
authorPhil Sutter <phil@nwl.cc>
Thu, 18 Oct 2018 13:48:09 +0000 (15:48 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 22 Oct 2018 17:05:43 +0000 (10:05 -0700)
Although initialized by call to libmnl, the variable is used only in a
call to sizeof(). Drop it and call sizeof with its type instead.

Fixes: f043759dd4928 ("tipc: add new TIPC configuration tool")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tipc/node.c

index 0fa1064c72a172f19793bb8a7b8463ef45c3ee33..2fec6753c974d7bc937e41bb1a732e07a098848d 100644 (file)
 
 static int node_list_cb(const struct nlmsghdr *nlh, void *data)
 {
-       struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
        struct nlattr *info[TIPC_NLA_MAX + 1] = {};
        struct nlattr *attrs[TIPC_NLA_NODE_MAX + 1] = {};
        char str[33] = {};
        uint32_t addr;
 
-       mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
+       mnl_attr_parse(nlh, sizeof(struct genlmsghdr), parse_attrs, info);
        if (!info[TIPC_NLA_NODE])
                return MNL_CB_ERROR;
 
@@ -160,7 +159,6 @@ static int cmd_node_set_nodeid(struct nlmsghdr *nlh, const struct cmd *cmd,
 
 static int nodeid_get_cb(const struct nlmsghdr *nlh, void *data)
 {
-       struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
        struct nlattr *info[TIPC_NLA_MAX + 1] = {};
        struct nlattr *attrs[TIPC_NLA_NET_MAX + 1] = {};
        char str[33] = {0,};
@@ -168,7 +166,7 @@ static int nodeid_get_cb(const struct nlmsghdr *nlh, void *data)
        uint64_t *w0 = (uint64_t *) &id[0];
        uint64_t *w1 = (uint64_t *) &id[8];
 
-       mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
+       mnl_attr_parse(nlh, sizeof(struct genlmsghdr), parse_attrs, info);
        if (!info[TIPC_NLA_NET])
                return MNL_CB_ERROR;
 
@@ -207,11 +205,10 @@ static int cmd_node_get_nodeid(struct nlmsghdr *nlh, const struct cmd *cmd,
 
 static int netid_get_cb(const struct nlmsghdr *nlh, void *data)
 {
-       struct genlmsghdr *genl = mnl_nlmsg_get_payload(nlh);
        struct nlattr *info[TIPC_NLA_MAX + 1] = {};
        struct nlattr *attrs[TIPC_NLA_NET_MAX + 1] = {};
 
-       mnl_attr_parse(nlh, sizeof(*genl), parse_attrs, info);
+       mnl_attr_parse(nlh, sizeof(struct genlmsghdr), parse_attrs, info);
        if (!info[TIPC_NLA_NET])
                return MNL_CB_ERROR;