diff options
author | Johannes Berg <johannes.berg@intel.com> | 2017-02-07 11:20:07 +0100 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2017-02-07 15:07:19 +0100 |
commit | 9f6fe7d9cb7f0af694cab339523b587b96555763 (patch) | |
tree | 915f3ed55768a573dcc99ebbae86638ef41e1e34 /patches | |
parent | 5911d6171cce4f3cc0cf1cdf918896aac2e03b0f (diff) |
backports: add spatch to backport ndo_stats64 prototype change
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'patches')
-rw-r--r-- | patches/0075-ndo-stats-64.cocci | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/patches/0075-ndo-stats-64.cocci b/patches/0075-ndo-stats-64.cocci new file mode 100644 index 00000000..ac449de2 --- /dev/null +++ b/patches/0075-ndo-stats-64.cocci @@ -0,0 +1,28 @@ +@r@ +identifier OPS; +identifier stats64_fn; +fresh identifier stats64_fn_wrap = "bp_" ## stats64_fn; +position p; +@@ +struct net_device_ops OPS@p = { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0) + .ndo_get_stats64 = stats64_fn, ++#else ++ .ndo_get_stats64 = stats64_fn_wrap, ++#endif +}; + +@@ +identifier r.stats64_fn_wrap; +identifier r.stats64_fn; +@@ +void stats64_fn(...) {...} ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0) ++static struct rtnl_link_stats64 * ++stats64_fn_wrap(struct net_device *dev, ++ struct rtnl_link_stats64 *stats) ++{ ++ stats64_fn(dev, stats); ++ return stats; ++} ++#endif |