Commit 762c2916 authored by Akinobu Mita's avatar Akinobu Mita Committed by David S. Miller

econet: kill unnecessary spin_lock_init()

The spinlock aun_queue_lock is initialized statically. It is unnecessary
to initialize by spin_lock_init() at module load time.

This is detected by the semantic patch.

// <smpl>
@def@
declarer name DEFINE_SPINLOCK;
identifier spinlock;
@@

DEFINE_SPINLOCK(spinlock);

@@
identifier def.spinlock;
@@

- spin_lock_init(&spinlock);
// </smpl>
Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Cc: Julia Lawall <julia@diku.dk>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 034de00b
...@@ -1009,7 +1009,6 @@ static int __init aun_udp_initialise(void) ...@@ -1009,7 +1009,6 @@ static int __init aun_udp_initialise(void)
struct sockaddr_in sin; struct sockaddr_in sin;
skb_queue_head_init(&aun_queue); skb_queue_head_init(&aun_queue);
spin_lock_init(&aun_queue_lock);
setup_timer(&ab_cleanup_timer, ab_cleanup, 0); setup_timer(&ab_cleanup_timer, ab_cleanup, 0);
ab_cleanup_timer.expires = jiffies + (HZ*2); ab_cleanup_timer.expires = jiffies + (HZ*2);
add_timer(&ab_cleanup_timer); add_timer(&ab_cleanup_timer);
...@@ -1167,7 +1166,6 @@ static int __init econet_proto_init(void) ...@@ -1167,7 +1166,6 @@ static int __init econet_proto_init(void)
goto out; goto out;
sock_register(&econet_family_ops); sock_register(&econet_family_ops);
#ifdef CONFIG_ECONET_AUNUDP #ifdef CONFIG_ECONET_AUNUDP
spin_lock_init(&aun_queue_lock);
aun_udp_initialise(); aun_udp_initialise();
#endif #endif
#ifdef CONFIG_ECONET_NATIVE #ifdef CONFIG_ECONET_NATIVE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment