Skip to contentSkip to conversation

making some more global spinlocks static

PATCH New David C. Hansen 1 participant 1 message Dec 10, 2001

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 making some more global spinlocks static

Marcelo,
I just sent a 2.5 version of this to Linus, so here is yours. This patch makes several spinlocks static. These are either locks that have appeared in the last few versions of 2.4, or older locks where the maintainers never passed the patch along. Most of them are for new locks. The patch applies against 2.4.16.

arch/alpha/kernel/irq_i8259.c +1 -1
diff -ur linux-2.4.16-clean/arch/alpha/kernel/irq_i8259.c linux/arch/alpha/kernel/irq_i8259.c
@@ -22,7 +22,7 @@
 
 /* Note mask bit is true for DISABLED irqs.  */
 static unsigned int cached_irq_mask = 0xffff;
-spinlock_t i8259_irq_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t i8259_irq_lock = SPIN_LOCK_UNLOCKED;
 
 static inline void
 i8259_update_irq_hw(unsigned int irq, unsigned long mask)
arch/i386/kernel/pci-pc.c +1 -1
diff -ur linux-2.4.16-clean/arch/i386/kernel/pci-pc.c linux/arch/i386/kernel/pci-pc.c
@@ -30,7 +30,7 @@
  * This interrupt-safe spinlock protects all accesses to PCI
  * configuration space.
  */
-spinlock_t pci_config_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t pci_config_lock = SPIN_LOCK_UNLOCKED;
 
 
 /*
arch/ia64/kernel/efivars.c +1 -1
diff -ur linux-2.4.16-clean/arch/ia64/kernel/efivars.c linux/arch/ia64/kernel/efivars.c
@@ -100,7 +100,7 @@
 	struct list_head        list;
 } efivar_entry_t;
 
-spinlock_t efivars_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t efivars_lock = SPIN_LOCK_UNLOCKED;
 static LIST_HEAD(efivar_list);
 static struct proc_dir_entry *efi_vars_dir = NULL;
 
arch/ia64/kernel/pci.c +1 -1
diff -ur linux-2.4.16-clean/arch/ia64/kernel/pci.c linux/arch/ia64/kernel/pci.c
@@ -46,7 +46,7 @@
  * This interrupt-safe spinlock protects all accesses to PCI
  * configuration space.
  */
-spinlock_t pci_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t pci_lock = SPIN_LOCK_UNLOCKED;
 
 struct pci_fixup pcibios_fixups[] = {
 	{ 0 }
arch/ia64/sn/io/hubspc.c +1 -1
diff -ur linux-2.4.16-clean/arch/ia64/sn/io/hubspc.c linux/arch/ia64/sn/io/hubspc.c
@@ -61,7 +61,7 @@
 }cpuprom_info_t;
 
 static cpuprom_info_t	*cpuprom_head;
-spinlock_t	cpuprom_spinlock;
+static spinlock_t	cpuprom_spinlock;
 #define	PROM_LOCK()	mutex_spinlock(&cpuprom_spinlock)
 #define	PROM_UNLOCK(s)	mutex_spinunlock(&cpuprom_spinlock, (s))
 
arch/ppc/kernel/i8259.c +1 -1
diff -ur linux-2.4.16-clean/arch/ppc/kernel/i8259.c linux/arch/ppc/kernel/i8259.c
@@ -13,7 +13,7 @@
 #define cached_A1 (cached_8259[0])
 #define cached_21 (cached_8259[1])
 
-spinlock_t i8259_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t i8259_lock = SPIN_LOCK_UNLOCKED;
 
 int i8259_pic_irq_offset;
 
arch/ppc/kernel/pmac_pic.c +1 -1
diff -ur linux-2.4.16-clean/arch/ppc/kernel/pmac_pic.c linux/arch/ppc/kernel/pmac_pic.c
@@ -36,7 +36,7 @@
 static int max_irqs;
 static int max_real_irqs;
 
-spinlock_t pmac_pic_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t pmac_pic_lock = SPIN_LOCK_UNLOCKED;
 
 
 #define GATWICK_IRQ_POOL_SIZE        10
arch/ppc/kernel/prom.c +1 -1
diff -ur linux-2.4.16-clean/arch/ppc/kernel/prom.c linux/arch/ppc/kernel/prom.c
@@ -1928,7 +1928,7 @@
 }
 #endif
 
-spinlock_t rtas_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t rtas_lock = SPIN_LOCK_UNLOCKED;
 
 /* this can be called after setup -- Cort */
 int __openfirmware
arch/sparc64/solaris/timod.c +1 -1
diff -ur linux-2.4.16-clean/arch/sparc64/solaris/timod.c linux/arch/sparc64/solaris/timod.c
@@ -33,7 +33,7 @@
 	u32 arg);
 asmlinkage int solaris_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
 
-spinlock_t timod_pagelock = SPIN_LOCK_UNLOCKED;
+static spinlock_t timod_pagelock = SPIN_LOCK_UNLOCKED;
 static char * page = NULL ;
 
 #ifndef DEBUG_SOLARIS_KMALLOC
drivers/char/sysrq.c +1 -1
diff -ur linux-2.4.16-clean/drivers/char/sysrq.c linux/drivers/char/sysrq.c
@@ -336,7 +336,7 @@
 
 
 /* Key Operations table and lock */
-spinlock_t sysrq_key_table_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t sysrq_key_table_lock = SPIN_LOCK_UNLOCKED;
 #define SYSRQ_KEY_TABLE_LENGTH 36
 static struct sysrq_key_op *sysrq_key_table[SYSRQ_KEY_TABLE_LENGTH] = {
 /* 0 */	&sysrq_loglevel_op,