Remove acpi_os_create_lock(), acpi_os_delete_lock()
Subsystems (2)
PATCH 10/13 Remove acpi_os_create_lock(), acpi_os_delete_lock()
From: Alexey Dobriyan <[email protected]>
Minimally intrusive patch to remove some overdesign in ACPI code. Based on hch rant.
The only purpose of functions in question is to dynamically allocate one global spinlock -- acpi_gbl_gpe_lock. Instead, create it in .bss.
It's tempting to shoot acpi_os_release_lock() et al too.
Signed-off-by Alexey Dobriyan <[email protected]>
Cc "Brown, Len" <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/acpi/osl.c | 30 ----------------------------- drivers/acpi/utilities/utmutex.c | 6 +++-- include/acpi/acpiosxf.h | 4 --- 3 files changed, 4 insertions(+), 36 deletions(-)
drivers/acpi/osl.c renamed from drivers/acpi/osl.c~remove-acpi_os_create_lock-acpi_os_delete_lock +0 -30
@@ -668,36 +668,6 @@ void acpi_os_wait_events_complete(void *EXPORT_SYMBOL (acpi_os_wait_events_complete); -/* -* Allocate the memory for a spinlock and initialize it. -*/ -acpi_status acpi_os_create_lock (acpi_handle * out_handle) -{ -spinlock_t *lock_ptr; - - lock_ptr =kmalloc (sizeof (spinlock_t),GFP_KERNEL ); - -spin_lock_init (lock_ptr); - -ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX ,"Creating spinlock[%p].\n" , lock_ptr)); - - *out_handle = lock_ptr; - -return AE_OK ; -} - -/* -* Deallocate the memory for a spinlock. -*/ -void acpi_os_delete_lock (acpi_handle handle) -{ -ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX ,"Deleting spinlock[%p].\n" , handle)); - -kfree (handle); - -return ; -} -acpi_status acpi_os_create_semaphore (u32 max_units,u32 initial_units,acpi_handle * handle) {
drivers/acpi/utilities/utmutex.c renamed from drivers/acpi/utilities/utmutex.c~remove-acpi_os_create_lock-acpi_os_delete_lock +4 -2
@@ -51,6 +51,8 @@ static acpi_status acpi_ut_create_mutex(static acpi_status acpi_ut_delete_mutex (acpi_mutex_handle mutex_id); +static spinlock_t __acpi_gbl_gpe_lock; +/******************************************************************************* * * FUNCTION: acpi_ut_mutex_initialize
@@ -80,7 +82,8 @@ acpi_status acpi_ut_mutex_initialize(voi } } - status =acpi_os_create_lock (&acpi_gbl_gpe_lock); +spin_lock_init (&__acpi_gbl_gpe_lock); + acpi_gbl_gpe_lock = &__acpi_gbl_gpe_lock;return_ACPI_STATUS (status); }
@@ -109,7 +112,6 @@ void acpi_ut_mutex_terminate(void) (void )acpi_ut_delete_mutex (i); } -acpi_os_delete_lock (acpi_gbl_gpe_lock); return_VOID; }
include/acpi/acpiosxf.h renamed from include/acpi/acpiosxf.h~remove-acpi_os_create_lock-acpi_os_delete_lock +0 -4
@@ -108,10 +108,6 @@ acpi_status acpi_os_wait_semaphore(acpi_acpi_status acpi_os_signal_semaphore (acpi_handle handle,u32 units); -acpi_status acpi_os_create_lock (acpi_handle * out_handle); - -void acpi_os_delete_lock (acpi_handle handle); -acpi_cpu_flags acpi_os_acquire_lock (acpi_handle handle);void acpi_os_release_lock (acpi_handle handle,acpi_cpu_flags flags);
_