Skip to contentSkip to conversation

connector.c: make notify_lock static

PATCH In review Adrian Bunk 3 participants 4 messages Jan 31, 2005 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 connector.c: make notify_lock static

notify_lock isn't a good name for a global lock.
But since it's not used outside of the file, it can be made static.

drivers/connector/connector.c renamed from drivers/connector/connector.c.old +1 -1
@@ -41,7 +41,7 @@
 module_param(cn_idx, uint, 0);
 module_param(cn_val, uint, 0);
 
-spinlock_t notify_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t notify_lock = SPIN_LOCK_UNLOCKED;
 static LIST_HEAD(notify_list);
 
 static struct cn_dev cdev;
#1 lore raw
Quoted 2 lines · Adrian Bunk

notify_lock isn't a good name for a global lock.
But since it's not used outside of the file, it can be made static.

You are right, Adrian, thank you.
Greg, please push it upstream.

Quoted 13 lines
drivers/connector/connector.c renamed from drivers/connector/connector.c.old +1 -1
@@ -41,7 +41,7 @@
 module_param(cn_idx, uint, 0);
 module_param(cn_val, uint, 0);
 
-spinlock_t notify_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t notify_lock = SPIN_LOCK_UNLOCKED;
 static LIST_HEAD(notify_list);
 
 static struct cn_dev cdev;
Signature · 3 lines
        Evgeniy Polyakov

Crash is better than data corruption -- Arthur Grabowski
#2 lore raw
In reply to Adrian Bunk
Quoted 9 lines · Adrian Bunk

notify_lock isn't a good name for a global lock.
But since it's not used outside of the file, it can be made static.

drivers/connector/connector.c 2005-01-31 13:09:28.000000000 +0100 line 47

Quoted 8 lines
drivers/connector/connector.c 2005-01-31 13:09:28.000000000 +0100 renamed from drivers/connector/connector.c.old 2005-01-31 13:09:14.000000000 +0100 +1 -1
@@ -41,7 +41,7 @@
 module_param(cn_idx, uint, 0);
 module_param(cn_val, uint, 0);
 
-spinlock_t notify_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t notify_lock = SPIN_LOCK_UNLOCKED;
 static LIST_HEAD(notify_list);
 
 static struct cn_dev cdev;

Isn't this supposed to be "static DEFINE_SPINLOCK(notify_lock);" nowadays?

Signature · 1 line
Dmitry
#3 lore raw
Quoted 12 lines · On Mon, 31 Jan 2005 10:00:51 -0500 Dmitry Torokhov <[email protected]>…
Quoted 11 lines · Adrian Bunk

notify_lock isn't a good name for a global lock.
But since it's not used outside of the file, it can be made static.

drivers/connector/connector.c 2005-01-31 13:09:28.000000000 +0100 renamed from drivers/connector/connector.c.old 2005-01-31 13:09:14.000000000 +0100 +0 -0
@@ -41,7 +41,7 @@
 module_param(cn_idx, uint, 0);
 module_param(cn_val, uint, 0);
 
Quoted 8 lines

drivers/connector/connector.c 2005-01-31 13:09:28.000000000 +0100 line 47

Quoted 6 lines
drivers/connector/connector.c 2005-01-31 13:09:28.000000000 +0100 renamed from drivers/connector/connector.c.old 2005-01-31 13:09:14.000000000 +0100 +1 -1
-spinlock_t notify_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t notify_lock = SPIN_LOCK_UNLOCKED;
 static LIST_HEAD(notify_list);
 
 static struct cn_dev cdev;

Isn't this supposed to be "static DEFINE_SPINLOCK(notify_lock);" nowadays?

That's not a problem, I will cook up a patch and send it through Greg. Thank you.

Quoted 2 lines
Signature · 1 line
Dmitry

Evgeniy Polyakov

Only failure makes us experts. -- Theo de Raadt