platform/trivial: rename macro offset_plus_sizeof() to offsetofend()

Linux kernel names this very macor offsetofend(), so name it the
same name to be more recognizable.
This commit is contained in:
Thomas Haller
2016-12-14 23:15:40 +01:00
parent 6070fe697a
commit c1c5149ced

View File

@@ -51,7 +51,7 @@
#include "wifi/wifi-utils-wext.h"
#include "nm-utils/unaligned.h"
#define offset_plus_sizeof(t,m) (offsetof (t,m) + sizeof (((t *) NULL)->m))
#define offsetofend(t,m) (offsetof (t,m) + sizeof (((t *) NULL)->m))
#define VLAN_FLAG_MVRP 0x8
@@ -810,7 +810,7 @@ _parse_af_inet6 (NMPlatform *platform,
{
static struct nla_policy policy[IFLA_INET6_MAX+1] = {
[IFLA_INET6_FLAGS] = { .type = NLA_U32 },
[IFLA_INET6_CACHEINFO] = { .minlen = offset_plus_sizeof(struct ifla_cacheinfo, retrans_time) },
[IFLA_INET6_CACHEINFO] = { .minlen = offsetofend (struct ifla_cacheinfo, retrans_time) },
[IFLA_INET6_CONF] = { .minlen = 4 },
[IFLA_INET6_STATS] = { .minlen = 8 },
[IFLA_INET6_ICMP6STATS] = { .minlen = 8 },
@@ -1218,7 +1218,7 @@ _parse_lnk_vlan (const char *kind, struct nlattr *info_data)
{
static struct nla_policy policy[IFLA_VLAN_MAX+1] = {
[IFLA_VLAN_ID] = { .type = NLA_U16 },
[IFLA_VLAN_FLAGS] = { .minlen = offset_plus_sizeof(struct ifla_vlan_flags, flags) },
[IFLA_VLAN_FLAGS] = { .minlen = offsetofend (struct ifla_vlan_flags, flags) },
[IFLA_VLAN_INGRESS_QOS] = { .type = NLA_NESTED },
[IFLA_VLAN_EGRESS_QOS] = { .type = NLA_NESTED },
[IFLA_VLAN_PROTOCOL] = { .type = NLA_U16 },
@@ -1405,9 +1405,9 @@ _new_from_nl_link (NMPlatform *platform, const NMPCache *cache, struct nlmsghdr
[IFLA_LINKINFO] = { .type = NLA_NESTED },
[IFLA_QDISC] = { .type = NLA_STRING,
.maxlen = IFQDISCSIZ },
[IFLA_STATS] = { .minlen = offset_plus_sizeof(struct rtnl_link_stats, tx_compressed) },
[IFLA_STATS64] = { .minlen = offset_plus_sizeof(struct rtnl_link_stats64, tx_compressed)},
[IFLA_MAP] = { .minlen = offset_plus_sizeof(struct rtnl_link_ifmap, port) },
[IFLA_STATS] = { .minlen = offsetofend (struct rtnl_link_stats, tx_compressed) },
[IFLA_STATS64] = { .minlen = offsetofend (struct rtnl_link_stats64, tx_compressed)},
[IFLA_MAP] = { .minlen = offsetofend (struct rtnl_link_ifmap, port) },
[IFLA_IFALIAS] = { .type = NLA_STRING, .maxlen = IFALIASZ },
[IFLA_NUM_VF] = { .type = NLA_U32 },
[IFLA_AF_SPEC] = { .type = NLA_NESTED },
@@ -1629,7 +1629,7 @@ _new_from_nl_addr (struct nlmsghdr *nlh, gboolean id_only)
static struct nla_policy policy[IFA_MAX+1] = {
[IFA_LABEL] = { .type = NLA_STRING,
.maxlen = IFNAMSIZ },
[IFA_CACHEINFO] = { .minlen = offset_plus_sizeof(struct ifa_cacheinfo, tstamp) },
[IFA_CACHEINFO] = { .minlen = offsetofend (struct ifa_cacheinfo, tstamp) },
};
const struct ifaddrmsg *ifa;
struct nlattr *tb[IFA_MAX+1];
@@ -1746,7 +1746,7 @@ _new_from_nl_route (struct nlmsghdr *nlh, gboolean id_only)
[RTA_OIF] = { .type = NLA_U32 },
[RTA_PRIORITY] = { .type = NLA_U32 },
[RTA_FLOW] = { .type = NLA_U32 },
[RTA_CACHEINFO] = { .minlen = offset_plus_sizeof(struct rta_cacheinfo, rta_tsage) },
[RTA_CACHEINFO] = { .minlen = offsetofend (struct rta_cacheinfo, rta_tsage) },
[RTA_METRICS] = { .type = NLA_NESTED },
[RTA_MULTIPATH] = { .type = NLA_NESTED },
};