diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2008-01-02 00:58:02 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:00:31 -0500 |
commit | 9a429c4983deae020f1e757ecc8f547b6d4e2f2b (patch) | |
tree | 172e27a5866e182b902cd77506df1755aafadb60 /net/netlink | |
parent | b950dfcf504842a0f2bb142a33ef938f1c00d300 (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/netlink')
-rw-r--r-- | net/netlink/af_netlink.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index dbd7cad1c9a9..be07f1b45ee2 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -171,6 +171,7 @@ static void netlink_sock_destruct(struct sock *sk) | |||
171 | */ | 171 | */ |
172 | 172 | ||
173 | static void netlink_table_grab(void) | 173 | static void netlink_table_grab(void) |
174 | __acquires(nl_table_lock) | ||
174 | { | 175 | { |
175 | write_lock_irq(&nl_table_lock); | 176 | write_lock_irq(&nl_table_lock); |
176 | 177 | ||
@@ -193,6 +194,7 @@ static void netlink_table_grab(void) | |||
193 | } | 194 | } |
194 | 195 | ||
195 | static inline void netlink_table_ungrab(void) | 196 | static inline void netlink_table_ungrab(void) |
197 | __releases(nl_table_lock) | ||
196 | { | 198 | { |
197 | write_unlock_irq(&nl_table_lock); | 199 | write_unlock_irq(&nl_table_lock); |
198 | wake_up(&nl_table_wait); | 200 | wake_up(&nl_table_wait); |
@@ -1728,6 +1730,7 @@ static struct sock *netlink_seq_socket_idx(struct seq_file *seq, loff_t pos) | |||
1728 | } | 1730 | } |
1729 | 1731 | ||
1730 | static void *netlink_seq_start(struct seq_file *seq, loff_t *pos) | 1732 | static void *netlink_seq_start(struct seq_file *seq, loff_t *pos) |
1733 | __acquires(nl_table_lock) | ||
1731 | { | 1734 | { |
1732 | read_lock(&nl_table_lock); | 1735 | read_lock(&nl_table_lock); |
1733 | return *pos ? netlink_seq_socket_idx(seq, *pos - 1) : SEQ_START_TOKEN; | 1736 | return *pos ? netlink_seq_socket_idx(seq, *pos - 1) : SEQ_START_TOKEN; |
@@ -1776,6 +1779,7 @@ static void *netlink_seq_next(struct seq_file *seq, void *v, loff_t *pos) | |||
1776 | } | 1779 | } |
1777 | 1780 | ||
1778 | static void netlink_seq_stop(struct seq_file *seq, void *v) | 1781 | static void netlink_seq_stop(struct seq_file *seq, void *v) |
1782 | __releases(nl_table_lock) | ||
1779 | { | 1783 | { |
1780 | read_unlock(&nl_table_lock); | 1784 | read_unlock(&nl_table_lock); |
1781 | } | 1785 | } |