8613182403e2c88d4bd8cb6204bcb1348a4de0d1
[openwrt/staging/blogic.git] / patches / 0075-ndo-stats-64.cocci
1 @r@
2 identifier OPS;
3 identifier stats64_fn;
4 fresh identifier stats64_fn_wrap = "bp_" ## stats64_fn;
5 position p;
6 @@
7 struct net_device_ops OPS@p = {
8 +#if LINUX_VERSION_IS_GEQ(4,11,0)
9 .ndo_get_stats64 = stats64_fn,
10 +#else
11 + .ndo_get_stats64 = stats64_fn_wrap,
12 +#endif
13 };
14
15 @@
16 identifier r.stats64_fn_wrap;
17 identifier r.stats64_fn;
18 @@
19 void stats64_fn(...) {...}
20 +#if LINUX_VERSION_IS_LESS(4,11,0)
21 +struct rtnl_link_stats64 *
22 +stats64_fn_wrap(struct net_device *dev,
23 + struct rtnl_link_stats64 *stats)
24 +{
25 + stats64_fn(dev, stats);
26 + return stats;
27 +}
28 +#endif