diff options
author | Roland Dreier <rolandd@cisco.com> | 2009-09-05 20:24:23 -0700 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2009-09-05 20:24:23 -0700 |
commit | 6276e08a9bdf645b71a092fb4530baf4f6c4c6eb (patch) | |
tree | d9132ced4e91d02230df2ee4d0cef5a89ec2c477 /drivers/infiniband/core/mad.c | |
parent | e07cccf4046978df10f2e13fe2b99b2f9b3a65db (diff) | |
download | blackbird-op-linux-6276e08a9bdf645b71a092fb4530baf4f6c4c6eb.tar.gz blackbird-op-linux-6276e08a9bdf645b71a092fb4530baf4f6c4c6eb.zip |
IB: Use DEFINE_SPINLOCK() for static spinlocks
Rather than just defining static spinlock_t variables and then
initializing them later in init functions, simply define them with
DEFINE_SPINLOCK() and remove the calls to spin_lock_init(). This cleans
up the source a tad and also shrinks the compiled code; eg on x86-64:
add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-40 (-40)
function old new delta
ib_uverbs_init 336 326 -10
ib_mad_init_module 147 137 -10
ib_sa_init 123 103 -20
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/core/mad.c')
-rw-r--r-- | drivers/infiniband/core/mad.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c index de922a04ca2d..5cef8f87b96b 100644 --- a/drivers/infiniband/core/mad.c +++ b/drivers/infiniband/core/mad.c @@ -51,8 +51,7 @@ static struct list_head ib_mad_port_list; static u32 ib_mad_client_id = 0; /* Port list lock */ -static spinlock_t ib_mad_port_list_lock; - +static DEFINE_SPINLOCK(ib_mad_port_list_lock); /* Forward declarations */ static int method_in_use(struct ib_mad_mgmt_method_table **method, @@ -2984,8 +2983,6 @@ static int __init ib_mad_init_module(void) { int ret; - spin_lock_init(&ib_mad_port_list_lock); - ib_mad_cache = kmem_cache_create("ib_mad", sizeof(struct ib_mad_private), 0, @@ -3021,4 +3018,3 @@ static void __exit ib_mad_cleanup_module(void) module_init(ib_mad_init_module); module_exit(ib_mad_cleanup_module); - |