summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-06-12 22:44:48 -0400
committerDavid S. Miller <davem@davemloft.net>2015-06-15 19:02:52 -0400
commit9464ca650008615d28d9aaf7de99b4edf61f0109 (patch)
tree9e1a336c5c5ba06d050132307c80e41a4fcc3b95
parent7f1095394918c7058ff81c96c3bab3a897e97a9d (diff)
net: make u64_stats_init() a function
Using a function instead of a macro is cleaner and remove following W=1 warnings (extract) In file included from net/ipv6/ip6_vti.c:29:0: net/ipv6/ip6_vti.c: In function ‘vti6_dev_init_gen’: include/linux/netdevice.h:2029:18: warning: variable ‘stat’ set but not used [-Wunused-but-set-variable] typeof(type) *stat; \ ^ net/ipv6/ip6_vti.c:862:16: note: in expansion of macro ‘netdev_alloc_pcpu_stats’ dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats); ^ CC [M] net/ipv6/sit.o In file included from net/ipv6/sit.c:30:0: net/ipv6/sit.c: In function ‘ipip6_tunnel_init’: include/linux/netdevice.h:2029:18: warning: variable ‘stat’ set but not used [-Wunused-but-set-variable] typeof(type) *stat; \ ^ Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/u64_stats_sync.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h
index 4b4439e75f45..df89c9bcba7d 100644
--- a/include/linux/u64_stats_sync.h
+++ b/include/linux/u64_stats_sync.h
@@ -68,11 +68,12 @@ struct u64_stats_sync {
68}; 68};
69 69
70 70
71static inline void u64_stats_init(struct u64_stats_sync *syncp)
72{
71#if BITS_PER_LONG == 32 && defined(CONFIG_SMP) 73#if BITS_PER_LONG == 32 && defined(CONFIG_SMP)
72# define u64_stats_init(syncp) seqcount_init(syncp.seq) 74 seqcount_init(&syncp->seq);
73#else
74# define u64_stats_init(syncp) do { } while (0)
75#endif 75#endif
76}
76 77
77static inline void u64_stats_update_begin(struct u64_stats_sync *syncp) 78static inline void u64_stats_update_begin(struct u64_stats_sync *syncp)
78{ 79{