ipv4: eliminate lock count warnings in ping.c
authorLance Richardson <lrichard@redhat.com>
Wed, 6 Jan 2016 22:22:47 +0000 (17:22 -0500)
committerDavid S. Miller <davem@davemloft.net>
Sat, 9 Jan 2016 02:30:43 +0000 (21:30 -0500)
Add lock release/acquire annotations to ping_seq_start() and
ping_seq_stop() to satisfy sparse.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ping.c

index e89094ab5ddb8ce2b6eb2d78a9a9046b42287bd5..c117b21b937de778dffa484d589141ea31e1b6bc 100644 (file)
@@ -1063,6 +1063,7 @@ static struct sock *ping_get_idx(struct seq_file *seq, loff_t pos)
 }
 
 void *ping_seq_start(struct seq_file *seq, loff_t *pos, sa_family_t family)
+       __acquires(ping_table.lock)
 {
        struct ping_iter_state *state = seq->private;
        state->bucket = 0;
@@ -1094,6 +1095,7 @@ void *ping_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 EXPORT_SYMBOL_GPL(ping_seq_next);
 
 void ping_seq_stop(struct seq_file *seq, void *v)
+       __releases(ping_table.lock)
 {
        read_unlock_bh(&ping_table.lock);
 }