Skip to contentSkip to conversation

acpi: remove dead code

PATCH In review Stephen Hemminger 3 participants 4 messages Oct 18, 2010 – Oct 19, 2010

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

PATCH 1/1 acpi: remove dead code

Found by running make namespacecheck on linux-next

drivers/acpi/osl.c +0 -25
@@ -780,16 +780,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_spinlock * handle)
-{
-	spin_lock_init(*handle);
-
-	return AE_OK;
-}
-
-/*
  * Deallocate the memory for a spinlock.
  */
 void acpi_os_delete_lock(acpi_spinlock handle)
@@ -1152,21 +1142,6 @@ int acpi_check_region(resource_size_t st
 }
 EXPORT_SYMBOL(acpi_check_region);
 
-int acpi_check_mem_region(resource_size_t start, resource_size_t n,
-		      const char *name)
-{
-	struct resource res = {
-		.start = start,
-		.end   = start + n - 1,
-		.name  = name,
-		.flags = IORESOURCE_MEM,
-	};
-
-	return acpi_check_resource_conflict(&res);
-
-}
-EXPORT_SYMBOL(acpi_check_mem_region);
-
 /*
  * Let drivers know whether the resource checks are effective
  */
drivers/acpi/processor_driver.c +0 -2
@@ -899,6 +899,4 @@ static void __exit acpi_processor_exit(v
 module_init(acpi_processor_init);
 module_exit(acpi_processor_exit);
 
-EXPORT_SYMBOL(acpi_processor_set_thermal_limit);
-
 MODULE_ALIAS("processor");
drivers/acpi/processor_thermal.c +0 -107

113 lines not on this page · raw message

include/acpi/acpi_drivers.h +0 -2
@@ -115,8 +115,6 @@ void pci_acpi_crs_quirks(void);
 #define ACPI_PROCESSOR_LIMIT_INCREMENT	0x01
 #define ACPI_PROCESSOR_LIMIT_DECREMENT	0x02
 
-int acpi_processor_set_thermal_limit(acpi_handle handle, int type);
-
 /*--------------------------------------------------------------------------
                                   Dock Station
   -------------------------------------------------------------------------- */
include/acpi/acpiosxf.h +0 -2
@@ -98,8 +98,6 @@ acpi_os_table_override(struct acpi_table
 /*
  * Spinlock primitives
  */
-acpi_status acpi_os_create_lock(acpi_spinlock * out_handle);
-
 void acpi_os_delete_lock(acpi_spinlock handle);
 
 acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock handle);
include/linux/acpi.h +0 -8
@@ -245,8 +245,6 @@ int acpi_check_resource_conflict(const s
 
 int acpi_check_region(resource_size_t start, resource_size_t n,
 		      const char *name);
-int acpi_check_mem_region(resource_size_t start, resource_size_t n,
-		      const char *name);
 
 int acpi_resources_are_enforced(void);
 
@@ -344,12 +342,6 @@ static inline int acpi_check_region(reso
 	return 0;
 }
 
-static inline int acpi_check_mem_region(resource_size_t start,
-					resource_size_t n, const char *name)
-{
-	return 0;
-}
-
 struct acpi_table_header;
 static inline int acpi_table_parse(char *id,
 				int (*handler)(struct acpi_table_header *))
reviewer
#1 lore raw
Quoted 5 lines · Stephen Hemminger

Found by running make namespacecheck on linux-next

--- a/drivers/acpi/osl.c 2010-10-06 13:42:58.722974685 +0900

...

drivers/acpi/osl.c void acpi_os_wait_events_complete(void * · line 790

Quoted 9 lines

/*
- * Allocate the memory for a spinlock and initialize it.
- */

drivers/acpi/osl.c +0 -6
-acpi_status acpi_os_create_lock(acpi_spinlock * handle)
-{
-	spin_lock_init(*handle);
-
-	return AE_OK;
-}

ACPICA declares acpi_os_create_lock in acpiosxf.h, but never calls it. Bob, can we do away with it?

...

Quoted 4 lines
drivers/acpi/osl.c +0 -4
-int acpi_check_mem_region(resource_size_t start, resource_size_t n,
-		      const char *name)
-{
-	struct resource res = {

drivers/acpi/osl.c int acpi_check_region(resource_size_t st · line 1168

Quoted 10 lines
drivers/acpi/osl.c +0 -10
-		.start = start,
-		.end   = start + n - 1,
-		.name  = name,
-		.flags = IORESOURCE_MEM,
-	};
-
-	return acpi_check_resource_conflict(&res);
-
-}
-EXPORT_SYMBOL(acpi_check_mem_region);

acpi_check_mem_region seems to be entirely a Linux thing. It is exported to modules -- though see any that use it.

Quoted 1 line

--- a/drivers/acpi/processor_driver.c 2010-10-06 13:46:52.594978592 +0900

...

Quoted 1 line

-EXPORT_SYMBOL(acpi_processor_set_thermal_limit);

...

Quoted 1 line

--- a/drivers/acpi/processor_thermal.c 2010-10-06 13:47:23.469979232 +0900

...

drivers/acpi/processor_thermal.c static int acpi_thermal_cpufreq_decrease · line 242

Quoted 2 lines
drivers/acpi/processor_thermal.c +0 -2
-int acpi_processor_set_thermal_limit(acpi_handle handle, int type)
-{

although acpi_processor_set_thermal_limit() is exported to modules I don't see any users in recent history.

thanks,
-Len Brown, Intel Open Source Technology Center

#2 lore raw
Quoted 8 lines · Len Brown
Quoted 5 lines · Stephen Hemminger

Found by running make namespacecheck on linux-next

--- a/drivers/acpi/osl.c      2010-10-06 13:42:58.722974685 +0900

...

Quoted 12 lines

drivers/acpi/osl.c void acpi_os_wait_events_complete(void * · line 790

Quoted 9 lines

 /*
- * Allocate the memory for a spinlock and initialize it.
- */

drivers/acpi/osl.c +0 -6
-acpi_status acpi_os_create_lock(acpi_spinlock * handle)
-{
-     spin_lock_init(*handle);
-
-     return AE_OK;
-}

ACPICA declares acpi_os_create_lock in acpiosxf.h, but never calls it.  Bob, can we do away with it?

In ACPICA code (AcpiUtMutexInitialize),

    Status = AcpiOsCreateLock (&AcpiGbl_GpeLock);
    if (ACPI_FAILURE (Status))
    {
        return_ACPI_STATUS (Status);
    }

    Status = AcpiOsCreateLock (&AcpiGbl_HardwareLock);
    if (ACPI_FAILURE (Status))
    {
        return_ACPI_STATUS (Status);
    }

In Linux code (acpi_ut_mutex_initialize)

        spin_lock_init(acpi_gbl_gpe_lock);
        spin_lock_init(acpi_gbl_hardware_lock);

This is another divergence between ACPICA and Linux code.

Lin Ming
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

reviewer
#3 lore raw
Quoted 36 lines · Lin Ming
Quoted 8 lines · Len Brown
Quoted 5 lines · Stephen Hemminger

Found by running make namespacecheck on linux-next

--- a/drivers/acpi/osl.c      2010-10-06 13:42:58.722974685 +0900

...

Quoted 12 lines

drivers/acpi/osl.c void acpi_os_wait_events_complete(void * · line 790

Quoted 9 lines

 /*
- * Allocate the memory for a spinlock and initialize it.
- */

drivers/acpi/osl.c +0 -6
-acpi_status acpi_os_create_lock(acpi_spinlock * handle)
-{
-     spin_lock_init(*handle);
-
-     return AE_OK;
-}

ACPICA declares acpi_os_create_lock in acpiosxf.h, but never calls it.  Bob, can we do away with it?

In ACPICA code (AcpiUtMutexInitialize),

    Status = AcpiOsCreateLock (&AcpiGbl_GpeLock);
    if (ACPI_FAILURE (Status))
    {
        return_ACPI_STATUS (Status);
    }

    Status = AcpiOsCreateLock (&AcpiGbl_HardwareLock);
    if (ACPI_FAILURE (Status))
    {
        return_ACPI_STATUS (Status);
    }
Quoted 6 lines

In Linux code (acpi_ut_mutex_initialize)

        spin_lock_init(acpi_gbl_gpe_lock);
        spin_lock_init(acpi_gbl_hardware_lock);

This is another divergence between ACPICA and Linux code.

Lin-Ming,

Thanks for the explanation.

I've applied Stephen's patch, since it is correct. If you later want to send me patches to reduce the divergence between ACPICA and Linux/ACPICA, I'll be happy to accept them.

thanks,
Len Brown, Intel Open Source Technology Center