[commits] [openwrt-feed-devel] master: batman-adv-devel: Drop compat-hack for nla_put_u64_64bit (4201c39)

postmaster at open-mesh.org postmaster at open-mesh.org
Sat Mar 9 13:02:43 CET 2019


Repository : ssh://git@open-mesh.org/openwrt-feed-devel

On branch  : master

>---------------------------------------------------------------

commit 4201c39d56fe58bc2ebb272080a335bb231ae045
Author: Sven Eckelmann <sven at narfation.org>
Date:   Fri Feb 22 20:19:42 2019 +0100

    batman-adv-devel: Drop compat-hack for nla_put_u64_64bit
    
    nla_put_u64_64bit is already defined by the mac80211's backports and
    doesn't have to be redefined in the compat-hacks.h.
    
    Signed-off-by: Sven Eckelmann <sven at narfation.org>


>---------------------------------------------------------------

4201c39d56fe58bc2ebb272080a335bb231ae045
 batman-adv-devel/src/compat-hacks.h | 93 -------------------------------------
 1 file changed, 93 deletions(-)

diff --git a/batman-adv-devel/src/compat-hacks.h b/batman-adv-devel/src/compat-hacks.h
index 217f4d1..c2e6e31 100644
--- a/batman-adv-devel/src/compat-hacks.h
+++ b/batman-adv-devel/src/compat-hacks.h
@@ -105,99 +105,6 @@ batadv_ethtool_get_link_ksettings(struct net_device *dev,
 #endif /* < KERNEL_VERSION(4, 6, 0) */
 
 
-#include_next <linux/netlink.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0)
-
-#include_next <net/netlink.h>
-
-static inline bool batadv_nla_need_padding_for_64bit(struct sk_buff *skb);
-
-static inline int batadv_nla_align_64bit(struct sk_buff *skb, int padattr)
-{
-	if (batadv_nla_need_padding_for_64bit(skb) &&
-	    !nla_reserve(skb, padattr, 0))
-		return -EMSGSIZE;
-
-	return 0;
-}
-
-static inline struct nlattr *batadv__nla_reserve_64bit(struct sk_buff *skb,
-						       int attrtype,
-						       int attrlen, int padattr)
-{
-	if (batadv_nla_need_padding_for_64bit(skb))
-		batadv_nla_align_64bit(skb, padattr);
-
-	return __nla_reserve(skb, attrtype, attrlen);
-}
-
-static inline void batadv__nla_put_64bit(struct sk_buff *skb, int attrtype,
-					 int attrlen, const void *data,
-					 int padattr)
-{
-	struct nlattr *nla;
-
-	nla = batadv__nla_reserve_64bit(skb, attrtype, attrlen, padattr);
-	memcpy(nla_data(nla), data, attrlen);
-}
-
-static inline bool batadv_nla_need_padding_for_64bit(struct sk_buff *skb)
-{
-#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
-	/* The nlattr header is 4 bytes in size, that's why we test
-	 * if the skb->data _is_ aligned.  A NOP attribute, plus
-	 * nlattr header for next attribute, will make nla_data()
-	 * 8-byte aligned.
-	 */
-	if (IS_ALIGNED((unsigned long)skb_tail_pointer(skb), 8))
-		return true;
-#endif
-	return false;
-}
-
-static inline int batadv_nla_total_size_64bit(int payload)
-{
-	return NLA_ALIGN(nla_attr_size(payload))
-#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
-		+ NLA_ALIGN(nla_attr_size(0))
-#endif
-		;
-}
-
-static inline int batadv_nla_put_64bit(struct sk_buff *skb, int attrtype,
-				       int attrlen, const void *data,
-				       int padattr)
-{
-	size_t len;
-
-	if (batadv_nla_need_padding_for_64bit(skb))
-		len = batadv_nla_total_size_64bit(attrlen);
-	else
-		len = nla_total_size(attrlen);
-	if (unlikely(skb_tailroom(skb) < len))
-		return -EMSGSIZE;
-
-	batadv__nla_put_64bit(skb, attrtype, attrlen, data, padattr);
-	return 0;
-}
-
-#ifdef nla_put_u64_64bit
-#undef nla_put_u64_64bit
-#endif
-
-#define nla_put_u64_64bit(_skb, _attrtype, _value, _padattr) \
-	batadv_nla_put_u64_64bit(_skb, _attrtype, _value, _padattr)
-static inline int batadv_nla_put_u64_64bit(struct sk_buff *skb, int attrtype,
-					   u64 value, int padattr)
-{
-	return batadv_nla_put_64bit(skb, attrtype, sizeof(u64), &value,
-				    padattr);
-}
-
-#endif /* < KERNEL_VERSION(4, 7, 0) */
-
-
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
 
 #include_next <linux/cache.h>



More information about the commits mailing list