platform/netlink: drop nlmsg_alloc_inherit() function

It's only used internally, and it seems not very useful to have.
As it is confusing to have multiple functions for doing something
similar, drop it -- since it's not really used. I also cannot imagine
a good use-case for it.
This commit is contained in:
Thomas Haller 2018-07-15 14:18:56 +02:00
parent 09aaeb83b7
commit 5fd4ca8a5b
2 changed files with 7 additions and 28 deletions

View file

@ -331,27 +331,6 @@ nlmsg_alloc (void)
return nlmsg_alloc_size (get_default_page_size ());
}
/**
* Allocate a new netlink message with maximum payload size specified.
*/
struct nl_msg *
nlmsg_alloc_inherit (struct nlmsghdr *hdr)
{
struct nl_msg *nm;
nm = nlmsg_alloc ();
if (hdr) {
struct nlmsghdr *new = nm->nm_nlh;
new->nlmsg_type = hdr->nlmsg_type;
new->nlmsg_flags = hdr->nlmsg_flags;
new->nlmsg_seq = hdr->nlmsg_seq;
new->nlmsg_pid = hdr->nlmsg_pid;
}
return nm;
}
struct nl_msg *
nlmsg_alloc_convert (struct nlmsghdr *hdr)
{
@ -365,12 +344,14 @@ nlmsg_alloc_convert (struct nlmsghdr *hdr)
struct nl_msg *
nlmsg_alloc_simple (int nlmsgtype, int flags)
{
struct nlmsghdr nlh = {
.nlmsg_type = nlmsgtype,
.nlmsg_flags = flags,
};
struct nl_msg *nm;
struct nlmsghdr *new;
return nlmsg_alloc_inherit (&nlh);
nm = nlmsg_alloc ();
new = nm->nm_nlh;
new->nlmsg_type = nlmsgtype;
new->nlmsg_flags = flags;
return nm;
}
int

View file

@ -314,8 +314,6 @@ struct nl_msg *nlmsg_alloc (void);
struct nl_msg *nlmsg_alloc_size (size_t max);
struct nl_msg *nlmsg_alloc_inherit (struct nlmsghdr *hdr);
struct nl_msg *nlmsg_alloc_convert (struct nlmsghdr *hdr);
struct nl_msg *nlmsg_alloc_simple (int nlmsgtype, int flags);