summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Coelho <luciano.coelho@intel.com>2018-09-20 14:28:38 +0300
committerJohannes Berg <johannes.berg@intel.com>2018-09-24 09:28:51 +0200
commit351e820b3011171257f9388bd19e458a7c909f8c (patch)
tree3eabaab89edaec4e52733c635213af43c82341f3
parent0782ee3bd8a245d70696ca2b0f0733a980c62764 (diff)
backport: update u64_stats_init() to a new version in kernels < 4.2
The u64_stats_init() macro was turned into a static inline function in v4.2 to prevent warnings that happen when its argument is not used elsewhere. Since we started hitting these warnings, undefine the macro and define the static inline to prevent them. Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--backport/backport-include/linux/netdevice.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index 8723f8c5..44319331 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -263,6 +263,16 @@ netdev_features_t passthru_features_check(struct sk_buff *skb,
netdev_features_t features);
#endif /* LINUX_VERSION_IS_LESS(4,1,0) */
+#if LINUX_VERSION_IS_LESS(4,2,0)
+#undef u64_stats_init
+static inline void u64_stats_init(struct u64_stats_sync *syncp)
+{
+#if BITS_PER_LONG == 32 && defined(CONFIG_SMP)
+ seqcount_init(&syncp->seq);
+#endif
+}
+#endif /* LINUX_VERSION_IS_LESS(4,2,0) */
+
#ifndef netdev_alloc_pcpu_stats
#define netdev_alloc_pcpu_stats(type) \
({ \