You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[PATCH] spin/rwlock init cleanups
locking init cleanups: - convert " = SPIN_LOCK_UNLOCKED" to spin_lock_init() or DEFINE_SPINLOCK() - convert rwlocks in a similar manner this patch was generated automatically. Motivation: - cleanliness - lockdep needs control of lock initialization, which the open-coded variants do not give - it's also useful for -rt and for lock debugging in general Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
b6cd0b772d
commit
34af946a22
@@ -27,7 +27,7 @@ static void unregister_intr_pda(struct sn_irq_info *sn_irq_info);
|
||||
int sn_force_interrupt_flag = 1;
|
||||
extern int sn_ioif_inited;
|
||||
struct list_head **sn_irq_lh;
|
||||
static spinlock_t sn_irq_info_lock = SPIN_LOCK_UNLOCKED; /* non-IRQ lock */
|
||||
static DEFINE_SPINLOCK(sn_irq_info_lock); /* non-IRQ lock */
|
||||
|
||||
u64 sn_intr_alloc(nasid_t local_nasid, int local_widget,
|
||||
struct sn_irq_info *sn_irq_info,
|
||||
|
||||
@@ -367,7 +367,7 @@ void mipsmt_prepare_cpus(void)
|
||||
dvpe();
|
||||
dmt();
|
||||
|
||||
freeIPIq.lock = SPIN_LOCK_UNLOCKED;
|
||||
spin_lock_init(&freeIPIq.lock);
|
||||
|
||||
/*
|
||||
* We probably don't have as many VPEs as we do SMP "CPUs",
|
||||
@@ -375,7 +375,7 @@ void mipsmt_prepare_cpus(void)
|
||||
*/
|
||||
for (i=0; i<NR_CPUS; i++) {
|
||||
IPIQ[i].head = IPIQ[i].tail = NULL;
|
||||
IPIQ[i].lock = SPIN_LOCK_UNLOCKED;
|
||||
spin_lock_init(&IPIQ[i].lock);
|
||||
IPIQ[i].depth = 0;
|
||||
ipi_timer_latch[i] = 0;
|
||||
}
|
||||
|
||||
@@ -2203,7 +2203,7 @@ void spu_init_csa(struct spu_state *csa)
|
||||
|
||||
memset(lscsa, 0, sizeof(struct spu_lscsa));
|
||||
csa->lscsa = lscsa;
|
||||
csa->register_lock = SPIN_LOCK_UNLOCKED;
|
||||
spin_lock_init(&csa->register_lock);
|
||||
|
||||
/* Set LS pages reserved to allow for user-space mapping. */
|
||||
for (p = lscsa->ls; p < lscsa->ls + LS_SIZE; p += PAGE_SIZE)
|
||||
|
||||
@@ -546,7 +546,7 @@ struct pmf_device {
|
||||
};
|
||||
|
||||
static LIST_HEAD(pmf_devices);
|
||||
static spinlock_t pmf_lock = SPIN_LOCK_UNLOCKED;
|
||||
static DEFINE_SPINLOCK(pmf_lock);
|
||||
static DEFINE_MUTEX(pmf_irq_mutex);
|
||||
|
||||
static void pmf_release_device(struct kref *kref)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
*/
|
||||
|
||||
/* EEH event workqueue setup. */
|
||||
static spinlock_t eeh_eventlist_lock = SPIN_LOCK_UNLOCKED;
|
||||
static DEFINE_SPINLOCK(eeh_eventlist_lock);
|
||||
LIST_HEAD(eeh_eventlist);
|
||||
static void eeh_thread_launcher(void *);
|
||||
DECLARE_WORK(eeh_event_wq, eeh_thread_launcher, NULL);
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
static void __iomem *mmio_nvram_start;
|
||||
static long mmio_nvram_len;
|
||||
static spinlock_t mmio_nvram_lock = SPIN_LOCK_UNLOCKED;
|
||||
static DEFINE_SPINLOCK(mmio_nvram_lock);
|
||||
|
||||
static ssize_t mmio_nvram_read(char *buf, size_t count, loff_t *index)
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
extern volatile unsigned long wall_jiffies;
|
||||
|
||||
spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED;
|
||||
DEFINE_SPINLOCK(rtc_lock);
|
||||
EXPORT_SYMBOL(rtc_lock);
|
||||
|
||||
|
||||
|
||||
@@ -461,7 +461,7 @@ void show_code(unsigned int *pc)
|
||||
}
|
||||
}
|
||||
|
||||
spinlock_t die_lock = SPIN_LOCK_UNLOCKED;
|
||||
DEFINE_SPINLOCK(die_lock);
|
||||
|
||||
void die(const char * str, struct pt_regs * regs, long err)
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ typedef struct drm_mem_stats {
|
||||
unsigned long bytes_freed;
|
||||
} drm_mem_stats_t;
|
||||
|
||||
static spinlock_t drm_mem_lock = SPIN_LOCK_UNLOCKED;
|
||||
static DEFINE_SPINLOCK(drm_mem_lock);
|
||||
static unsigned long drm_ram_available = 0; /* In pages */
|
||||
static unsigned long drm_ram_used = 0;
|
||||
static drm_mem_stats_t drm_mem_stats[] =
|
||||
|
||||
@@ -557,7 +557,7 @@ via_init_dmablit(drm_device_t *dev)
|
||||
blitq->num_outstanding = 0;
|
||||
blitq->is_active = 0;
|
||||
blitq->aborting = 0;
|
||||
blitq->blit_lock = SPIN_LOCK_UNLOCKED;
|
||||
spin_lock_init(&blitq->blit_lock);
|
||||
for (j=0; j<VIA_NUM_BLIT_SLOTS; ++j) {
|
||||
DRM_INIT_WAITQUEUE(blitq->blit_queue + j);
|
||||
}
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ static int invalid_lilo_config;
|
||||
/* The ISA boards do window flipping into the same spaces so its only sane
|
||||
with a single lock. It's still pretty efficient */
|
||||
|
||||
static spinlock_t epca_lock = SPIN_LOCK_UNLOCKED;
|
||||
static DEFINE_SPINLOCK(epca_lock);
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
MAXBOARDS is typically 12, but ISA and EISA cards are restricted to
|
||||
|
||||
+1
-1
@@ -301,7 +301,7 @@ static struct tty_operations moxa_ops = {
|
||||
.tiocmset = moxa_tiocmset,
|
||||
};
|
||||
|
||||
static spinlock_t moxa_lock = SPIN_LOCK_UNLOCKED;
|
||||
static DEFINE_SPINLOCK(moxa_lock);
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
static int moxa_get_PCI_conf(struct pci_dev *p, int board_type, moxa_board_conf * board)
|
||||
|
||||
@@ -2477,7 +2477,7 @@ static int __init specialix_init(void)
|
||||
#endif
|
||||
|
||||
for (i = 0; i < SX_NBOARD; i++)
|
||||
sx_board[i].lock = SPIN_LOCK_UNLOCKED;
|
||||
spin_lock_init(&sx_board[i].lock);
|
||||
|
||||
if (sx_init_drivers()) {
|
||||
func_exit();
|
||||
|
||||
+1
-1
@@ -2320,7 +2320,7 @@ static int sx_init_portstructs (int nboards, int nports)
|
||||
#ifdef NEW_WRITE_LOCKING
|
||||
port->gs.port_write_mutex = MUTEX;
|
||||
#endif
|
||||
port->gs.driver_lock = SPIN_LOCK_UNLOCKED;
|
||||
spin_lock_init(&port->gs.driver_lock);
|
||||
/*
|
||||
* Initializing wait queue
|
||||
*/
|
||||
|
||||
@@ -981,7 +981,7 @@ exit:
|
||||
EXPORT_SYMBOL_GPL(gigaset_stop);
|
||||
|
||||
static LIST_HEAD(drivers);
|
||||
static spinlock_t driver_lock = SPIN_LOCK_UNLOCKED;
|
||||
static DEFINE_SPINLOCK(driver_lock);
|
||||
|
||||
struct cardstate *gigaset_get_cs_by_id(int id)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <linux/leds.h>
|
||||
#include "leds.h"
|
||||
|
||||
rwlock_t leds_list_lock = RW_LOCK_UNLOCKED;
|
||||
DEFINE_RWLOCK(leds_list_lock);
|
||||
LIST_HEAD(leds_list);
|
||||
|
||||
EXPORT_SYMBOL_GPL(leds_list);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/*
|
||||
* Nests outside led_cdev->trigger_lock
|
||||
*/
|
||||
static rwlock_t triggers_list_lock = RW_LOCK_UNLOCKED;
|
||||
static DEFINE_RWLOCK(triggers_list_lock);
|
||||
static LIST_HEAD(trigger_list);
|
||||
|
||||
ssize_t led_trigger_store(struct class_device *dev, const char *buf,
|
||||
|
||||
@@ -85,7 +85,7 @@ static int __devinit ibmasm_init_one(struct pci_dev *pdev, const struct pci_devi
|
||||
}
|
||||
memset(sp, 0, sizeof(struct service_processor));
|
||||
|
||||
sp->lock = SPIN_LOCK_UNLOCKED;
|
||||
spin_lock_init(&sp->lock);
|
||||
INIT_LIST_HEAD(&sp->command_queue);
|
||||
|
||||
pci_set_drvdata(pdev, (void *)sp);
|
||||
|
||||
@@ -157,7 +157,7 @@ MODULE_LICENSE("Dual MPL/GPL");
|
||||
|
||||
static int pcmcia_schlvl = PCMCIA_SCHLVL;
|
||||
|
||||
static spinlock_t events_lock = SPIN_LOCK_UNLOCKED;
|
||||
static DEFINE_SPINLOCK(events_lock);
|
||||
|
||||
|
||||
#define PCMCIA_SOCKET_KEY_5V 1
|
||||
@@ -644,7 +644,7 @@ static struct platform_device m8xx_device = {
|
||||
};
|
||||
|
||||
static u32 pending_events[PCMCIA_SOCKETS_NO];
|
||||
static spinlock_t pending_event_lock = SPIN_LOCK_UNLOCKED;
|
||||
static DEFINE_SPINLOCK(pending_event_lock);
|
||||
|
||||
static irqreturn_t m8xx_interrupt(int irq, void *dev, struct pt_regs *regs)
|
||||
{
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
* These interrupt-safe spinlocks protect all accesses to RIO
|
||||
* configuration space and doorbell access.
|
||||
*/
|
||||
static spinlock_t rio_config_lock = SPIN_LOCK_UNLOCKED;
|
||||
static spinlock_t rio_doorbell_lock = SPIN_LOCK_UNLOCKED;
|
||||
static DEFINE_SPINLOCK(rio_config_lock);
|
||||
static DEFINE_SPINLOCK(rio_doorbell_lock);
|
||||
|
||||
/*
|
||||
* Wrappers for all RIO configuration access functions. They just check
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user