[openib-general] [PATCH] Remove use of SPIN_LOCK_UNLOCKED

Roland Dreier roland at topspin.com
Thu Nov 11 09:09:14 PST 2004


In the upstream kernel, the use of SPIN_LOCK_UNLOCKED is being
phased out (look for changesets like "Lock initializer unifying").
This patch converts the MAD layer to use spin_lock_init() instead,
please apply.

 - R.

Index: core/agent.c
===================================================================
--- core/agent.c	(revision 1202)
+++ core/agent.c	(working copy)
@@ -30,7 +30,7 @@
 #include <asm/bug.h>
 
 
-static spinlock_t ib_agent_port_list_lock = SPIN_LOCK_UNLOCKED;
+spinlock_t ib_agent_port_list_lock;
 static LIST_HEAD(ib_agent_port_list);
 
 extern kmem_cache_t *ib_mad_cache;
@@ -382,4 +382,3 @@
 
 	return 0;
 }
-
Index: core/mad.c
===================================================================
--- core/mad.c	(revision 1202)
+++ core/mad.c	(working copy)
@@ -74,7 +74,7 @@
 static u32 ib_mad_client_id = 0;
 
 /* Port list lock */
-static spinlock_t ib_mad_port_list_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t ib_mad_port_list_lock;
 
 
 /* Forward declarations */
@@ -2132,6 +2132,9 @@
 {
 	int ret;
 
+	spin_lock_init(&ib_mad_port_list_lock);
+	spin_lock_init(&ib_agent_port_list_lock);
+
 	ib_mad_cache = kmem_cache_create("ib_mad",
 					 sizeof(struct ib_mad_private),
 					 0,
@@ -2171,4 +2174,3 @@
 
 module_init(ib_mad_init_module);
 module_exit(ib_mad_cleanup_module);
-
Index: core/agent.h
===================================================================
--- core/agent.h	(revision 1202)
+++ core/agent.h	(working copy)
@@ -26,6 +26,8 @@
 #ifndef __AGENT_H_
 #define __AGENT_H_
 
+extern spinlock_t ib_agent_port_list_lock;
+
 extern int ib_agent_port_open(struct ib_device *device,
 			      int port_num);
 



More information about the general mailing list