aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2008-01-02 00:58:02 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:00:31 -0500
commit9a429c4983deae020f1e757ecc8f547b6d4e2f2b (patch)
tree172e27a5866e182b902cd77506df1755aafadb60 /net/core
parentb950dfcf504842a0f2bb142a33ef938f1c00d300 (diff)
[NET]: Add some acquires/releases sparse annotations.
Add __acquires() and __releases() annotations to suppress some sparse warnings. example of warnings : net/ipv4/udp.c:1555:14: warning: context imbalance in 'udp_seq_start' - wrong count at exit net/ipv4/udp.c:1571:13: warning: context imbalance in 'udp_seq_stop' - unexpected unlock Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c2
-rw-r--r--net/core/dev_mcast.c2
-rw-r--r--net/core/gen_stats.c1
-rw-r--r--net/core/neighbour.c2
-rw-r--r--net/core/sock.c2
5 files changed, 9 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 7153e94f50ad..eee774243097 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2368,6 +2368,7 @@ static int dev_ifconf(struct net *net, char __user *arg)
2368 * in detail. 2368 * in detail.
2369 */ 2369 */
2370void *dev_seq_start(struct seq_file *seq, loff_t *pos) 2370void *dev_seq_start(struct seq_file *seq, loff_t *pos)
2371 __acquires(dev_base_lock)
2371{ 2372{
2372 struct net *net = seq_file_net(seq); 2373 struct net *net = seq_file_net(seq);
2373 loff_t off; 2374 loff_t off;
@@ -2394,6 +2395,7 @@ void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos)
2394} 2395}
2395 2396
2396void dev_seq_stop(struct seq_file *seq, void *v) 2397void dev_seq_stop(struct seq_file *seq, void *v)
2398 __releases(dev_base_lock)
2397{ 2399{
2398 read_unlock(&dev_base_lock); 2400 read_unlock(&dev_base_lock);
2399} 2401}
diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c
index 63f0b33d7ced..cadbfbf7e7f5 100644
--- a/net/core/dev_mcast.c
+++ b/net/core/dev_mcast.c
@@ -186,6 +186,7 @@ EXPORT_SYMBOL(dev_mc_unsync);
186 186
187#ifdef CONFIG_PROC_FS 187#ifdef CONFIG_PROC_FS
188static void *dev_mc_seq_start(struct seq_file *seq, loff_t *pos) 188static void *dev_mc_seq_start(struct seq_file *seq, loff_t *pos)
189 __acquires(dev_base_lock)
189{ 190{
190 struct net *net = seq_file_net(seq); 191 struct net *net = seq_file_net(seq);
191 struct net_device *dev; 192 struct net_device *dev;
@@ -206,6 +207,7 @@ static void *dev_mc_seq_next(struct seq_file *seq, void *v, loff_t *pos)
206} 207}
207 208
208static void dev_mc_seq_stop(struct seq_file *seq, void *v) 209static void dev_mc_seq_stop(struct seq_file *seq, void *v)
210 __releases(dev_base_lock)
209{ 211{
210 read_unlock(&dev_base_lock); 212 read_unlock(&dev_base_lock);
211} 213}
diff --git a/net/core/gen_stats.c b/net/core/gen_stats.c
index bcc25591d8ac..8073561f7c63 100644
--- a/net/core/gen_stats.c
+++ b/net/core/gen_stats.c
@@ -55,6 +55,7 @@ rtattr_failure:
55int 55int
56gnet_stats_start_copy_compat(struct sk_buff *skb, int type, int tc_stats_type, 56gnet_stats_start_copy_compat(struct sk_buff *skb, int type, int tc_stats_type,
57 int xstats_type, spinlock_t *lock, struct gnet_dump *d) 57 int xstats_type, spinlock_t *lock, struct gnet_dump *d)
58 __acquires(lock)
58{ 59{
59 memset(d, 0, sizeof(*d)); 60 memset(d, 0, sizeof(*d));
60 61
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index bd899d557737..802493327a87 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -2313,6 +2313,7 @@ static void *neigh_get_idx_any(struct seq_file *seq, loff_t *pos)
2313} 2313}
2314 2314
2315void *neigh_seq_start(struct seq_file *seq, loff_t *pos, struct neigh_table *tbl, unsigned int neigh_seq_flags) 2315void *neigh_seq_start(struct seq_file *seq, loff_t *pos, struct neigh_table *tbl, unsigned int neigh_seq_flags)
2316 __acquires(tbl->lock)
2316{ 2317{
2317 struct neigh_seq_state *state = seq->private; 2318 struct neigh_seq_state *state = seq->private;
2318 loff_t pos_minus_one; 2319 loff_t pos_minus_one;
@@ -2356,6 +2357,7 @@ out:
2356EXPORT_SYMBOL(neigh_seq_next); 2357EXPORT_SYMBOL(neigh_seq_next);
2357 2358
2358void neigh_seq_stop(struct seq_file *seq, void *v) 2359void neigh_seq_stop(struct seq_file *seq, void *v)
2360 __releases(tbl->lock)
2359{ 2361{
2360 struct neigh_seq_state *state = seq->private; 2362 struct neigh_seq_state *state = seq->private;
2361 struct neigh_table *tbl = state->tbl; 2363 struct neigh_table *tbl = state->tbl;
diff --git a/net/core/sock.c b/net/core/sock.c
index 3804e7df626b..3d7757ee2fc8 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2025,6 +2025,7 @@ EXPORT_SYMBOL(proto_unregister);
2025 2025
2026#ifdef CONFIG_PROC_FS 2026#ifdef CONFIG_PROC_FS
2027static void *proto_seq_start(struct seq_file *seq, loff_t *pos) 2027static void *proto_seq_start(struct seq_file *seq, loff_t *pos)
2028 __acquires(proto_list_lock)
2028{ 2029{
2029 read_lock(&proto_list_lock); 2030 read_lock(&proto_list_lock);
2030 return seq_list_start_head(&proto_list, *pos); 2031 return seq_list_start_head(&proto_list, *pos);
@@ -2036,6 +2037,7 @@ static void *proto_seq_next(struct seq_file *seq, void *v, loff_t *pos)
2036} 2037}
2037 2038
2038static void proto_seq_stop(struct seq_file *seq, void *v) 2039static void proto_seq_stop(struct seq_file *seq, void *v)
2040 __releases(proto_list_lock)
2039{ 2041{
2040 read_unlock(&proto_list_lock); 2042 read_unlock(&proto_list_lock);
2041} 2043}