Re: [PATCH] PCI fixes for 2.6.10-rc1

From: Greg KH
Date: Fri Nov 12 2004 - 21:03:24 EST


ChangeSet 1.2026.66.14, 2004/11/05 15:05:43-08:00, tglx@xxxxxxxxxxxxx

[PATCH] Lock initializer unifying Batch 2 (PCI)

To make spinlock/rwlock initialization consistent all over the kernel,
this patch converts explicit lock-initializers into spin_lock_init() and
rwlock_init() calls.

Currently, spinlocks and rwlocks are initialized in two different ways:

lock = SPIN_LOCK_UNLOCKED
spin_lock_init(&lock)

rwlock = RW_LOCK_UNLOCKED
rwlock_init(&rwlock)

this patch converts all explicit lock initializations to
spin_lock_init() or rwlock_init(). (Besides consistency this also helps
automatic lock validators and debugging code.)

The conversion was done with a script, it was verified manually and it
was reviewed, compiled and tested as far as possible on x86, ARM, PPC.

There is no runtime overhead or actual code change resulting out of this
patch, because spin_lock_init() and rwlock_init() are macros and are
thus equivalent to the explicit initialization method.

That's the second batch of the unifying patches.

Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Acked-by: Ingo Molnar <mingo@xxxxxxx>
Signed-off-by: Greg Kroah-Hartman <greg@xxxxxxxxx>


drivers/pci/hotplug/acpiphp_glue.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)


diff -Nru a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
--- a/drivers/pci/hotplug/acpiphp_glue.c 2004-11-12 15:13:13 -08:00
+++ b/drivers/pci/hotplug/acpiphp_glue.c 2004-11-12 15:13:13 -08:00
@@ -389,7 +389,7 @@

bridge->pci_bus = pci_find_bus(seg, bus);

- bridge->res_lock = SPIN_LOCK_UNLOCKED;
+ spin_lock_init(&bridge->res_lock);

/* to be overridden when we decode _CRS */
bridge->sub = bridge->bus;
@@ -457,7 +457,7 @@
return;
}

- bridge->res_lock = SPIN_LOCK_UNLOCKED;
+ spin_lock_init(&bridge->res_lock);

bridge->bus = bridge->pci_bus->number;
bridge->sub = bridge->pci_bus->subordinate;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/