diff options
author | Johannes Berg <johannes.berg@intel.com> | 2017-02-07 23:04:11 +0100 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2017-02-09 14:52:26 +0100 |
commit | e13e44d9a81da4bf77d9869db5b4764fc0811d9f (patch) | |
tree | c610ae2b0f634df75fe88f65a047e5c741c9b0af /backport/backport-include/net | |
parent | 46939c43903da6b202c95a0fcb24acce55fd63c0 (diff) |
backports: always use new version compare macros
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'backport/backport-include/net')
-rw-r--r-- | backport/backport-include/net/addrconf.h | 4 | ||||
-rw-r--r-- | backport/backport-include/net/flow_keys.h | 2 | ||||
-rw-r--r-- | backport/backport-include/net/genetlink.h | 12 | ||||
-rw-r--r-- | backport/backport-include/net/inet_frag.h | 16 | ||||
-rw-r--r-- | backport/backport-include/net/ip.h | 2 | ||||
-rw-r--r-- | backport/backport-include/net/ip6_fib.h | 4 | ||||
-rw-r--r-- | backport/backport-include/net/ipv6.h | 8 | ||||
-rw-r--r-- | backport/backport-include/net/iw_handler.h | 18 | ||||
-rw-r--r-- | backport/backport-include/net/net_namespace.h | 6 | ||||
-rw-r--r-- | backport/backport-include/net/netlink.h | 14 | ||||
-rw-r--r-- | backport/backport-include/net/sch_generic.h | 6 | ||||
-rw-r--r-- | backport/backport-include/net/sock.h | 10 | ||||
-rw-r--r-- | backport/backport-include/net/tso.h | 2 |
13 files changed, 52 insertions, 52 deletions
diff --git a/backport/backport-include/net/addrconf.h b/backport/backport-include/net/addrconf.h index c4caa99a..f1e8e627 100644 --- a/backport/backport-include/net/addrconf.h +++ b/backport/backport-include/net/addrconf.h @@ -5,7 +5,7 @@ #include <linux/version.h> -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) +#if LINUX_VERSION_IS_LESS(3,9,0) static inline bool ipv6_addr_is_solict_mult(const struct in6_addr *addr) { #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 @@ -20,6 +20,6 @@ static inline bool ipv6_addr_is_solict_mult(const struct in6_addr *addr) (addr->s6_addr[12] ^ 0xff)) == 0; #endif } -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) */ +#endif /* LINUX_VERSION_IS_LESS(3,9,0) */ #endif /* _BACKPORT_NET_ADDRCONF_H */ diff --git a/backport/backport-include/net/flow_keys.h b/backport/backport-include/net/flow_keys.h index a875ee6e..093bc80a 100644 --- a/backport/backport-include/net/flow_keys.h +++ b/backport/backport-include/net/flow_keys.h @@ -1,4 +1,4 @@ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)) +#if LINUX_VERSION_IS_GEQ(3,3,0) #include_next <net/flow_keys.h> #else diff --git a/backport/backport-include/net/genetlink.h b/backport/backport-include/net/genetlink.h index a46ac603..4b31d73f 100644 --- a/backport/backport-include/net/genetlink.h +++ b/backport/backport-include/net/genetlink.h @@ -4,7 +4,7 @@ #include <linux/version.h> /* this is for patches we apply */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) +#if LINUX_VERSION_IS_LESS(3,7,0) #define genl_info_snd_portid(__genl_info) (__genl_info->snd_pid) #else #define genl_info_snd_portid(__genl_info) (__genl_info->snd_portid) @@ -14,11 +14,11 @@ #define GENLMSG_DEFAULT_SIZE (NLMSG_DEFAULT_SIZE - GENL_HDRLEN) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0) +#if LINUX_VERSION_IS_LESS(3,1,0) #define genl_dump_check_consistent(cb, user_hdr, family) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) && RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0) +#if LINUX_VERSION_IS_LESS(3,13,0) && RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0) static inline int __real_genl_register_family(struct genl_family *family) { return genl_register_family(family); @@ -86,7 +86,7 @@ _genl_register_family_with_ops_grps(struct genl_family *family, #define genl_unregister_family backport_genl_unregister_family int genl_unregister_family(struct genl_family *family); -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) +#if LINUX_VERSION_IS_LESS(3,3,0) extern void genl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group, struct nlmsghdr *nlh, gfp_t flags); #endif @@ -146,7 +146,7 @@ backport_genlmsg_multicast_allns(struct genl_family *family, #define __genl_const #else /* < 3.13 */ #define __genl_const const -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) +#if LINUX_VERSION_IS_LESS(4,4,0) #define genl_notify(_fam, _skb, _info, _group, _flags) \ genl_notify(_fam, _skb, genl_info_net(_info), \ genl_info_snd_portid(_info), \ @@ -154,7 +154,7 @@ backport_genlmsg_multicast_allns(struct genl_family *family, #endif /* < 4.4 */ #endif /* < 3.13 */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0) +#if LINUX_VERSION_IS_LESS(4,10,0) /** * genl_family_attrbuf - return family's attrbuf * @family: the family diff --git a/backport/backport-include/net/inet_frag.h b/backport/backport-include/net/inet_frag.h index 055dae14..e95eac33 100644 --- a/backport/backport-include/net/inet_frag.h +++ b/backport/backport-include/net/inet_frag.h @@ -3,7 +3,7 @@ #include_next <net/inet_frag.h> #include <linux/version.h> -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) +#if LINUX_VERSION_IS_LESS(3,9,0) /* Memory Tracking Functions. */ #define frag_mem_limit LINUX_BACKPORT(frag_mem_limit) static inline int frag_mem_limit(struct netns_frags *nf) @@ -26,10 +26,10 @@ static inline int sum_frag_mem_limit(struct netns_frags *nf) #define inet_frag_maybe_warn_overflow LINUX_BACKPORT(inet_frag_maybe_warn_overflow) void inet_frag_maybe_warn_overflow(struct inet_frag_queue *q, const char *prefix); -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) */ +#endif /* LINUX_VERSION_IS_LESS(3,9,0) */ /* the type of the paramater changed with kernel 4.3 */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) +#if LINUX_VERSION_IS_LESS(3,9,0) #define sub_frag_mem_limit LINUX_BACKPORT(sub_frag_mem_limit) static inline void sub_frag_mem_limit(struct netns_frags *nf, int i) { @@ -41,7 +41,7 @@ static inline void add_frag_mem_limit(struct netns_frags *nf, int i) { atomic_add(i, &nf->mem); } -#elif LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0) +#elif LINUX_VERSION_IS_LESS(4,3,0) #define sub_frag_mem_limit LINUX_BACKPORT(sub_frag_mem_limit) static inline void sub_frag_mem_limit(struct netns_frags *nf, int i) { @@ -53,10 +53,10 @@ static inline void add_frag_mem_limit(struct netns_frags *nf, int i) { __percpu_counter_add(&nf->mem, i, frag_percpu_counter_batch); } -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0) */ +#endif /* LINUX_VERSION_IS_LESS(4,3,0) */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) && \ - LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0) +#if LINUX_VERSION_IS_LESS(4,4,0) && \ + LINUX_VERSION_IS_GEQ(3,9,0) #define inet_frags_uninit_net LINUX_BACKPORT(inet_frags_uninit_net) static inline void inet_frags_uninit_net(struct netns_frags *nf) { @@ -64,7 +64,7 @@ static inline void inet_frags_uninit_net(struct netns_frags *nf) } #endif /* < 4.4 && >= 3.9 */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) +#if LINUX_VERSION_IS_LESS(4,4,0) static inline int backport_inet_frags_init_net(struct netns_frags *nf) { inet_frags_init_net(nf); diff --git a/backport/backport-include/net/ip.h b/backport/backport-include/net/ip.h index 909e6039..6893ba51 100644 --- a/backport/backport-include/net/ip.h +++ b/backport/backport-include/net/ip.h @@ -3,7 +3,7 @@ #include_next <net/ip.h> #include <linux/version.h> -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0) +#if LINUX_VERSION_IS_LESS(3,1,0) /* Backports 56f8a75c */ static inline bool ip_is_fragment(const struct iphdr *iph) { diff --git a/backport/backport-include/net/ip6_fib.h b/backport/backport-include/net/ip6_fib.h index ebdc94c7..2f21163d 100644 --- a/backport/backport-include/net/ip6_fib.h +++ b/backport/backport-include/net/ip6_fib.h @@ -9,7 +9,7 @@ * This function is avaliable with one argument since kernel 3.10, but the * secound one was added in 4.2. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) +#if LINUX_VERSION_IS_LESS(4,2,0) #define rt6_nexthop LINUX_BACKPORT(rt6_nexthop) static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt, struct in6_addr *daddr) @@ -21,6 +21,6 @@ static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt, else return daddr; } -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) */ +#endif /* LINUX_VERSION_IS_LESS(4,2,0) */ #endif /* __BACKPORT_NET_IP6_ROUTE_H */ diff --git a/backport/backport-include/net/ipv6.h b/backport/backport-include/net/ipv6.h index 762ad781..7416d6b0 100644 --- a/backport/backport-include/net/ipv6.h +++ b/backport/backport-include/net/ipv6.h @@ -5,7 +5,7 @@ #include <net/addrconf.h> #include <net/inet_frag.h> -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) +#if LINUX_VERSION_IS_LESS(3,7,0) /* * Equivalent of ipv4 struct ip */ @@ -21,9 +21,9 @@ struct frag_queue { unsigned int csum; __u16 nhoffset; }; -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) */ +#endif /* LINUX_VERSION_IS_LESS(3,7,0) */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0) +#if LINUX_VERSION_IS_LESS(3,6,0) #define ipv6_addr_hash LINUX_BACKPORT(ipv6_addr_hash) static inline u32 ipv6_addr_hash(const struct in6_addr *a) { @@ -39,7 +39,7 @@ static inline u32 ipv6_addr_hash(const struct in6_addr *a) } #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,5,0) +#if LINUX_VERSION_IS_LESS(4,5,0) #define ipv6_addr_prefix_copy LINUX_BACKPORT(ipv6_addr_prefix_copy) static inline void ipv6_addr_prefix_copy(struct in6_addr *addr, const struct in6_addr *pfx, diff --git a/backport/backport-include/net/iw_handler.h b/backport/backport-include/net/iw_handler.h index b4571016..84d63b30 100644 --- a/backport/backport-include/net/iw_handler.h +++ b/backport/backport-include/net/iw_handler.h @@ -2,7 +2,7 @@ #define __BACKPORT_IW_HANDLER_H #include_next <net/iw_handler.h> -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) +#if LINUX_VERSION_IS_LESS(4,1,0) static inline char * iwe_stream_add_event_check(struct iw_request_info *info, char *stream, char *ends, struct iw_event *iwe, int event_len) @@ -24,16 +24,16 @@ iwe_stream_add_point_check(struct iw_request_info *info, char *stream, return ERR_PTR(-E2BIG); return res; } -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) */ +#endif /* LINUX_VERSION_IS_LESS(4,1,0) */ /* this was added in v3.2.79, v3.18.30, v4.1.21, v4.4.6 and 4.5 */ -#if !(LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,6) || \ - (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,21) && \ - LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)) || \ - (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,30) && \ - LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)) || \ - (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,79) && \ - LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))) +#if !(LINUX_VERSION_IS_GEQ(4,4,6) || \ + (LINUX_VERSION_IS_GEQ(4,1,21) && \ + LINUX_VERSION_IS_LESS(4,2,0)) || \ + (LINUX_VERSION_IS_GEQ(3,18,30) && \ + LINUX_VERSION_IS_LESS(3,19,0)) || \ + (LINUX_VERSION_IS_GEQ(3,2,79) && \ + LINUX_VERSION_IS_LESS(3,3,0))) #define wireless_nlevent_flush LINUX_BACKPORT(wireless_nlevent_flush) static inline void wireless_nlevent_flush(void) {} #endif diff --git a/backport/backport-include/net/net_namespace.h b/backport/backport-include/net/net_namespace.h index b4c6b990..1e84297c 100644 --- a/backport/backport-include/net/net_namespace.h +++ b/backport/backport-include/net/net_namespace.h @@ -3,7 +3,7 @@ #include_next <net/net_namespace.h> -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,20,0) +#if LINUX_VERSION_IS_LESS(3,20,0) /* * In older kernels we simply fail this function. */ @@ -14,7 +14,7 @@ static inline struct net *get_net_ns_by_fd(int fd) } #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) +#if LINUX_VERSION_IS_LESS(4,1,0) typedef struct { #ifdef CONFIG_NET_NS struct net *net; @@ -39,6 +39,6 @@ static inline struct net *possible_read_pnet(const possible_net_t *pnet) #else #define possible_write_pnet(pnet, net) write_pnet(pnet, net) #define possible_read_pnet(pnet) read_pnet(pnet) -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) */ +#endif /* LINUX_VERSION_IS_LESS(4,1,0) */ #endif /* _COMPAT_NET_NET_NAMESPACE_H */ diff --git a/backport/backport-include/net/netlink.h b/backport/backport-include/net/netlink.h index 3cc1a365..9a3def77 100644 --- a/backport/backport-include/net/netlink.h +++ b/backport/backport-include/net/netlink.h @@ -4,7 +4,7 @@ #include <linux/version.h> #include <linux/in6.h> -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) +#if LINUX_VERSION_IS_LESS(3,7,0) /** * nla_put_s8 - Add a s8 netlink attribute to a socket buffer * @skb: socket buffer to add attribute to @@ -86,7 +86,7 @@ static inline s64 nla_get_s64(const struct nlattr *nla) } #endif /* < 3.7.0 */ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) +#if LINUX_VERSION_IS_LESS(3,5,0) /* * This backports: * commit 569a8fc38367dfafd87454f27ac646c8e6b54bca @@ -115,7 +115,7 @@ static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value) } #endif /* < 3.5 */ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)) +#if LINUX_VERSION_IS_LESS(3,7,0) #define NLA_S8 (NLA_BINARY + 1) #define NLA_S16 (NLA_BINARY + 2) #define NLA_S32 (NLA_BINARY + 3) @@ -126,7 +126,7 @@ static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value) #define NLA_TYPE_MAX (__NLA_TYPE_MAX - 1) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) +#if LINUX_VERSION_IS_LESS(4,1,0) #define nla_put_in_addr LINUX_BACKPORT(nla_put_in_addr) static inline int nla_put_in_addr(struct sk_buff *skb, int attrtype, __be32 addr) @@ -155,7 +155,7 @@ static inline struct in6_addr nla_get_in6_addr(const struct nlattr *nla) } #endif /* < 4.1 */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) +#if LINUX_VERSION_IS_LESS(4,4,0) /** * nla_get_le32 - return payload of __le32 attribute * @nla: __le32 netlink attribute @@ -177,7 +177,7 @@ static inline __le64 nla_get_le64(const struct nlattr *nla) } #endif /* < 4.4 */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0) +#if LINUX_VERSION_IS_LESS(4,7,0) /** * nla_need_padding_for_64bit - test 64-bit alignment of the next attribute * @skb: socket buffer the message is stored in @@ -275,7 +275,7 @@ static inline int nla_put_s64(struct sk_buff *skb, int attrtype, s64 value, } #endif /* < 4.7 */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0) +#if LINUX_VERSION_IS_LESS(4,10,0) /** * nla_memdup - duplicate attribute memory (kmemdup) * @src: netlink attribute to duplicate from diff --git a/backport/backport-include/net/sch_generic.h b/backport/backport-include/net/sch_generic.h index a8637976..cabc6012 100644 --- a/backport/backport-include/net/sch_generic.h +++ b/backport/backport-include/net/sch_generic.h @@ -2,8 +2,8 @@ #define __BACKPORT_NET_SCH_GENERIC_H #include_next <net/sch_generic.h> -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) -#if !((LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,9) && LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,23) && LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))) +#if LINUX_VERSION_IS_LESS(3,3,0) +#if !((LINUX_VERSION_IS_GEQ(3,2,9) && LINUX_VERSION_IS_LESS(3,3,0)) || (LINUX_VERSION_IS_GEQ(3,0,23) && LINUX_VERSION_IS_LESS(3,1,0))) /* mask qdisc_cb_private_validate as RHEL6 backports this */ #define qdisc_cb_private_validate(a,b) compat_qdisc_cb_private_validate(a,b) static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz) @@ -11,7 +11,7 @@ static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz) BUILD_BUG_ON(sizeof(skb->cb) < sizeof(struct qdisc_skb_cb) + sz); } #endif -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) */ +#endif /* LINUX_VERSION_IS_LESS(3,3,0) */ #ifndef TCQ_F_CAN_BYPASS #define TCQ_F_CAN_BYPASS 4 diff --git a/backport/backport-include/net/sock.h b/backport/backport-include/net/sock.h index 490b68cc..89191f37 100644 --- a/backport/backport-include/net/sock.h +++ b/backport/backport-include/net/sock.h @@ -3,7 +3,7 @@ #include_next <net/sock.h> #include <linux/version.h> -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) +#if LINUX_VERSION_IS_LESS(3,9,0) #include <backport/magic.h> #define sk_for_each3(__sk, node, list) \ @@ -27,7 +27,7 @@ #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) +#if LINUX_VERSION_IS_LESS(3,10,0) /* * backport SOCK_SELECT_ERR_QUEUE -- see commit * "net: add option to enable error queue packets waking select" @@ -43,11 +43,11 @@ BUILD_BUG_ON((size) > FIELD_SIZEOF(struct sk_buff, cb)) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) +#if LINUX_VERSION_IS_LESS(4,2,0) #define sk_alloc(net, family, priority, prot, kern) sk_alloc(net, family, priority, prot) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,5,0) +#if LINUX_VERSION_IS_LESS(4,5,0) #define sk_set_bit LINUX_BACKPORT(sk_set_bit) static inline void sk_set_bit(int nr, struct sock *sk) { @@ -55,7 +55,7 @@ static inline void sk_set_bit(int nr, struct sock *sk) } #endif /* < 4.5 */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,5,0) +#if LINUX_VERSION_IS_LESS(4,5,0) #define sk_clear_bit LINUX_BACKPORT(sk_clear_bit) static inline void sk_clear_bit(int nr, struct sock *sk) { diff --git a/backport/backport-include/net/tso.h b/backport/backport-include/net/tso.h index 816928c3..3a3f50b3 100644 --- a/backport/backport-include/net/tso.h +++ b/backport/backport-include/net/tso.h @@ -3,7 +3,7 @@ #include <net/ip.h> -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) +#if LINUX_VERSION_IS_LESS(4,4,0) #define tso_t LINUX_BACKPORT(tso_t) struct tso_t { |