2004-11-05 21:51:37

by Adrian Bunk

[permalink] [raw]
Subject: [2.6 patch] drivers/acpi: remove unused exported functions

The patch below completely removes 7 functions that were
EXPORT_SYMBOL'ed but had exactly zero users in the kernel and makes
another one that was previously EXPORT_SYMBOL'ed static.

It also removes another unused global function to completely remove
drivers/acpi/hardware/hwtimer.c which contained no function used
anywhere in the kernel.

Please comment on whether this patch is correct or whether in-kernel
users of these functions are pending.


diffstat output:
drivers/acpi/acpi_ksyms.c | 8 -
drivers/acpi/events/evxfevnt.c | 191 -----------------------------
drivers/acpi/hardware/Makefile | 2
drivers/acpi/hardware/hwtimer.c | 200 -------------------------------
drivers/acpi/resources/rsxface.c | 52 --------
drivers/acpi/scan.c | 6
drivers/acpi/utilities/utxface.c | 89 -------------
include/acpi/achware.h | 17 --
include/acpi/acpi_bus.h | 1
include/acpi/acpixf.h | 24 ---
10 files changed, 6 insertions(+), 584 deletions(-)


Signed-off-by: Adrian Bunk <[email protected]>

--- linux-2.6.10-rc1-mm3-full/include/acpi/acpixf.h.old 2004-11-05 21:52:01.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/include/acpi/acpixf.h 2004-11-05 22:21:16.000000000 +0100
@@ -82,10 +82,6 @@
acpi_disable (
void);

-acpi_status
-acpi_get_system_info (
- struct acpi_buffer *ret_buffer);
-
const char *
acpi_format_exception (
acpi_status exception);
@@ -334,10 +330,6 @@
u32 flags);

acpi_status
-acpi_clear_event (
- u32 event);
-
-acpi_status
acpi_get_event_status (
u32 event,
acpi_event_status *event_status);
@@ -373,17 +365,6 @@
u32 flags,
acpi_event_status *event_status);

-acpi_status
-acpi_install_gpe_block (
- acpi_handle gpe_device,
- struct acpi_generic_address *gpe_block_address,
- u32 register_count,
- u32 interrupt_level);
-
-acpi_status
-acpi_remove_gpe_block (
- acpi_handle gpe_device);
-

/*
* Resource interfaces
@@ -401,11 +382,6 @@
struct acpi_buffer *ret_buffer);

acpi_status
-acpi_get_possible_resources(
- acpi_handle device_handle,
- struct acpi_buffer *ret_buffer);
-
-acpi_status
acpi_walk_resources (
acpi_handle device_handle,
char *path,
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/acpi_ksyms.c.old 2004-11-05 21:51:46.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/acpi_ksyms.c 2004-11-05 22:21:08.000000000 +0100
@@ -74,26 +74,19 @@
EXPORT_SYMBOL(acpi_remove_fixed_event_handler);
EXPORT_SYMBOL(acpi_acquire_global_lock);
EXPORT_SYMBOL(acpi_release_global_lock);
-EXPORT_SYMBOL(acpi_install_gpe_block);
-EXPORT_SYMBOL(acpi_remove_gpe_block);
EXPORT_SYMBOL(acpi_get_current_resources);
-EXPORT_SYMBOL(acpi_get_possible_resources);
EXPORT_SYMBOL(acpi_walk_resources);
EXPORT_SYMBOL(acpi_set_current_resources);
EXPORT_SYMBOL(acpi_resource_to_address64);
EXPORT_SYMBOL(acpi_enable_event);
EXPORT_SYMBOL(acpi_disable_event);
-EXPORT_SYMBOL(acpi_clear_event);
EXPORT_SYMBOL(acpi_set_gpe_type);
EXPORT_SYMBOL(acpi_enable_gpe);
-EXPORT_SYMBOL(acpi_get_timer_duration);
-EXPORT_SYMBOL(acpi_get_timer);
EXPORT_SYMBOL(acpi_get_sleep_type_data);
EXPORT_SYMBOL(acpi_get_register);
EXPORT_SYMBOL(acpi_set_register);
EXPORT_SYMBOL(acpi_enter_sleep_state);
EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios);
-EXPORT_SYMBOL(acpi_get_system_info);
EXPORT_SYMBOL(acpi_get_devices);

/* ACPI OS Services Layer (acpi_osl.c) */
@@ -139,7 +132,6 @@
EXPORT_SYMBOL(acpi_bus_register_driver);
EXPORT_SYMBOL(acpi_bus_unregister_driver);
EXPORT_SYMBOL(acpi_bus_scan);
-EXPORT_SYMBOL(acpi_bus_trim);
EXPORT_SYMBOL(acpi_bus_add);

#endif /*CONFIG_ACPI_BUS*/
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/events/evxfevnt.c.old 2004-11-05 21:51:12.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/events/evxfevnt.c 2004-11-05 21:53:37.000000000 +0100
@@ -421,45 +421,6 @@

/*******************************************************************************
*
- * FUNCTION: acpi_clear_event
- *
- * PARAMETERS: Event - The fixed event to be cleared
- *
- * RETURN: Status
- *
- * DESCRIPTION: Clear an ACPI event (fixed)
- *
- ******************************************************************************/
-
-acpi_status
-acpi_clear_event (
- u32 event)
-{
- acpi_status status = AE_OK;
-
-
- ACPI_FUNCTION_TRACE ("acpi_clear_event");
-
-
- /* Decode the Fixed Event */
-
- if (event > ACPI_EVENT_MAX) {
- return_ACPI_STATUS (AE_BAD_PARAMETER);
- }
-
- /*
- * Clear the requested fixed event (By writing a one to the
- * status register bit)
- */
- status = acpi_set_register (acpi_gbl_fixed_event_info[event].status_register_id,
- 1, ACPI_MTX_LOCK);
-
- return_ACPI_STATUS (status);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: acpi_clear_gpe
*
* PARAMETERS: gpe_device - Parent GPE Device
@@ -614,155 +575,3 @@
return_ACPI_STATUS (status);
}

-
-/*******************************************************************************
- *
- * FUNCTION: acpi_install_gpe_block
- *
- * PARAMETERS: gpe_device - Handle to the parent GPE Block Device
- * gpe_block_address - Address and space_iD
- * register_count - Number of GPE register pairs in the block
- * interrupt_level - H/W interrupt for the block
- *
- * RETURN: Status
- *
- * DESCRIPTION: Create and Install a block of GPE registers
- *
- ******************************************************************************/
-
-acpi_status
-acpi_install_gpe_block (
- acpi_handle gpe_device,
- struct acpi_generic_address *gpe_block_address,
- u32 register_count,
- u32 interrupt_level)
-{
- acpi_status status;
- union acpi_operand_object *obj_desc;
- struct acpi_namespace_node *node;
- struct acpi_gpe_block_info *gpe_block;
-
-
- ACPI_FUNCTION_TRACE ("acpi_install_gpe_block");
-
-
- if ((!gpe_device) ||
- (!gpe_block_address) ||
- (!register_count)) {
- return_ACPI_STATUS (AE_BAD_PARAMETER);
- }
-
- status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
- if (ACPI_FAILURE (status)) {
- return (status);
- }
-
- node = acpi_ns_map_handle_to_node (gpe_device);
- if (!node) {
- status = AE_BAD_PARAMETER;
- goto unlock_and_exit;
- }
-
- /*
- * For user-installed GPE Block Devices, the gpe_block_base_number
- * is always zero
- */
- status = acpi_ev_create_gpe_block (node, gpe_block_address, register_count,
- 0, interrupt_level, &gpe_block);
- if (ACPI_FAILURE (status)) {
- goto unlock_and_exit;
- }
-
- /* Get the device_object attached to the node */
-
- obj_desc = acpi_ns_get_attached_object (node);
- if (!obj_desc) {
- /* No object, create a new one */
-
- obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_DEVICE);
- if (!obj_desc) {
- status = AE_NO_MEMORY;
- goto unlock_and_exit;
- }
-
- status = acpi_ns_attach_object (node, obj_desc, ACPI_TYPE_DEVICE);
-
- /* Remove local reference to the object */
-
- acpi_ut_remove_reference (obj_desc);
-
- if (ACPI_FAILURE (status)) {
- goto unlock_and_exit;
- }
- }
-
- /* Install the GPE block in the device_object */
-
- obj_desc->device.gpe_block = gpe_block;
-
-
-unlock_and_exit:
- (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
- return_ACPI_STATUS (status);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: acpi_remove_gpe_block
- *
- * PARAMETERS: gpe_device - Handle to the parent GPE Block Device
- *
- * RETURN: Status
- *
- * DESCRIPTION: Remove a previously installed block of GPE registers
- *
- ******************************************************************************/
-
-acpi_status
-acpi_remove_gpe_block (
- acpi_handle gpe_device)
-{
- union acpi_operand_object *obj_desc;
- acpi_status status;
- struct acpi_namespace_node *node;
-
-
- ACPI_FUNCTION_TRACE ("acpi_remove_gpe_block");
-
-
- if (!gpe_device) {
- return_ACPI_STATUS (AE_BAD_PARAMETER);
- }
-
- status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
- if (ACPI_FAILURE (status)) {
- return (status);
- }
-
- node = acpi_ns_map_handle_to_node (gpe_device);
- if (!node) {
- status = AE_BAD_PARAMETER;
- goto unlock_and_exit;
- }
-
- /* Get the device_object attached to the node */
-
- obj_desc = acpi_ns_get_attached_object (node);
- if (!obj_desc ||
- !obj_desc->device.gpe_block) {
- return_ACPI_STATUS (AE_NULL_OBJECT);
- }
-
- /* Delete the GPE block (but not the device_object) */
-
- status = acpi_ev_delete_gpe_block (obj_desc->device.gpe_block);
- if (ACPI_SUCCESS (status)) {
- obj_desc->device.gpe_block = NULL;
- }
-
-unlock_and_exit:
- (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
- return_ACPI_STATUS (status);
-}
-
--- linux-2.6.10-rc1-mm3-full/include/acpi/achware.h.old 2004-11-05 21:54:59.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/include/acpi/achware.h 2004-11-05 21:55:37.000000000 +0100
@@ -159,21 +159,4 @@
struct acpi_gpe_block_info *gpe_block);


-/* ACPI Timer prototypes */
-
-acpi_status
-acpi_get_timer_resolution (
- u32 *resolution);
-
-acpi_status
-acpi_get_timer (
- u32 *ticks);
-
-acpi_status
-acpi_get_timer_duration (
- u32 start_ticks,
- u32 end_ticks,
- u32 *time_elapsed);
-
-
#endif /* __ACHWARE_H__ */
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/hardware/Makefile.old 2004-11-05 21:56:35.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/hardware/Makefile 2004-11-05 21:56:51.000000000 +0100
@@ -2,6 +2,6 @@
# Makefile for all Linux ACPI interpreter subdirectories
#

-obj-y := hwacpi.o hwgpe.o hwregs.o hwsleep.o hwtimer.o
+obj-y := hwacpi.o hwgpe.o hwregs.o hwsleep.o

EXTRA_CFLAGS += $(ACPI_CFLAGS)
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/resources/rsxface.c.old 2004-11-05 21:58:06.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/resources/rsxface.c 2004-11-05 21:58:21.000000000 +0100
@@ -160,58 +160,6 @@

/*******************************************************************************
*
- * FUNCTION: acpi_get_possible_resources
- *
- * PARAMETERS: device_handle - a handle to the device object for the
- * device we are querying
- * ret_buffer - a pointer to a buffer to receive the
- * resources for the device
- *
- * RETURN: Status
- *
- * DESCRIPTION: This function is called to get a list of the possible resources
- * for a specific device. The caller must first acquire a handle
- * for the desired device. The resource data is placed in the
- * buffer pointed to by the ret_buffer variable.
- *
- * If the function fails an appropriate status will be returned
- * and the value of ret_buffer is undefined.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_get_possible_resources (
- acpi_handle device_handle,
- struct acpi_buffer *ret_buffer)
-{
- acpi_status status;
-
-
- ACPI_FUNCTION_TRACE ("acpi_get_possible_resources");
-
-
- /*
- * Must have a valid handle and buffer, So we have to have a handle
- * and a return buffer structure, and if there is a non-zero buffer length
- * we also need a valid pointer in the buffer. If it's a zero buffer length,
- * we'll be returning the needed buffer size, so keep going.
- */
- if (!device_handle) {
- return_ACPI_STATUS (AE_BAD_PARAMETER);
- }
-
- status = acpi_ut_validate_buffer (ret_buffer);
- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-
- status = acpi_rs_get_prs_method_data (device_handle, ret_buffer);
- return_ACPI_STATUS (status);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: acpi_walk_resources
*
* PARAMETERS: device_handle - a handle to the device object for the
--- linux-2.6.10-rc1-mm3-full/include/acpi/acpi_bus.h.old 2004-11-05 22:00:14.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/include/acpi/acpi_bus.h 2004-11-05 22:00:21.000000000 +0100
@@ -328,7 +328,6 @@
int acpi_bus_register_driver (struct acpi_driver *driver);
int acpi_bus_unregister_driver (struct acpi_driver *driver);
int acpi_bus_scan (struct acpi_device *start);
-int acpi_bus_trim(struct acpi_device *start, int rmdevice);
int acpi_bus_add (struct acpi_device **child, struct acpi_device *parent,
acpi_handle handle, int type);

--- linux-2.6.10-rc1-mm3-full/drivers/acpi/scan.c.old 2004-11-05 21:58:55.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/scan.c 2004-11-05 21:59:48.000000000 +0100
@@ -44,6 +44,10 @@
typedef void acpi_device_sysfs_files(struct kobject *,
const struct attribute *);

+static int
+acpi_bus_trim(struct acpi_device *start,
+ int rmdevice);
+
static void setup_sys_fs_device_files(struct acpi_device *dev,
acpi_device_sysfs_files *func);

@@ -1213,7 +1217,7 @@
}


-int
+static int
acpi_bus_trim(struct acpi_device *start,
int rmdevice)
{
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/utilities/utxface.c.old 2004-11-05 22:20:40.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/utilities/utxface.c 2004-11-05 22:21:00.000000000 +0100
@@ -368,95 +368,6 @@
}


-/******************************************************************************
- *
- * FUNCTION: acpi_get_system_info
- *
- * PARAMETERS: out_buffer - a pointer to a buffer to receive the
- * resources for the device
- * buffer_length - the number of bytes available in the buffer
- *
- * RETURN: Status - the status of the call
- *
- * DESCRIPTION: This function is called to get information about the current
- * state of the ACPI subsystem. It will return system information
- * in the out_buffer.
- *
- * If the function fails an appropriate status will be returned
- * and the value of out_buffer is undefined.
- *
- ******************************************************************************/
-
-acpi_status
-acpi_get_system_info (
- struct acpi_buffer *out_buffer)
-{
- struct acpi_system_info *info_ptr;
- u32 i;
- acpi_status status;
-
-
- ACPI_FUNCTION_TRACE ("acpi_get_system_info");
-
-
- /* Parameter validation */
-
- status = acpi_ut_validate_buffer (out_buffer);
- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-
- /* Validate/Allocate/Clear caller buffer */
-
- status = acpi_ut_initialize_buffer (out_buffer, sizeof (struct acpi_system_info));
- if (ACPI_FAILURE (status)) {
- return_ACPI_STATUS (status);
- }
-
- /*
- * Populate the return buffer
- */
- info_ptr = (struct acpi_system_info *) out_buffer->pointer;
-
- info_ptr->acpi_ca_version = ACPI_CA_VERSION;
-
- /* System flags (ACPI capabilities) */
-
- info_ptr->flags = ACPI_SYS_MODE_ACPI;
-
- /* Timer resolution - 24 or 32 bits */
-
- if (!acpi_gbl_FADT) {
- info_ptr->timer_resolution = 0;
- }
- else if (acpi_gbl_FADT->tmr_val_ext == 0) {
- info_ptr->timer_resolution = 24;
- }
- else {
- info_ptr->timer_resolution = 32;
- }
-
- /* Clear the reserved fields */
-
- info_ptr->reserved1 = 0;
- info_ptr->reserved2 = 0;
-
- /* Current debug levels */
-
- info_ptr->debug_layer = acpi_dbg_layer;
- info_ptr->debug_level = acpi_dbg_level;
-
- /* Current status of the ACPI tables, per table type */
-
- info_ptr->num_table_types = NUM_ACPI_TABLE_TYPES;
- for (i = 0; i < NUM_ACPI_TABLE_TYPES; i++) {
- info_ptr->table_info[i].count = acpi_gbl_table_lists[i].count;
- }
-
- return_ACPI_STATUS (AE_OK);
-}
-
-
/*****************************************************************************
*
* FUNCTION: acpi_install_initialization_handler
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/hardware/hwtimer.c 2004-11-05 21:56:16.000000000 +0100
+++ /dev/null 2004-08-23 02:01:39.000000000 +0200
@@ -1,200 +0,0 @@
-
-/******************************************************************************
- *
- * Name: hwtimer.c - ACPI Power Management Timer Interface
- *
- *****************************************************************************/
-
-/*
- * Copyright (C) 2000 - 2004, R. Byron Moore
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions, and the following disclaimer,
- * without modification.
- * 2. Redistributions in binary form must reproduce at minimum a disclaimer
- * substantially similar to the "NO WARRANTY" disclaimer below
- * ("Disclaimer") and any redistribution must be conditioned upon
- * including a substantially similar Disclaimer requirement for further
- * binary redistribution.
- * 3. Neither the names of the above-listed copyright holders nor the names
- * of any contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * Alternatively, this software may be distributed under the terms of the
- * GNU General Public License ("GPL") version 2 as published by the Free
- * Software Foundation.
- *
- * NO WARRANTY
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGES.
- */
-
-#include <acpi/acpi.h>
-
-#define _COMPONENT ACPI_HARDWARE
- ACPI_MODULE_NAME ("hwtimer")
-
-
-/******************************************************************************
- *
- * FUNCTION: acpi_get_timer_resolution
- *
- * PARAMETERS: Resolution - Where the resolution is returned
- *
- * RETURN: Status and timer resolution
- *
- * DESCRIPTION: Obtains resolution of the ACPI PM Timer (24 or 32 bits).
- *
- ******************************************************************************/
-
-acpi_status
-acpi_get_timer_resolution (
- u32 *resolution)
-{
- ACPI_FUNCTION_TRACE ("acpi_get_timer_resolution");
-
-
- if (!resolution) {
- return_ACPI_STATUS (AE_BAD_PARAMETER);
- }
-
- if (0 == acpi_gbl_FADT->tmr_val_ext) {
- *resolution = 24;
- }
- else {
- *resolution = 32;
- }
-
- return_ACPI_STATUS (AE_OK);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: acpi_get_timer
- *
- * PARAMETERS: Ticks - Where the timer value is returned
- *
- * RETURN: Status and current ticks
- *
- * DESCRIPTION: Obtains current value of ACPI PM Timer (in ticks).
- *
- ******************************************************************************/
-
-acpi_status
-acpi_get_timer (
- u32 *ticks)
-{
- acpi_status status;
-
-
- ACPI_FUNCTION_TRACE ("acpi_get_timer");
-
-
- if (!ticks) {
- return_ACPI_STATUS (AE_BAD_PARAMETER);
- }
-
- status = acpi_hw_low_level_read (32, ticks, &acpi_gbl_FADT->xpm_tmr_blk);
-
- return_ACPI_STATUS (status);
-}
-
-
-/******************************************************************************
- *
- * FUNCTION: acpi_get_timer_duration
- *
- * PARAMETERS: start_ticks - Starting timestamp
- * end_ticks - End timestamp
- * time_elapsed - Where the elapsed time is returned
- *
- * RETURN: Status and time_elapsed
- *
- * DESCRIPTION: Computes the time elapsed (in microseconds) between two
- * PM Timer time stamps, taking into account the possibility of
- * rollovers, the timer resolution, and timer frequency.
- *
- * The PM Timer's clock ticks at roughly 3.6 times per
- * _microsecond_, and its clock continues through Cx state
- * transitions (unlike many CPU timestamp counters) -- making it
- * a versatile and accurate timer.
- *
- * Note that this function accommodates only a single timer
- * rollover. Thus for 24-bit timers, this function should only
- * be used for calculating durations less than ~4.6 seconds
- * (~20 minutes for 32-bit timers) -- calculations below:
- *
- * 2**24 Ticks / 3,600,000 Ticks/Sec = 4.66 sec
- * 2**32 Ticks / 3,600,000 Ticks/Sec = 1193 sec or 19.88 minutes
- *
- ******************************************************************************/
-
-acpi_status
-acpi_get_timer_duration (
- u32 start_ticks,
- u32 end_ticks,
- u32 *time_elapsed)
-{
- acpi_status status;
- u32 delta_ticks;
- acpi_integer quotient;
-
-
- ACPI_FUNCTION_TRACE ("acpi_get_timer_duration");
-
-
- if (!time_elapsed) {
- return_ACPI_STATUS (AE_BAD_PARAMETER);
- }
-
- /*
- * Compute Tick Delta:
- * Handle (max one) timer rollovers on 24-bit versus 32-bit timers.
- */
- if (start_ticks < end_ticks) {
- delta_ticks = end_ticks - start_ticks;
- }
- else if (start_ticks > end_ticks) {
- if (0 == acpi_gbl_FADT->tmr_val_ext) {
- /* 24-bit Timer */
-
- delta_ticks = (((0x00FFFFFF - start_ticks) + end_ticks) & 0x00FFFFFF);
- }
- else {
- /* 32-bit Timer */
-
- delta_ticks = (0xFFFFFFFF - start_ticks) + end_ticks;
- }
- }
- else /* start_ticks == end_ticks */ {
- *time_elapsed = 0;
- return_ACPI_STATUS (AE_OK);
- }
-
- /*
- * Compute Duration (Requires a 64-bit multiply and divide):
- *
- * time_elapsed = (delta_ticks * 1000000) / PM_TIMER_FREQUENCY;
- */
- status = acpi_ut_short_divide (((u64) delta_ticks) * 1000000,
- PM_TIMER_FREQUENCY, &quotient, NULL);
-
- *time_elapsed = (u32) quotient;
- return_ACPI_STATUS (status);
-}
-
-


2004-11-06 02:11:24

by Brown, Len

[permalink] [raw]
Subject: Re: [2.6 patch] drivers/acpi: remove unused exported functions

On Fri, 2004-11-05 at 16:50, Adrian Bunk wrote:
> The patch below completely removes 7 functions that were
> EXPORT_SYMBOL'ed but had exactly zero users in the kernel and makes
> another one that was previously EXPORT_SYMBOL'ed static.
>
> It also removes another unused global function to completely remove
> drivers/acpi/hardware/hwtimer.c which contained no function used
> anywhere in the kernel.
>
> Please comment on whether this patch is correct or whether in-kernel
> users of these functions are pending.
>
>
> diffstat output:
> drivers/acpi/acpi_ksyms.c | 8 -
> drivers/acpi/events/evxfevnt.c | 191 -----------------------------
> drivers/acpi/hardware/Makefile | 2
> drivers/acpi/hardware/hwtimer.c | 200
> -------------------------------
> drivers/acpi/resources/rsxface.c | 52 --------
> drivers/acpi/scan.c | 6
> drivers/acpi/utilities/utxface.c | 89 -------------
> include/acpi/achware.h | 17 --
> include/acpi/acpi_bus.h | 1
> include/acpi/acpixf.h | 24 ---
> 10 files changed, 6 insertions(+), 584 deletions(-)

No, I can't apply this one as-is.
Some of these routines are not called now
simply because Linux/ACPI is evolving and we don't
yet take advantage of some of the things supported
by ACPICA core we use.

thanks,
-Len


2004-11-06 11:49:27

by Adrian Bunk

[permalink] [raw]
Subject: Re: [2.6 patch] drivers/acpi: remove unused exported functions

On Fri, Nov 05, 2004 at 09:10:08PM -0500, Len Brown wrote:
> On Fri, 2004-11-05 at 16:50, Adrian Bunk wrote:
> > The patch below completely removes 7 functions that were
> > EXPORT_SYMBOL'ed but had exactly zero users in the kernel and makes
> > another one that was previously EXPORT_SYMBOL'ed static.
> >
> > It also removes another unused global function to completely remove
> > drivers/acpi/hardware/hwtimer.c which contained no function used
> > anywhere in the kernel.
> >
> > Please comment on whether this patch is correct or whether in-kernel
> > users of these functions are pending.
> >
> >
> > diffstat output:
> > drivers/acpi/acpi_ksyms.c | 8 -
> > drivers/acpi/events/evxfevnt.c | 191 -----------------------------
> > drivers/acpi/hardware/Makefile | 2
> > drivers/acpi/hardware/hwtimer.c | 200
> > -------------------------------
> > drivers/acpi/resources/rsxface.c | 52 --------
> > drivers/acpi/scan.c | 6
> > drivers/acpi/utilities/utxface.c | 89 -------------
> > include/acpi/achware.h | 17 --
> > include/acpi/acpi_bus.h | 1
> > include/acpi/acpixf.h | 24 ---
> > 10 files changed, 6 insertions(+), 584 deletions(-)
>
> No, I can't apply this one as-is.
> Some of these routines are not called now
> simply because Linux/ACPI is evolving and we don't
> yet take advantage of some of the things supported
> by ACPICA core we use.

I understand this, that's why I asked for comments on this patch.

But it seems a bit strange for me that e.g. the file hwtimer.c was added
nearly three years ago and exports functions - but currently has exactly
zero users. One effect is a needless code bloat for every single user
with CONFIG_ACPI_INTERPRETER=y.

Removing unused global functions is a pretty cheap way to get the kernel
smaller without any loss of functionality. Please check which of the
functions touched in my patch will actually be used in the foreseeable
future (if it would e.g. take another three years until hwtimer.c will
be used, it might be better to re-add it when it will actually be used).

> thanks,
> -Len

cu
Adrian

BTW: ACPI has tons of other unused global functions.

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2004-11-06 16:30:57

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [2.6 patch] drivers/acpi: remove unused exported functions



Adrian Bunk wrote:
> On Fri, Nov 05, 2004 at 09:10:08PM -0500, Len Brown wrote:
>
>>On Fri, 2004-11-05 at 16:50, Adrian Bunk wrote:
>>
>>>The patch below completely removes 7 functions that were
>>>EXPORT_SYMBOL'ed but had exactly zero users in the kernel and makes
>>>another one that was previously EXPORT_SYMBOL'ed static.
>>>
>>>It also removes another unused global function to completely remove
>>>drivers/acpi/hardware/hwtimer.c which contained no function used
>>>anywhere in the kernel.
>>>
>>>Please comment on whether this patch is correct or whether in-kernel
>>>users of these functions are pending.
>>>
>>>
>>>diffstat output:
>>> drivers/acpi/acpi_ksyms.c | 8 -
>>> drivers/acpi/events/evxfevnt.c | 191 -----------------------------
>>> drivers/acpi/hardware/Makefile | 2
>>> drivers/acpi/hardware/hwtimer.c | 200
>>>-------------------------------
>>> drivers/acpi/resources/rsxface.c | 52 --------
>>> drivers/acpi/scan.c | 6
>>> drivers/acpi/utilities/utxface.c | 89 -------------
>>> include/acpi/achware.h | 17 --
>>> include/acpi/acpi_bus.h | 1
>>> include/acpi/acpixf.h | 24 ---
>>> 10 files changed, 6 insertions(+), 584 deletions(-)
>>
>>No, I can't apply this one as-is.
>>Some of these routines are not called now
>>simply because Linux/ACPI is evolving and we don't
>>yet take advantage of some of the things supported
>>by ACPICA core we use.
>
>
> I understand this, that's why I asked for comments on this patch.
>
> But it seems a bit strange for me that e.g. the file hwtimer.c was added
> nearly three years ago and exports functions - but currently has exactly
> zero users. One effect is a needless code bloat for every single user
> with CONFIG_ACPI_INTERPRETER=y.
>
> Removing unused global functions is a pretty cheap way to get the kernel
> smaller without any loss of functionality. Please check which of the
> functions touched in my patch will actually be used in the foreseeable
> future (if it would e.g. take another three years until hwtimer.c will
> be used, it might be better to re-add it when it will actually be used).


Suggestion that satisfies both of you, I think:

#undef ACPI_FUTURE_USAGE
#ifdef ACPI_FUTURE_USAGE
tons of unused exported functions
#endif /* ACPU_FUTURE_USAGE */

This is what is being done in at least one case in the kernel network
subsystem, incremental patches adds new functions, to be used by
future patches, but sometimes Real Life (tm) gets in the way and the
programmer stalls development for some time, no problem, just ifdef it.

When, in the future, some functions start being used, hey, very easy
to remove the #ifdef.

Even for people trying to debug such subsystems eventually to get
something working its _nice_ to know at first glance what is really
being used, speeding up the process for the benefit or everybody.

Best Regards,

- Arnaldo

>
> BTW: ACPI has tons of other unused global functions.
>

And other areas as well, keep up the good work Adrian.

2004-11-06 20:39:38

by Matthew Wilcox

[permalink] [raw]
Subject: Re: [ACPI] [2.6 patch] drivers/acpi: remove unused exported functions

On Fri, Nov 05, 2004 at 10:50:21PM +0100, Adrian Bunk wrote:
> -acpi_status
> -acpi_install_gpe_block (
> - acpi_handle gpe_device,
> - struct acpi_generic_address *gpe_block_address,
> - u32 register_count,
> - u32 interrupt_level);
> -
> -acpi_status
> -acpi_remove_gpe_block (
> - acpi_handle gpe_device);
> -

I just wrote a driver that uses these two. Probably best if you refer to
http://developer.intel.com/technology/iapc/acpi/downloads/ACPICA-ProgRef.pdf
before deleting "unused" functions as these are part of the published
interfaces that the ACPICA provides.

--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain

2004-11-06 21:27:26

by Adrian Bunk

[permalink] [raw]
Subject: Re: [ACPI] [2.6 patch] drivers/acpi: remove unused exported functions

On Sat, Nov 06, 2004 at 08:39:34PM +0000, Matthew Wilcox wrote:
> On Fri, Nov 05, 2004 at 10:50:21PM +0100, Adrian Bunk wrote:
> > -acpi_status
> > -acpi_install_gpe_block (
> > - acpi_handle gpe_device,
> > - struct acpi_generic_address *gpe_block_address,
> > - u32 register_count,
> > - u32 interrupt_level);
> > -
> > -acpi_status
> > -acpi_remove_gpe_block (
> > - acpi_handle gpe_device);
> > -
>
> I just wrote a driver that uses these two. Probably best if you refer to
> http://developer.intel.com/technology/iapc/acpi/downloads/ACPICA-ProgRef.pdf
> before deleting "unused" functions as these are part of the published
> interfaces that the ACPICA provides.

If an in-kernel usage for some of the functions is coming soon simply
ignore these parts of my patch.

But if there's EXPORT_SYMBOL'ed code since nearly since nearly three
years in the kernel that has like drivers/acpi/hardware/hwtimer.c
exactly zero users, the only effect of this code is a code bloat for all
users of ACPI.

Prehaps #ifdef 0's are the best solution for published but unused
interfaces?

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2004-11-06 21:29:54

by Adrian Bunk

[permalink] [raw]
Subject: Re: [2.6 patch] drivers/acpi: remove unused exported functions

On Sat, Nov 06, 2004 at 01:31:06PM -0200, Arnaldo Carvalho de Melo wrote:
>
> Suggestion that satisfies both of you, I think:
>
> #undef ACPI_FUTURE_USAGE
> #ifdef ACPI_FUTURE_USAGE
> tons of unused exported functions
> #endif /* ACPU_FUTURE_USAGE */
>
> This is what is being done in at least one case in the kernel network
> subsystem, incremental patches adds new functions, to be used by
> future patches, but sometimes Real Life (tm) gets in the way and the
> programmer stalls development for some time, no problem, just ifdef it.
>
> When, in the future, some functions start being used, hey, very easy
> to remove the #ifdef.
>
> Even for people trying to debug such subsystems eventually to get
> something working its _nice_ to know at first glance what is really
> being used, speeding up the process for the benefit or everybody.

That's a good idea.

To make it easier, I could send a patc to move all the ACPI
EXPORT_SYMBOL's away from acpi_ksyms.c or you have to touch two files
for every function.

@Len:
What's your opinion on this proposal?

> Best Regards,
>
> - Arnaldo
>...

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2004-11-06 22:20:42

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [2.6 patch] drivers/acpi: remove unused exported functions

Adrian Bunk wrote:
> On Sat, Nov 06, 2004 at 01:31:06PM -0200, Arnaldo Carvalho de Melo wrote:
>
>>Suggestion that satisfies both of you, I think:
>>
>>#undef ACPI_FUTURE_USAGE
>>#ifdef ACPI_FUTURE_USAGE
>>tons of unused exported functions
>>#endif /* ACPU_FUTURE_USAGE */
>>
>>This is what is being done in at least one case in the kernel network
>>subsystem, incremental patches adds new functions, to be used by
>>future patches, but sometimes Real Life (tm) gets in the way and the
>>programmer stalls development for some time, no problem, just ifdef it.
>>
>>When, in the future, some functions start being used, hey, very easy
>>to remove the #ifdef.
>>
>>Even for people trying to debug such subsystems eventually to get
>>something working its _nice_ to know at first glance what is really
>>being used, speeding up the process for the benefit or everybody.
>
>
> That's a good idea.
>
> To make it easier, I could send a patc to move all the ACPI
> EXPORT_SYMBOL's away from acpi_ksyms.c or you have to touch two files
> for every function.


EXPORT_SYMBOL() should be right after the symbol definition, IMHO.

files that exists only to aggregate EXPORT_SYMBOL are a relic of the
past and must RIP, away from the kernel. I played the gravedigger
for net/netsyms.c and kernel/ksyms.c, I guess Len will not object
to you putting acpi_ksyms.c in so friendly company 8-)

- Arnaldo


> @Len:
> What's your opinion on this proposal?

2004-11-08 19:11:04

by Brown, Len

[permalink] [raw]
Subject: Re: [2.6 patch] drivers/acpi: remove unused exported functions

Thanks for the suggestion.

I'd certainly accept patches using ACPI_FUTURE_USAGE and moving
EXPORT_KSYMS to where they're more easily tracked.

If the motivation is kernel static size reduction, then I'll be
interested in seeing a before/after kernel size measurements.

-Len


2004-11-09 01:48:08

by Adrian Bunk

[permalink] [raw]
Subject: [2.6 patch] kill acpi_ksyms.c

On Mon, Nov 08, 2004 at 12:01:03PM -0500, Len Brown wrote:

> Thanks for the suggestion.
>
> I'd certainly accept patches using ACPI_FUTURE_USAGE and moving
> EXPORT_KSYMS to where they're more easily tracked.
>
> If the motivation is kernel static size reduction, then I'll be
> interested in seeing a before/after kernel size measurements.

Static size reduction is an important reason.
I'll send you the measurements when I'll have a patch ready.

Below is as a preparation a patch that removes acpi_ksyms.c .

It shouldn't make any practical difference.

The function acpi_db_user_commands that wasn't available in the whole
kernel sources was EXPORT_SYMBOL'ed. The patch removes this bogus
export.


diffstat output:
drivers/acpi/Makefile | 2
drivers/acpi/acpi_ksyms.c | 165 ------------------------------
drivers/acpi/bus.c | 10 +
drivers/acpi/ec.c | 2
drivers/acpi/events/evxface.c | 10 +
drivers/acpi/events/evxfevnt.c | 8 +
drivers/acpi/events/evxfregn.c | 4
drivers/acpi/hardware/hwregs.c | 4
drivers/acpi/hardware/hwsleep.c | 4
drivers/acpi/hardware/hwtimer.c | 5
drivers/acpi/namespace/nsxfeval.c | 4
drivers/acpi/namespace/nsxfname.c | 4
drivers/acpi/namespace/nsxfobj.c | 5
drivers/acpi/osl.c | 18 +++
drivers/acpi/pci_irq.c | 2
drivers/acpi/pci_root.c | 2
drivers/acpi/resources/rsxface.c | 7 +
drivers/acpi/scan.c | 6 -
drivers/acpi/tables/tbconvrt.c | 2
drivers/acpi/tables/tbxface.c | 3
drivers/acpi/tables/tbxfroot.c | 2
drivers/acpi/utilities/utdebug.c | 7 +
drivers/acpi/utilities/utglobal.c | 4
drivers/acpi/utilities/utxface.c | 2
drivers/acpi/utils.c | 4
include/acpi/acdebug.h | 5
26 files changed, 112 insertions(+), 179 deletions(-)



Signed-off-by: Adrian Bunk <[email protected]>

--- linux-2.6.10-rc1-mm3-full/include/acpi/acdebug.h.old 2004-11-09 00:58:10.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/include/acpi/acdebug.h 2004-11-09 00:58:18.000000000 +0100
@@ -386,11 +386,6 @@
acpi_db_execute_thread (
void *context);

-acpi_status
-acpi_db_user_commands (
- char prompt,
- union acpi_parse_object *op);
-
void
acpi_db_display_help (
char *help_type);
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/osl.c.old 2004-11-09 00:55:43.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/osl.c 2004-11-09 01:28:54.000000000 +0100
@@ -26,6 +26,7 @@
*/

#include <linux/config.h>
+#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/mm.h>
@@ -61,8 +62,11 @@

#ifdef ENABLE_DEBUGGER
#include <linux/kdb.h>
+
/* stuff for debugger support */
int acpi_in_debugger;
+EXPORT_SYMBOL(acpi_in_debugger);
+
extern char line_buf[80];
#endif /*ENABLE_DEBUGGER*/

@@ -117,6 +121,7 @@
acpi_os_vprintf(fmt, args);
va_end(args);
}
+EXPORT_SYMBOL(acpi_os_printf);

void
acpi_os_vprintf(const char *fmt, va_list args)
@@ -147,6 +152,7 @@
{
kfree(ptr);
}
+EXPORT_SYMBOL(acpi_os_free);

acpi_status
acpi_os_get_root_pointer(u32 flags, struct acpi_pointer *addr)
@@ -311,6 +317,7 @@
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(((signed long) ms * HZ) / 1000);
}
+EXPORT_SYMBOL(acpi_os_sleep);

void
acpi_os_stall(u32 us)
@@ -325,6 +332,7 @@
us -= delay;
}
}
+EXPORT_SYMBOL(acpi_os_stall);

/*
* Support ACPI 3.0 AML Timer operand
@@ -377,6 +385,7 @@

return AE_OK;
}
+EXPORT_SYMBOL(acpi_os_read_port);

acpi_status
acpi_os_write_port(
@@ -401,6 +410,7 @@

return AE_OK;
}
+EXPORT_SYMBOL(acpi_os_write_port);

acpi_status
acpi_os_read_memory(
@@ -519,6 +529,7 @@

return (result ? AE_ERROR : AE_OK);
}
+EXPORT_SYMBOL(acpi_os_read_pci_configuration);

acpi_status
acpi_os_write_pci_configuration (struct acpi_pci_id *pci_id, u32 reg, acpi_integer value, u32 width)
@@ -712,6 +723,7 @@

return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_os_queue_for_execution);

void
acpi_os_wait_events_complete(
@@ -719,6 +731,7 @@
{
flush_workqueue(kacpid_wq);
}
+EXPORT_SYMBOL(acpi_os_wait_events_complete);

/*
* Allocate the memory for a spinlock and initialize it.
@@ -830,6 +843,7 @@

return_ACPI_STATUS (AE_OK);
}
+EXPORT_SYMBOL(acpi_os_create_semaphore);


/*
@@ -856,6 +870,7 @@

return_ACPI_STATUS (AE_OK);
}
+EXPORT_SYMBOL(acpi_os_delete_semaphore);


/*
@@ -945,6 +960,7 @@

return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_os_wait_semaphore);


/*
@@ -971,6 +987,7 @@

return_ACPI_STATUS (AE_OK);
}
+EXPORT_SYMBOL(acpi_os_signal_semaphore);

u32
acpi_os_get_line(char *buffer)
@@ -1045,6 +1062,7 @@

return AE_OK;
}
+EXPORT_SYMBOL(acpi_os_signal);

int __init
acpi_os_name_setup(char *str)
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/utilities/utglobal.c.old 2004-11-09 00:59:29.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/utilities/utglobal.c 2004-11-09 01:11:56.000000000 +0100
@@ -43,6 +43,8 @@

#define DEFINE_ACPI_GLOBALS

+#include <linux/module.h>
+
#include <acpi/acpi.h>
#include <acpi/acnamesp.h>

@@ -143,10 +145,12 @@

/* Debug switch - level and trace mask */
u32 acpi_dbg_level = ACPI_DEBUG_DEFAULT;
+EXPORT_SYMBOL(acpi_dbg_level);

/* Debug switch - layer (component) mask */

u32 acpi_dbg_layer = ACPI_COMPONENT_DEFAULT | ACPI_ALL_DRIVERS;
+EXPORT_SYMBOL(acpi_dbg_layer);
u32 acpi_gbl_nesting_level = 0;


--- linux-2.6.10-rc1-mm3-full/drivers/acpi/utilities/utdebug.c.old 2004-11-09 01:00:15.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/utilities/utdebug.c 2004-11-09 01:12:33.000000000 +0100
@@ -41,6 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/

+#include <linux/module.h>

#include <acpi/acpi.h>

@@ -178,6 +179,7 @@
va_start (args, format);
acpi_os_vprintf (format, args);
}
+EXPORT_SYMBOL(acpi_ut_debug_print);


/*****************************************************************************
@@ -219,6 +221,7 @@
va_start (args, format);
acpi_os_vprintf (format, args);
}
+EXPORT_SYMBOL(acpi_ut_debug_print_raw);


/*****************************************************************************
@@ -250,6 +253,7 @@
acpi_ut_debug_print (ACPI_LV_FUNCTIONS, line_number, dbg_info,
"%s\n", acpi_gbl_fn_entry_str);
}
+EXPORT_SYMBOL(acpi_ut_trace);


/*****************************************************************************
@@ -378,6 +382,7 @@

acpi_gbl_nesting_level--;
}
+EXPORT_SYMBOL(acpi_ut_exit);


/*****************************************************************************
@@ -418,6 +423,7 @@

acpi_gbl_nesting_level--;
}
+EXPORT_SYMBOL(acpi_ut_status_exit);


/*****************************************************************************
@@ -451,6 +457,7 @@

acpi_gbl_nesting_level--;
}
+EXPORT_SYMBOL(acpi_ut_value_exit);


/*****************************************************************************
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/namespace/nsxfname.c.old 2004-11-09 01:02:20.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/namespace/nsxfname.c 2004-11-09 01:12:41.000000000 +0100
@@ -42,6 +42,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/

+#include <linux/module.h>

#include <acpi/acpi.h>
#include <acpi/acnamesp.h>
@@ -129,6 +130,7 @@

return (status);
}
+EXPORT_SYMBOL(acpi_get_handle);


/******************************************************************************
@@ -210,6 +212,7 @@
(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
return (status);
}
+EXPORT_SYMBOL(acpi_get_name);


/******************************************************************************
@@ -359,4 +362,5 @@
}
return (status);
}
+EXPORT_SYMBOL(acpi_get_object_info);

--- linux-2.6.10-rc1-mm3-full/drivers/acpi/namespace/nsxfobj.c.old 2004-11-09 01:03:33.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/namespace/nsxfobj.c 2004-11-09 01:12:46.000000000 +0100
@@ -42,6 +42,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/

+#include <linux/module.h>

#include <acpi/acpi.h>
#include <acpi/acnamesp.h>
@@ -106,6 +107,7 @@
status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
return (status);
}
+EXPORT_SYMBOL(acpi_get_type);


/*******************************************************************************
@@ -171,6 +173,7 @@
(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
return (status);
}
+EXPORT_SYMBOL(acpi_get_parent);


/*******************************************************************************
@@ -255,5 +258,5 @@
(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
return (status);
}
-
+EXPORT_SYMBOL(acpi_get_next_object);

--- linux-2.6.10-rc1-mm3-full/drivers/acpi/namespace/nsxfeval.c.old 2004-11-09 01:04:58.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/namespace/nsxfeval.c 2004-11-09 01:32:30.000000000 +0100
@@ -42,6 +42,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/

+#include <linux/module.h>

#include <acpi/acpi.h>
#include <acpi/acnamesp.h>
@@ -354,6 +355,7 @@

return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_evaluate_object);


/*******************************************************************************
@@ -426,6 +428,7 @@
(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_walk_namespace);


/*******************************************************************************
@@ -599,6 +602,7 @@
(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_get_devices);


/*******************************************************************************
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/tables/tbxface.c.old 2004-11-09 01:06:25.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/tables/tbxface.c 2004-11-09 01:46:04.000000000 +0100
@@ -42,6 +42,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/

+#include <linux/module.h>

#include <acpi/acpi.h>
#include <acpi/acnamesp.h>
@@ -439,5 +440,5 @@
ACPI_MEMCPY ((void *) ret_buffer->pointer, (void *) tbl_ptr, table_length);
return_ACPI_STATUS (AE_OK);
}
-
+EXPORT_SYMBOL(acpi_get_table);

--- linux-2.6.10-rc1-mm3-full/drivers/acpi/tables/tbxfroot.c.old 2004-11-09 01:07:05.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/tables/tbxfroot.c 2004-11-09 01:46:09.000000000 +0100
@@ -41,6 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/

+#include <linux/module.h>

#include <acpi/acpi.h>
#include <acpi/actables.h>
@@ -321,6 +322,7 @@
}
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_get_firmware_table);


/* TBD: Move to a new file */
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/events/evxface.c.old 2004-11-09 01:07:59.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/events/evxface.c 2004-11-09 01:46:13.000000000 +0100
@@ -41,6 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/

+#include <linux/module.h>

#include <acpi/acpi.h>
#include <acpi/acnamesp.h>
@@ -166,6 +167,7 @@
(void) acpi_ut_release_mutex (ACPI_MTX_EVENTS);
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_install_fixed_event_handler);


/*******************************************************************************
@@ -223,6 +225,7 @@
(void) acpi_ut_release_mutex (ACPI_MTX_EVENTS);
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_remove_fixed_event_handler);


/*******************************************************************************
@@ -392,6 +395,7 @@
(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_install_notify_handler);


/*******************************************************************************
@@ -550,6 +554,7 @@
(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_remove_notify_handler);


/*******************************************************************************
@@ -647,6 +652,7 @@
(void) acpi_ut_release_mutex (ACPI_MTX_EVENTS);
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_install_gpe_handler);


/*******************************************************************************
@@ -749,6 +755,7 @@
(void) acpi_ut_release_mutex (ACPI_MTX_EVENTS);
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_remove_gpe_handler);


/*******************************************************************************
@@ -791,6 +798,7 @@

return (status);
}
+EXPORT_SYMBOL(acpi_acquire_global_lock);


/*******************************************************************************
@@ -819,5 +827,5 @@
status = acpi_ev_release_global_lock ();
return (status);
}
-
+EXPORT_SYMBOL(acpi_release_global_lock);

--- linux-2.6.10-rc1-mm3-full/drivers/acpi/events/evxfregn.c.old 2004-11-09 01:09:47.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/events/evxfregn.c 2004-11-09 01:46:18.000000000 +0100
@@ -42,6 +42,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/

+#include <linux/module.h>

#include <acpi/acpi.h>
#include <acpi/acnamesp.h>
@@ -116,6 +117,7 @@
(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_install_address_space_handler);


/*******************************************************************************
@@ -241,5 +243,5 @@
(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (status);
}
-
+EXPORT_SYMBOL(acpi_remove_address_space_handler);

--- linux-2.6.10-rc1-mm3-full/drivers/acpi/events/evxfevnt.c.old 2004-11-09 01:16:39.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/events/evxfevnt.c 2004-11-09 01:46:23.000000000 +0100
@@ -41,6 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/

+#include <linux/module.h>

#include <acpi/acpi.h>
#include <acpi/acevents.h>
@@ -200,6 +201,7 @@

return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_enable_event);


/*******************************************************************************
@@ -248,6 +250,7 @@
unlock_and_exit:
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_set_gpe_type);


/*******************************************************************************
@@ -305,6 +308,7 @@
}
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_enable_gpe);


/*******************************************************************************
@@ -417,6 +421,7 @@

return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_disable_event);


/*******************************************************************************
@@ -456,6 +461,7 @@

return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_clear_event);


/*******************************************************************************
@@ -705,6 +711,7 @@
(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_install_gpe_block);


/*******************************************************************************
@@ -765,4 +772,5 @@
(void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_remove_gpe_block);

--- linux-2.6.10-rc1-mm3-full/drivers/acpi/resources/rsxface.c.old 2004-11-09 01:18:54.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/resources/rsxface.c 2004-11-09 01:46:27.000000000 +0100
@@ -41,6 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/

+#include <linux/module.h>

#include <acpi/acpi.h>
#include <acpi/acresrc.h>
@@ -156,6 +157,7 @@
status = acpi_rs_get_crs_method_data (device_handle, ret_buffer);
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_get_current_resources);


/*******************************************************************************
@@ -208,6 +210,7 @@
status = acpi_rs_get_prs_method_data (device_handle, ret_buffer);
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_get_possible_resources);


/*******************************************************************************
@@ -310,6 +313,7 @@
acpi_os_free (buffer.pointer);
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_walk_resources);


/*******************************************************************************
@@ -354,6 +358,7 @@
status = acpi_rs_set_srs_method_data (device_handle, in_buffer);
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_set_current_resources);


#define ACPI_COPY_FIELD(out, in, field) ((out)->field = (in)->field)
@@ -427,3 +432,5 @@

return (AE_OK);
}
+EXPORT_SYMBOL(acpi_resource_to_address64);
+
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/hardware/hwregs.c.old 2004-11-09 01:22:44.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/hardware/hwregs.c 2004-11-09 01:46:31.000000000 +0100
@@ -43,6 +43,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/

+#include <linux/module.h>

#include <acpi/acpi.h>
#include <acpi/acnamesp.h>
@@ -211,6 +212,7 @@
acpi_ut_remove_reference (info.return_object);
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_get_sleep_type_data);


/*******************************************************************************
@@ -307,6 +309,7 @@

return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_get_register);


/*******************************************************************************
@@ -457,6 +460,7 @@
value, register_value, bit_reg_info->parent_register));
return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_set_register);


/******************************************************************************
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/hardware/hwsleep.c.old 2004-11-09 01:23:44.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/hardware/hwsleep.c 2004-11-09 01:46:36.000000000 +0100
@@ -42,6 +42,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/

+#include <linux/module.h>
+
#include <acpi/acpi.h>

#define _COMPONENT ACPI_HARDWARE
@@ -391,6 +393,7 @@

return_ACPI_STATUS (AE_OK);
}
+EXPORT_SYMBOL(acpi_enter_sleep_state);


/******************************************************************************
@@ -456,6 +459,7 @@

return_ACPI_STATUS (AE_OK);
}
+EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios);


/******************************************************************************
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/utilities/utxface.c.old 2004-11-09 01:24:52.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/utilities/utxface.c 2004-11-09 01:46:40.000000000 +0100
@@ -41,6 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/

+#include <linux/module.h>

#include <acpi/acpi.h>
#include <acpi/acevents.h>
@@ -455,6 +456,7 @@

return_ACPI_STATUS (AE_OK);
}
+EXPORT_SYMBOL(acpi_get_system_info);


/*****************************************************************************
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/utils.c.old 2004-11-09 01:29:13.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/utils.c 2004-11-09 01:29:51.000000000 +0100
@@ -233,6 +233,7 @@

return_ACPI_STATUS(AE_OK);
}
+EXPORT_SYMBOL(acpi_extract_package);


acpi_status
@@ -268,6 +269,7 @@

return_ACPI_STATUS(AE_OK);
}
+EXPORT_SYMBOL(acpi_evaluate_integer);


#if 0
@@ -409,5 +411,5 @@

return_ACPI_STATUS(status);
}
-
+EXPORT_SYMBOL(acpi_evaluate_reference);

--- linux-2.6.10-rc1-mm3-full/drivers/acpi/bus.c.old 2004-11-09 01:30:28.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/bus.c 2004-11-09 01:46:49.000000000 +0100
@@ -22,6 +22,7 @@
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

+#include <linux/module.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/list.h>
@@ -44,8 +45,11 @@
#endif

FADT_DESCRIPTOR acpi_fadt;
+EXPORT_SYMBOL(acpi_fadt);
+
struct acpi_device *acpi_root;
struct proc_dir_entry *acpi_root_dir;
+EXPORT_SYMBOL(acpi_root_dir);

#define STRUCT_TO_INT(s) (*((int*)&s))

@@ -76,6 +80,7 @@

return_VALUE(0);
}
+EXPORT_SYMBOL(acpi_bus_get_device);

int
acpi_bus_get_status (
@@ -121,6 +126,7 @@

return_VALUE(0);
}
+EXPORT_SYMBOL(acpi_bus_get_status);


/* --------------------------------------------------------------------------
@@ -178,6 +184,7 @@

return_VALUE(0);
}
+EXPORT_SYMBOL(acpi_bus_get_power);


int
@@ -266,6 +273,7 @@

return_VALUE(result);
}
+EXPORT_SYMBOL(acpi_bus_set_power);



@@ -315,6 +323,7 @@

return_VALUE(0);
}
+EXPORT_SYMBOL(acpi_bus_generate_event);

int
acpi_bus_receive_event (
@@ -360,6 +369,7 @@

return_VALUE(0);
}
+EXPORT_SYMBOL(acpi_bus_receive_event);


/* --------------------------------------------------------------------------
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/tables/tbconvrt.c.old 2004-11-09 01:31:07.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/tables/tbconvrt.c 2004-11-09 01:46:54.000000000 +0100
@@ -41,6 +41,7 @@
* POSSIBILITY OF SUCH DAMAGES.
*/

+#include <linux/module.h>

#include <acpi/acpi.h>
#include <acpi/actables.h>
@@ -51,6 +52,7 @@


u8 acpi_fadt_is_v1;
+EXPORT_SYMBOL(acpi_fadt_is_v1);

/*******************************************************************************
*
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/scan.c.old 2004-11-09 01:34:12.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/scan.c 2004-11-09 01:35:29.000000000 +0100
@@ -609,6 +609,7 @@

return_VALUE(0);
}
+EXPORT_SYMBOL(acpi_bus_register_driver);


/**
@@ -635,6 +636,7 @@
}
return_VALUE(0);
}
+EXPORT_SYMBOL(acpi_bus_unregister_driver);

/**
* acpi_bus_find_driver
@@ -1107,7 +1109,7 @@

return_VALUE(result);
}
-
+EXPORT_SYMBOL(acpi_bus_add);


int acpi_bus_scan (struct acpi_device *start)
@@ -1211,6 +1213,7 @@

return_VALUE(0);
}
+EXPORT_SYMBOL(acpi_bus_scan);


int
@@ -1268,6 +1271,7 @@
}
return err;
}
+EXPORT_SYMBOL(acpi_bus_trim);

static int
acpi_bus_scan_fixed (
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/pci_irq.c.old 2004-11-09 01:35:50.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/pci_irq.c 2004-11-09 01:36:08.000000000 +0100
@@ -426,3 +426,5 @@

return_VALUE(dev->irq);
}
+EXPORT_SYMBOL(acpi_pci_irq_enable);
+
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/pci_root.c.old 2004-11-09 01:36:27.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/pci_root.c 2004-11-09 01:36:54.000000000 +0100
@@ -90,6 +90,7 @@

return n;
}
+EXPORT_SYMBOL(acpi_pci_register_driver);

void acpi_pci_unregister_driver(struct acpi_pci_driver *driver)
{
@@ -112,6 +113,7 @@
driver->remove(root->handle);
}
}
+EXPORT_SYMBOL(acpi_pci_unregister_driver);

static acpi_status
get_root_bridge_busnr_callback (struct acpi_resource *resource, void *data)
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/ec.c.old 2004-11-09 01:37:08.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/ec.c 2004-11-09 01:37:28.000000000 +0100
@@ -262,6 +262,7 @@
else
return err;
}
+EXPORT_SYMBOL(ec_read);

int
ec_write(u8 addr, u8 val)
@@ -278,6 +279,7 @@

return err;
}
+EXPORT_SYMBOL(ec_write);


static int
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/hardware/hwtimer.c.old 2004-11-09 01:21:52.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/hardware/hwtimer.c 2004-11-09 02:24:13.000000000 +0100
@@ -42,6 +42,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/

+#include <linux/module.h>
+
#include <acpi/acpi.h>

#define _COMPONENT ACPI_HARDWARE
@@ -112,6 +114,7 @@

return_ACPI_STATUS (status);
}
+EXPORT_SYMBOL(acpi_get_timer);


/******************************************************************************
@@ -196,5 +199,5 @@
*time_elapsed = (u32) quotient;
return_ACPI_STATUS (status);
}
-
+EXPORT_SYMBOL(acpi_get_timer_duration);

--- linux-2.6.10-rc1-mm3-full/drivers/acpi/Makefile.old 2004-11-09 01:38:35.000000000 +0100
+++ linux-2.6.10-rc1-mm3-full/drivers/acpi/Makefile 2004-11-09 01:39:09.000000000 +0100
@@ -12,8 +12,6 @@

EXTRA_CFLAGS += $(ACPI_CFLAGS)

-obj-$(CONFIG_ACPI) := acpi_ksyms.o
-
#
# ACPI Boot-Time Table Parsing
#
--- linux-2.6.10-rc1-mm3-full/drivers/acpi/acpi_ksyms.c 2004-11-09 01:14:55.000000000 +0100
+++ /dev/null 2004-08-23 02:01:39.000000000 +0200
@@ -1,165 +0,0 @@
-/*
- * acpi_ksyms.c - ACPI Kernel Symbols ($Revision: 16 $)
- *
- * Copyright (C) 2001, 2002 Andy Grover <[email protected]>
- * Copyright (C) 2001, 2002 Paul Diefenbaugh <[email protected]>
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-
-#include <linux/module.h>
-#include <linux/acpi.h>
-#include <acpi/acpi.h>
-#include <acpi/acpi_bus.h>
-
-
-#ifdef CONFIG_ACPI_INTERPRETER
-
-/* ACPI Debugger */
-
-#ifdef ENABLE_DEBUGGER
-
-extern int acpi_in_debugger;
-
-EXPORT_SYMBOL(acpi_in_debugger);
-EXPORT_SYMBOL(acpi_db_user_commands);
-
-#endif /* ENABLE_DEBUGGER */
-
-/* ACPI Core Subsystem */
-
-#ifdef ACPI_DEBUG_OUTPUT
-EXPORT_SYMBOL(acpi_dbg_layer);
-EXPORT_SYMBOL(acpi_dbg_level);
-EXPORT_SYMBOL(acpi_ut_debug_print_raw);
-EXPORT_SYMBOL(acpi_ut_debug_print);
-EXPORT_SYMBOL(acpi_ut_status_exit);
-EXPORT_SYMBOL(acpi_ut_value_exit);
-EXPORT_SYMBOL(acpi_ut_exit);
-EXPORT_SYMBOL(acpi_ut_trace);
-#endif /*ACPI_DEBUG_OUTPUT*/
-
-EXPORT_SYMBOL(acpi_get_handle);
-EXPORT_SYMBOL(acpi_get_parent);
-EXPORT_SYMBOL(acpi_get_type);
-EXPORT_SYMBOL(acpi_get_name);
-EXPORT_SYMBOL(acpi_get_object_info);
-EXPORT_SYMBOL(acpi_get_next_object);
-EXPORT_SYMBOL(acpi_evaluate_object);
-EXPORT_SYMBOL(acpi_get_table);
-EXPORT_SYMBOL(acpi_get_firmware_table);
-EXPORT_SYMBOL(acpi_install_notify_handler);
-EXPORT_SYMBOL(acpi_remove_notify_handler);
-EXPORT_SYMBOL(acpi_install_gpe_handler);
-EXPORT_SYMBOL(acpi_remove_gpe_handler);
-EXPORT_SYMBOL(acpi_install_address_space_handler);
-EXPORT_SYMBOL(acpi_remove_address_space_handler);
-EXPORT_SYMBOL(acpi_install_fixed_event_handler);
-EXPORT_SYMBOL(acpi_remove_fixed_event_handler);
-EXPORT_SYMBOL(acpi_acquire_global_lock);
-EXPORT_SYMBOL(acpi_release_global_lock);
-EXPORT_SYMBOL(acpi_install_gpe_block);
-EXPORT_SYMBOL(acpi_remove_gpe_block);
-EXPORT_SYMBOL(acpi_get_current_resources);
-EXPORT_SYMBOL(acpi_get_possible_resources);
-EXPORT_SYMBOL(acpi_walk_resources);
-EXPORT_SYMBOL(acpi_set_current_resources);
-EXPORT_SYMBOL(acpi_resource_to_address64);
-EXPORT_SYMBOL(acpi_enable_event);
-EXPORT_SYMBOL(acpi_disable_event);
-EXPORT_SYMBOL(acpi_clear_event);
-EXPORT_SYMBOL(acpi_set_gpe_type);
-EXPORT_SYMBOL(acpi_enable_gpe);
-EXPORT_SYMBOL(acpi_get_timer_duration);
-EXPORT_SYMBOL(acpi_get_timer);
-EXPORT_SYMBOL(acpi_get_sleep_type_data);
-EXPORT_SYMBOL(acpi_get_register);
-EXPORT_SYMBOL(acpi_set_register);
-EXPORT_SYMBOL(acpi_enter_sleep_state);
-EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios);
-EXPORT_SYMBOL(acpi_get_system_info);
-EXPORT_SYMBOL(acpi_get_devices);
-
-/* ACPI OS Services Layer (acpi_osl.c) */
-
-EXPORT_SYMBOL(acpi_os_free);
-EXPORT_SYMBOL(acpi_os_printf);
-EXPORT_SYMBOL(acpi_os_sleep);
-EXPORT_SYMBOL(acpi_os_stall);
-EXPORT_SYMBOL(acpi_os_read_port);
-EXPORT_SYMBOL(acpi_os_write_port);
-EXPORT_SYMBOL(acpi_os_signal);
-EXPORT_SYMBOL(acpi_os_queue_for_execution);
-EXPORT_SYMBOL(acpi_os_signal_semaphore);
-EXPORT_SYMBOL(acpi_os_create_semaphore);
-EXPORT_SYMBOL(acpi_os_delete_semaphore);
-EXPORT_SYMBOL(acpi_os_wait_semaphore);
-EXPORT_SYMBOL(acpi_os_wait_events_complete);
-EXPORT_SYMBOL(acpi_os_read_pci_configuration);
-
-/* ACPI Utilities (acpi_utils.c) */
-
-EXPORT_SYMBOL(acpi_extract_package);
-EXPORT_SYMBOL(acpi_evaluate_integer);
-EXPORT_SYMBOL(acpi_evaluate_reference);
-
-#endif /*CONFIG_ACPI_INTERPRETER*/
-
-
-/* ACPI Bus Driver (acpi_bus.c) */
-
-#ifdef CONFIG_ACPI_BUS
-
-EXPORT_SYMBOL(acpi_fadt);
-EXPORT_SYMBOL(acpi_fadt_is_v1);
-EXPORT_SYMBOL(acpi_walk_namespace);
-EXPORT_SYMBOL(acpi_root_dir);
-EXPORT_SYMBOL(acpi_bus_get_device);
-EXPORT_SYMBOL(acpi_bus_get_status);
-EXPORT_SYMBOL(acpi_bus_get_power);
-EXPORT_SYMBOL(acpi_bus_set_power);
-EXPORT_SYMBOL(acpi_bus_generate_event);
-EXPORT_SYMBOL(acpi_bus_receive_event);
-EXPORT_SYMBOL(acpi_bus_register_driver);
-EXPORT_SYMBOL(acpi_bus_unregister_driver);
-EXPORT_SYMBOL(acpi_bus_scan);
-EXPORT_SYMBOL(acpi_bus_trim);
-EXPORT_SYMBOL(acpi_bus_add);
-
-#endif /*CONFIG_ACPI_BUS*/
-
-
-/* ACPI PCI Driver (pci_irq.c) */
-
-#ifdef CONFIG_ACPI_PCI
-
-#include <linux/pci.h>
-extern int acpi_pci_irq_enable(struct pci_dev *dev);
-EXPORT_SYMBOL(acpi_pci_irq_enable);
-EXPORT_SYMBOL(acpi_pci_register_driver);
-EXPORT_SYMBOL(acpi_pci_unregister_driver);
-#endif /*CONFIG_ACPI_PCI */
-
-#ifdef CONFIG_ACPI_EC
-/* ACPI EC driver (ec.c) */
-
-EXPORT_SYMBOL(ec_read);
-EXPORT_SYMBOL(ec_write);
-#endif
-

2004-11-10 01:23:50

by Adrian Bunk

[permalink] [raw]
Subject: [2.6 patch] drivers/acpi: #ifdef unused functions away

On Mon, Nov 08, 2004 at 12:01:03PM -0500, Len Brown wrote:

> Thanks for the suggestion.
>
> I'd certainly accept patches using ACPI_FUTURE_USAGE and moving
> EXPORT_KSYMS to where they're more easily tracked.

My ACPI_FUTURE_USAGE patch (applies on top of my previous patch that
kills acpi_ksyms.c) is below.

This patch only #ifdef's completely unused code away - it does not make
the many global functions only used inside the file they are defined in
static.

> If the motivation is kernel static size reduction, then I'll be
> interested in seeing a before/after kernel size measurements.

(both examples with gcc 3.4.2 on i386 compiled for an Athlon)

Full .config (no module support, _everything_ possible compiled
statically into the kernel):

530552 2004-11-10 02:04 drivers/acpi/built-in.o
556195 2004-11-09 22:50 drivers/acpi/built-in.o-before-acpi-cleanup

-> 4.8% space saving


My own kernel (minimum ACPI support statically in the kernel for a
proper shutdown of my computer):

250235 2004-11-10 02:08 drivers/acpi/built-in.o
256262 2004-11-10 00:09 drivers/acpi/built-in.o-before-acpi-cleanup

-> 2.4% space saving


The nice thing is that we get these space savings for free.


diffstat output:
drivers/acpi/dispatcher/dsmthdat.c | 3 ++-
drivers/acpi/dispatcher/dswstate.c | 10 ++++++++--
drivers/acpi/events/evxface.c | 3 ++-
drivers/acpi/events/evxfevnt.c | 7 ++++++-
drivers/acpi/executer/exdump.c | 4 ++++
drivers/acpi/hardware/Makefile | 4 +++-
drivers/acpi/hardware/hwgpe.c | 3 ++-
drivers/acpi/hardware/hwsleep.c | 3 ++-
drivers/acpi/namespace/Makefile | 4 +++-
drivers/acpi/namespace/nsdump.c | 4 ++++
drivers/acpi/namespace/nsload.c | 4 ++++
drivers/acpi/namespace/nsutils.c | 3 ++-
drivers/acpi/namespace/nsxfeval.c | 3 ++-
drivers/acpi/osl.c | 6 ++++++
drivers/acpi/parser/pstree.c | 4 +++-
drivers/acpi/parser/psutils.c | 2 ++
drivers/acpi/pci_bind.c | 2 ++
drivers/acpi/resources/Makefile | 4 +++-
drivers/acpi/resources/rsutils.c | 3 ++-
drivers/acpi/resources/rsxface.c | 3 ++-
drivers/acpi/tables/tbutils.c | 3 ++-
drivers/acpi/tables/tbxface.c | 4 ++++
drivers/acpi/utilities/utalloc.c | 3 ++-
drivers/acpi/utilities/utmisc.c | 3 ++-
drivers/acpi/utilities/utxface.c | 4 ++++
include/acpi/acdispat.h | 8 ++++++++
include/acpi/achware.h | 5 ++++-
include/acpi/acinterp.h | 3 ++-
include/acpi/acmacros.h | 8 ++++++++
include/acpi/acnamesp.h | 10 ++++++++++
include/acpi/acparser.h | 4 ++++
include/acpi/acpiosxf.h | 6 ++++++
include/acpi/acpixf.h | 20 ++++++++++++++++++++
include/acpi/acresrc.h | 4 ++++
include/acpi/actables.h | 2 ++
include/acpi/acutils.h | 6 ++++++
include/acpi/platform/acenv.h | 8 ++++++++
37 files changed, 160 insertions(+), 20 deletions(-)


Signed-off-by: Adrian Bunk <[email protected]>

--- linux-2.6.10-rc1-mm4-full/include/acpi/acdispat.h.old 2004-11-09 22:57:58.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/include/acpi/acdispat.h 2004-11-09 23:03:38.000000000 +0100
@@ -62,10 +62,12 @@
u32 pop_count,
struct acpi_walk_state *walk_state);

+#ifdef ACPI_FUTURE_USAGE
void *
acpi_ds_obj_stack_get_value (
u32 index,
struct acpi_walk_state *walk_state);
+#endif

acpi_status
acpi_ds_obj_stack_pop_object (
@@ -248,11 +250,13 @@
acpi_ds_is_method_value (
union acpi_operand_object *obj_desc);

+#ifdef ACPI_FUTURE_USAGE
acpi_object_type
acpi_ds_method_data_get_type (
u16 opcode,
u32 index,
struct acpi_walk_state *walk_state);
+#endif

acpi_status
acpi_ds_method_data_get_value (
@@ -440,9 +444,11 @@
struct acpi_parameter_info *info,
u32 pass_number);

+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_ds_obj_stack_delete_all (
struct acpi_walk_state *walk_state);
+#endif

acpi_status
acpi_ds_obj_stack_pop_and_delete (
@@ -482,6 +488,7 @@
acpi_ds_delete_walk_state_cache (
void);

+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_ds_result_insert (
void *object,
@@ -493,6 +500,7 @@
union acpi_operand_object **object,
u32 index,
struct acpi_walk_state *walk_state);
+#endif

acpi_status
acpi_ds_result_pop (
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/dispatcher/dsmthdat.c.old 2004-11-09 22:58:59.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/dispatcher/dsmthdat.c 2004-11-09 22:59:33.000000000 +0100
@@ -350,7 +350,7 @@
* RETURN: Data type of current value of the selected Arg or Local
*
******************************************************************************/
-
+#ifdef ACPI_FUTURE_USAGE
acpi_object_type
acpi_ds_method_data_get_type (
u16 opcode,
@@ -385,6 +385,7 @@

return_VALUE (ACPI_GET_OBJECT_TYPE (object));
}
+#endif /* ACPI_FUTURE_USAGE */


/*******************************************************************************
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/dispatcher/dswstate.c.old 2004-11-09 23:01:14.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/dispatcher/dswstate.c 2004-11-09 23:04:17.000000000 +0100
@@ -51,6 +51,8 @@
ACPI_MODULE_NAME ("dswstate")


+#ifdef ACPI_FUTURE_USAGE
+
/*******************************************************************************
*
* FUNCTION: acpi_ds_result_insert
@@ -174,6 +176,8 @@
return (AE_OK);
}

+#endif /* ACPI_FUTURE_USAGE */
+

/*******************************************************************************
*
@@ -445,7 +449,7 @@
* Should be used with great care, if at all!
*
******************************************************************************/
-
+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_ds_obj_stack_delete_all (
struct acpi_walk_state *walk_state)
@@ -467,6 +471,7 @@

return_ACPI_STATUS (AE_OK);
}
+#endif /* ACPI_FUTURE_USAGE */


/*******************************************************************************
@@ -687,7 +692,7 @@
* be within the range of the current stack pointer.
*
******************************************************************************/
-
+#ifdef ACPI_FUTURE_USAGE
void *
acpi_ds_obj_stack_get_value (
u32 index,
@@ -712,6 +717,7 @@
return_PTR (walk_state->operands[(acpi_native_uint)(walk_state->num_operands - 1) -
index]);
}
+#endif /* ACPI_FUTURE_USAGE */


/*******************************************************************************
--- linux-2.6.10-rc1-mm4-full/include/acpi/acpixf.h.old 2004-11-09 23:05:59.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/include/acpi/acpixf.h 2004-11-10 01:27:52.000000000 +0100
@@ -70,9 +70,11 @@
acpi_terminate (
void);

+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_subsystem_status (
void);
+#endif

acpi_status
acpi_enable (
@@ -82,9 +84,11 @@
acpi_disable (
void);

+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_get_system_info (
struct acpi_buffer *ret_buffer);
+#endif

const char *
acpi_format_exception (
@@ -94,10 +98,12 @@
acpi_purge_cached_objects (
void);

+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_install_initialization_handler (
acpi_init_handler handler,
u32 function);
+#endif

/*
* ACPI Memory manager
@@ -129,6 +135,7 @@
acpi_load_tables (
void);

+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_load_table (
struct acpi_table_header *table_ptr);
@@ -142,6 +149,7 @@
acpi_table_type table_type,
u32 instance,
struct acpi_table_header *out_table_header);
+#endif /* ACPI_FUTURE_USAGE */

acpi_status
acpi_get_table (
@@ -218,6 +226,7 @@
struct acpi_object_list *parameter_objects,
struct acpi_buffer *return_object_buffer);

+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_evaluate_object_typed (
acpi_handle object,
@@ -225,6 +234,7 @@
struct acpi_object_list *external_params,
struct acpi_buffer *return_buffer,
acpi_object_type return_type);
+#endif

acpi_status
acpi_get_object_info (
@@ -299,9 +309,11 @@
acpi_event_handler address,
void *context);

+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_install_exception_handler (
acpi_exception_handler handler);
+#endif


/*
@@ -333,6 +345,7 @@
u32 event,
u32 flags);

+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_clear_event (
u32 event);
@@ -341,6 +354,7 @@
acpi_get_event_status (
u32 event,
acpi_event_status *event_status);
+#endif /* ACPI_FUTURE_USAGE */

acpi_status
acpi_set_gpe_type (
@@ -366,6 +380,7 @@
u32 gpe_number,
u32 flags);

+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_get_gpe_status (
acpi_handle gpe_device,
@@ -383,6 +398,7 @@
acpi_status
acpi_remove_gpe_block (
acpi_handle gpe_device);
+#endif /* ACPI_FUTURE_USAGE */


/*
@@ -400,10 +416,12 @@
acpi_handle device_handle,
struct acpi_buffer *ret_buffer);

+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_get_possible_resources(
acpi_handle device_handle,
struct acpi_buffer *ret_buffer);
+#endif

acpi_status
acpi_walk_resources (
@@ -447,9 +465,11 @@
acpi_set_firmware_waking_vector (
acpi_physical_address physical_address);

+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_get_firmware_waking_vector (
acpi_physical_address *physical_address);
+#endif

acpi_status
acpi_get_sleep_type_data (
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/events/evxface.c.old 2004-11-09 23:06:33.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/events/evxface.c 2004-11-09 23:07:05.000000000 +0100
@@ -64,7 +64,7 @@
* DESCRIPTION: Saves the pointer to the handler function
*
******************************************************************************/
-
+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_install_exception_handler (
acpi_exception_handler handler)
@@ -95,6 +95,7 @@
(void) acpi_ut_release_mutex (ACPI_MTX_EVENTS);
return_ACPI_STATUS (status);
}
+#endif /* ACPI_FUTURE_USAGE */


/*******************************************************************************
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/events/evxfevnt.c.old 2004-11-09 23:07:56.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/events/evxfevnt.c 2004-11-09 23:10:03.000000000 +0100
@@ -435,7 +435,7 @@
* DESCRIPTION: Clear an ACPI event (fixed)
*
******************************************************************************/
-
+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_clear_event (
u32 event)
@@ -462,6 +462,7 @@
return_ACPI_STATUS (status);
}
EXPORT_SYMBOL(acpi_clear_event);
+#endif /* ACPI_FUTURE_USAGE */


/*******************************************************************************
@@ -518,6 +519,8 @@
}


+#ifdef ACPI_FUTURE_USAGE
+
/*******************************************************************************
*
* FUNCTION: acpi_get_event_status
@@ -774,3 +777,5 @@
}
EXPORT_SYMBOL(acpi_remove_gpe_block);

+#endif /* ACPI_FUTURE_USAGE */
+
--- linux-2.6.10-rc1-mm4-full/include/acpi/acinterp.h.old 2004-11-09 23:14:33.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/include/acpi/acinterp.h 2004-11-09 23:18:00.000000000 +0100
@@ -504,6 +504,7 @@
char *module_name,
u32 line_number);

+#ifdef ACPI_FUTURE_USAGE
void
acpi_ex_dump_object_descriptor (
union acpi_operand_object *object,
@@ -533,7 +534,7 @@
acpi_ex_out_address (
char *title,
acpi_physical_address value);
-
+#endif /* ACPI_FUTURE_USAGE */

/*
* exnames - interpreter/scanner name load/execute
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/executer/exdump.c.old 2004-11-09 23:13:44.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/executer/exdump.c 2004-11-09 23:17:42.000000000 +0100
@@ -438,6 +438,8 @@
}


+#ifdef ACPI_FUTURE_USAGE
+
/*****************************************************************************
*
* FUNCTION: acpi_ex_out*
@@ -786,5 +788,7 @@
return_VOID;
}

+#endif /* ACPI_FUTURE_USAGE */
+
#endif

--- linux-2.6.10-rc1-mm4-full/drivers/acpi/hardware/hwsleep.c.old 2004-11-09 23:38:42.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/hardware/hwsleep.c 2004-11-09 23:39:04.000000000 +0100
@@ -112,7 +112,7 @@
* DESCRIPTION: Access function for firmware_waking_vector field in FACS
*
******************************************************************************/
-
+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_get_firmware_waking_vector (
acpi_physical_address *physical_address)
@@ -138,6 +138,7 @@

return_ACPI_STATUS (AE_OK);
}
+#endif


/******************************************************************************
--- linux-2.6.10-rc1-mm4-full/include/acpi/achware.h.old 2004-11-09 23:39:24.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/include/acpi/achware.h 2004-11-10 01:57:41.000000000 +0100
@@ -131,10 +131,12 @@
struct acpi_gpe_xrupt_info *gpe_xrupt_info,
struct acpi_gpe_block_info *gpe_block);

+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_hw_get_gpe_status (
struct acpi_gpe_event_info *gpe_event_info,
acpi_event_status *event_status);
+#endif

acpi_status
acpi_hw_disable_all_gpes (
@@ -161,6 +163,7 @@

/* ACPI Timer prototypes */

+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_get_timer_resolution (
u32 *resolution);
@@ -174,6 +177,6 @@
u32 start_ticks,
u32 end_ticks,
u32 *time_elapsed);
-
+#endif /* ACPI_FUTURE_USAGE */

#endif /* __ACHWARE_H__ */
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/hardware/Makefile.old 2004-11-09 23:40:15.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/hardware/Makefile 2004-11-09 23:40:52.000000000 +0100
@@ -2,6 +2,8 @@
# Makefile for all Linux ACPI interpreter subdirectories
#

-obj-y := hwacpi.o hwgpe.o hwregs.o hwsleep.o hwtimer.o
+obj-y := hwacpi.o hwgpe.o hwregs.o hwsleep.o
+
+obj-$(ACPI_FUTURE_USAGE) += hwtimer.o

EXTRA_CFLAGS += $(ACPI_CFLAGS)
--- linux-2.6.10-rc1-mm4-full/include/acpi/acmacros.h.old 2004-11-09 23:43:54.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/include/acpi/acmacros.h 2004-11-09 23:44:51.000000000 +0100
@@ -538,7 +538,11 @@


#define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b)
+
+#ifdef ACPI_FUTURE_USAGE
#define ACPI_DUMP_TABLES(a,b) acpi_ns_dump_tables(a,b)
+#endif
+
#define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d)
#define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a)
#define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT)
@@ -591,7 +595,11 @@
#define ACPI_DUMP_STACK_ENTRY(a)
#define ACPI_DUMP_OPERANDS(a,b,c,d,e)
#define ACPI_DUMP_ENTRY(a,b)
+
+#ifdef ACPI_FUTURE_USAGE
#define ACPI_DUMP_TABLES(a,b)
+#endif
+
#define ACPI_DUMP_PATHNAME(a,b,c,d)
#define ACPI_DUMP_RESOURCE_LIST(a)
#define ACPI_DUMP_BUFFER(a,b)
--- linux-2.6.10-rc1-mm4-full/include/acpi/acnamesp.h.old 2004-11-09 23:44:55.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/include/acpi/acnamesp.h 2004-11-10 00:02:03.000000000 +0100
@@ -210,6 +210,7 @@
* Namespace modification - nsmodify
*/

+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_ns_unload_namespace (
acpi_handle handle);
@@ -217,16 +218,19 @@
acpi_status
acpi_ns_delete_subtree (
acpi_handle start_handle);
+#endif


/*
* Namespace dump/print utilities - nsdump
*/

+#ifdef ACPI_FUTURE_USAGE
void
acpi_ns_dump_tables (
acpi_handle search_base,
u32 max_depth);
+#endif

void
acpi_ns_dump_entry (
@@ -245,6 +249,7 @@
u32 num_segments,
char *pathname);

+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_ns_dump_one_device (
acpi_handle obj_handle,
@@ -255,6 +260,7 @@
void
acpi_ns_dump_root_devices (
void);
+#endif /* ACPI_FUTURE_USAGE */

acpi_status
acpi_ns_dump_one_object (
@@ -263,6 +269,7 @@
void *context,
void **return_value);

+#ifdef ACPI_FUTURE_USAGE
void
acpi_ns_dump_objects (
acpi_object_type type,
@@ -270,6 +277,7 @@
u32 max_depth,
u32 ownder_id,
acpi_handle start_handle);
+#endif


/*
@@ -303,9 +311,11 @@
* Parent/Child/Peer utility functions
*/

+#ifdef ACPI_FUTURE_USAGE
acpi_name
acpi_ns_find_parent_name (
struct acpi_namespace_node *node_to_search);
+#endif


/*
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/namespace/nsdump.c.old 2004-11-09 23:52:20.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/namespace/nsdump.c 2004-11-09 23:48:07.000000000 +0100
@@ -550,6 +550,8 @@
}


+#ifdef ACPI_FUTURE_USAGE
+
/*******************************************************************************
*
* FUNCTION: acpi_ns_dump_objects
@@ -635,6 +637,8 @@
return_VOID;
}

+#endif /* ACPI_FUTURE_USAGE */
+

/*******************************************************************************
*
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/namespace/Makefile.old 2004-11-09 23:50:33.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/namespace/Makefile 2004-11-09 23:51:18.000000000 +0100
@@ -2,9 +2,11 @@
# Makefile for all Linux ACPI interpreter subdirectories
#

-obj-y := nsaccess.o nsdumpdv.o nsload.o nssearch.o nsxfeval.o \
+obj-y := nsaccess.o nsload.o nssearch.o nsxfeval.o \
nsalloc.o nseval.o nsnames.o nsutils.o nsxfname.o \
nsdump.o nsinit.o nsobject.o nswalk.o nsxfobj.o \
nsparse.o

+obj-$(ACPI_FUTURE_USAGE) += nsdumpdv.o
+
EXTRA_CFLAGS += $(ACPI_CFLAGS)
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/namespace/nsload.c.old 2004-11-09 23:57:35.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/namespace/nsload.c 2004-11-09 23:57:23.000000000 +0100
@@ -321,6 +321,8 @@
}


+#ifdef ACPI_FUTURE_USAGE
+
/*******************************************************************************
*
* FUNCTION: acpi_ns_delete_subtree
@@ -452,5 +454,7 @@
return_ACPI_STATUS (status);
}

+#endif /* ACPI_FUTURE_USAGE */
+
#endif

--- linux-2.6.10-rc1-mm4-full/drivers/acpi/namespace/nsutils.c.old 2004-11-09 23:59:26.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/namespace/nsutils.c 2004-11-10 00:01:38.000000000 +0100
@@ -961,7 +961,7 @@
* (which "should not happen").
*
******************************************************************************/
-
+#ifdef ACPI_FUTURE_USAGE
acpi_name
acpi_ns_find_parent_name (
struct acpi_namespace_node *child_node)
@@ -994,6 +994,7 @@

return_VALUE (ACPI_UNKNOWN_NAME);
}
+#endif


/*******************************************************************************
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/namespace/nsxfeval.c.old 2004-11-10 00:02:29.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/namespace/nsxfeval.c 2004-11-10 00:03:10.000000000 +0100
@@ -73,7 +73,7 @@
* be valid (non-null)
*
******************************************************************************/
-
+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_evaluate_object_typed (
acpi_handle handle,
@@ -144,6 +144,7 @@
return_buffer->length = 0;
return_ACPI_STATUS (AE_TYPE);
}
+#endif /* ACPI_FUTURE_USAGE */


/*******************************************************************************
--- linux-2.6.10-rc1-mm4-full/include/acpi/acpiosxf.h.old 2004-11-10 00:07:23.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/include/acpi/acpiosxf.h 2004-11-10 00:09:31.000000000 +0100
@@ -176,10 +176,12 @@
void __iomem *logical_address,
acpi_size size);

+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_os_get_physical_address (
void *logical_address,
acpi_physical_address *physical_address);
+#endif


/*
@@ -302,10 +304,12 @@
void *pointer,
acpi_size length);

+#ifdef ACPI_FUTURE_USAGE
u8
acpi_os_writable (
void *pointer,
acpi_size length);
+#endif

u64
acpi_os_get_timer (
@@ -339,9 +343,11 @@
* Debug input
*/

+#ifdef ACPI_FUTURE_USAGE
u32
acpi_os_get_line (
char *buffer);
+#endif


/*
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/osl.c.old 2004-11-10 00:06:09.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/osl.c 2004-11-10 00:09:12.000000000 +0100
@@ -211,6 +211,7 @@
iounmap(virt);
}

+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_os_get_physical_address(void *virt, acpi_physical_address *phys)
{
@@ -221,6 +222,7 @@

return AE_OK;
}
+#endif

#define ACPI_MAX_OVERRIDE_LEN 100

@@ -989,6 +991,7 @@
}
EXPORT_SYMBOL(acpi_os_signal_semaphore);

+#ifdef ACPI_FUTURE_USAGE
u32
acpi_os_get_line(char *buffer)
{
@@ -1007,6 +1010,7 @@

return 0;
}
+#endif /* ACPI_FUTURE_USAGE */

/* Assumes no unreadable holes inbetween */
u8
@@ -1019,6 +1023,7 @@
return 1;
}

+#ifdef ACPI_FUTURE_USAGE
u8
acpi_os_writable(void *ptr, acpi_size len)
{
@@ -1026,6 +1031,7 @@
The later may be difficult at early boot when kmap doesn't work yet. */
return 1;
}
+#endif

u32
acpi_os_get_thread_id (void)
--- linux-2.6.10-rc1-mm4-full/include/acpi/acparser.h.old 2004-11-10 00:13:14.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/include/acpi/acparser.h 2004-11-10 00:15:57.000000000 +0100
@@ -247,6 +247,7 @@
union acpi_parse_object *op,
u32 argn);

+#ifdef ACPI_FUTURE_USAGE
union acpi_parse_object *
acpi_ps_get_child (
union acpi_parse_object *op);
@@ -255,6 +256,7 @@
acpi_ps_get_depth_next (
union acpi_parse_object *origin,
union acpi_parse_object *op);
+#endif /* ACPI_FUTURE_USAGE */


/* pswalk - parse tree walk routines */
@@ -313,9 +315,11 @@
acpi_ps_is_prefix_char (
u32 c);

+#ifdef ACPI_FUTURE_USAGE
u32
acpi_ps_get_name(
union acpi_parse_object *op);
+#endif

void
acpi_ps_set_name(
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/parser/pstree.c.old 2004-11-10 00:13:48.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/parser/pstree.c 2004-11-10 00:14:57.000000000 +0100
@@ -181,6 +181,8 @@
}


+#ifdef ACPI_FUTURE_USAGE
+
/*******************************************************************************
*
* FUNCTION: acpi_ps_get_child
@@ -192,7 +194,6 @@
* DESCRIPTION: Get op's children or NULL if none
*
******************************************************************************/
-
union acpi_parse_object *
acpi_ps_get_child (
union acpi_parse_object *op)
@@ -322,4 +323,5 @@
return (next);
}

+#endif /* ACPI_FUTURE_USAGE */

--- linux-2.6.10-rc1-mm4-full/drivers/acpi/parser/psutils.c.old 2004-11-10 00:16:07.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/parser/psutils.c 2004-11-10 00:16:28.000000000 +0100
@@ -267,6 +267,7 @@
/*
* Get op's name (4-byte name segment) or 0 if unnamed
*/
+#ifdef ACPI_FUTURE_USAGE
u32
acpi_ps_get_name (
union acpi_parse_object *op)
@@ -283,6 +284,7 @@

return (op->named.name);
}
+#endif /* ACPI_FUTURE_USAGE */


/*
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/pci_bind.c.old 2004-11-10 00:18:17.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/pci_bind.c 2004-11-10 00:22:00.000000000 +0100
@@ -67,6 +67,7 @@
* to resolve PCI information for ACPI-PCI devices defined in the namespace.
* This typically occurs when resolving PCI operation region information.
*/
+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_os_get_pci_id (
acpi_handle handle,
@@ -114,6 +115,7 @@

return_ACPI_STATUS(AE_OK);
}
+#endif /* ACPI_FUTURE_USAGE */


int
--- linux-2.6.10-rc1-mm4-full/include/acpi/acresrc.h.old 2004-11-10 02:02:19.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/include/acpi/acresrc.h 2004-11-10 01:59:58.000000000 +0100
@@ -60,10 +60,12 @@
acpi_handle handle,
struct acpi_buffer *ret_buffer);

+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_rs_get_prs_method_data (
acpi_handle handle,
struct acpi_buffer *ret_buffer);
+#endif

acpi_status
acpi_rs_get_method_data (
@@ -95,6 +97,7 @@
/*
* Function prototypes called from acpi_rs_create*
*/
+#ifdef ACPI_FUTURE_USAGE
void
acpi_rs_dump_irq (
union acpi_resource_data *data);
@@ -154,6 +157,7 @@
void
acpi_rs_dump_irq_list (
u8 *route_table);
+#endif /* ACPI_FUTURE_USAGE */

acpi_status
acpi_rs_get_byte_stream_start (
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/resources/rsxface.c.old 2004-11-10 00:32:09.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/resources/rsxface.c 2004-11-10 00:32:32.000000000 +0100
@@ -180,7 +180,7 @@
* and the value of ret_buffer is undefined.
*
******************************************************************************/
-
+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_get_possible_resources (
acpi_handle device_handle,
@@ -211,6 +211,7 @@
return_ACPI_STATUS (status);
}
EXPORT_SYMBOL(acpi_get_possible_resources);
+#endif /* ACPI_FUTURE_USAGE */


/*******************************************************************************
--- linux-2.6.10-rc1-mm4-full/include/acpi/actables.h.old 2004-11-10 00:37:23.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/include/acpi/actables.h 2004-11-10 00:37:41.000000000 +0100
@@ -50,10 +50,12 @@
#define SIZE_IN_HEADER 0


+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_tb_handle_to_object (
u16 table_id,
struct acpi_table_desc **table_desc);
+#endif

/*
* tbconvrt - Table conversion routines
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/tables/tbutils.c.old 2004-11-10 00:37:51.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/tables/tbutils.c 2004-11-10 00:38:30.000000000 +0100
@@ -62,7 +62,7 @@
* return a pointer to that table descriptor.
*
******************************************************************************/
-
+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_tb_handle_to_object (
u16 table_id,
@@ -90,6 +90,7 @@
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "table_id=%X does not exist\n", table_id));
return (AE_BAD_PARAMETER);
}
+#endif /* ACPI_FUTURE_USAGE */


/*******************************************************************************
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/tables/tbxface.c.old 2004-11-10 00:39:15.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/tables/tbxface.c 2004-11-10 00:45:05.000000000 +0100
@@ -138,6 +138,8 @@
}


+#ifdef ACPI_FUTURE_USAGE
+
/*******************************************************************************
*
* FUNCTION: acpi_load_table
@@ -344,6 +346,8 @@
}


+#endif /* ACPI_FUTURE_USAGE */
+
/*******************************************************************************
*
* FUNCTION: acpi_get_table
--- linux-2.6.10-rc1-mm4-full/include/acpi/acutils.h.old 2004-11-10 00:47:57.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/include/acpi/acutils.h 2004-11-10 01:23:29.000000000 +0100
@@ -666,12 +666,14 @@
u16 action,
union acpi_generic_state **state_list);

+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_ut_create_pkg_state_and_push (
void *internal_object,
void *external_object,
u16 index,
union acpi_generic_state **state_list);
+#endif

union acpi_generic_state *
acpi_ut_create_control_state (
@@ -730,9 +732,11 @@

#define ACPI_ANY_BASE 0

+#ifdef ACPI_FUTURE_USAGE
char *
acpi_ut_strupr (
char *src_string);
+#endif

u8 *
acpi_ut_get_resource_end_tag (
@@ -851,9 +855,11 @@
char *module,
u32 line);

+#ifdef ACPI_FUTURE_USAGE
void
acpi_ut_dump_allocation_info (
void);
+#endif

void
acpi_ut_dump_allocations (
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/utilities/utalloc.c.old 2004-11-10 01:18:42.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/utilities/utalloc.c 2004-11-10 01:07:33.000000000 +0100
@@ -818,7 +818,7 @@
* DESCRIPTION: Print some info about the outstanding allocations.
*
******************************************************************************/
-
+#ifdef ACPI_FUTURE_USAGE
void
acpi_ut_dump_allocation_info (
void)
@@ -864,6 +864,7 @@
*/
return_VOID;
}
+#endif /* ACPI_FUTURE_USAGE */


/*******************************************************************************
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/utilities/utmisc.c.old 2004-11-10 01:23:39.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/utilities/utmisc.c 2004-11-10 01:24:00.000000000 +0100
@@ -488,7 +488,7 @@
* DESCRIPTION: Convert string to uppercase
*
******************************************************************************/
-
+#ifdef ACPI_FUTURE_USAGE
char *
acpi_ut_strupr (
char *src_string)
@@ -508,6 +508,7 @@

return (src_string);
}
+#endif /* ACPI_FUTURE_USAGE */


/*******************************************************************************
--- linux-2.6.10-rc1-mm4-full/include/acpi/platform/acenv.h.old 2004-11-10 01:22:23.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/include/acpi/platform/acenv.h 2004-11-10 01:23:01.000000000 +0100
@@ -223,7 +223,11 @@
*/

#define ACPI_STRSTR(s1,s2) strstr((s1), (s2))
+
+#ifdef ACPI_FUTURE_USAGE
#define ACPI_STRUPR(s) (void) acpi_ut_strupr ((s))
+#endif
+
#define ACPI_STRLEN(s) (acpi_size) strlen((s))
#define ACPI_STRCPY(d,s) (void) strcpy((d), (s))
#define ACPI_STRNCPY(d,s,n) (void) strncpy((d), (s), (acpi_size)(n))
@@ -287,7 +291,11 @@


#define ACPI_STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2))
+
+#ifdef ACPI_FUTURE_USAGE
#define ACPI_STRUPR(s) (void) acpi_ut_strupr ((s))
+#endif
+
#define ACPI_STRLEN(s) (acpi_size) acpi_ut_strlen ((s))
#define ACPI_STRCPY(d,s) (void) acpi_ut_strcpy ((d), (s))
#define ACPI_STRNCPY(d,s,n) (void) acpi_ut_strncpy ((d), (s), (acpi_size)(n))
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/utilities/utxface.c.old 2004-11-10 01:25:34.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/utilities/utxface.c 2004-11-10 01:28:11.000000000 +0100
@@ -343,6 +343,8 @@
}


+#ifdef ACPI_FUTURE_USAGE
+
/*****************************************************************************
*
* FUNCTION: acpi_subsystem_status
@@ -491,6 +493,8 @@
return AE_OK;
}

+#endif /* ACPI_FUTURE_USAGE */
+

/*****************************************************************************
*
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/resources/Makefile.old 2004-11-10 00:29:46.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/resources/Makefile 2004-11-10 00:30:37.000000000 +0100
@@ -3,6 +3,8 @@
#

obj-y := rsaddr.o rscreate.o rsio.o rslist.o rsmisc.o rsxface.o \
- rscalc.o rsdump.o rsirq.o rsmemory.o rsutils.o
+ rscalc.o rsirq.o rsmemory.o rsutils.o
+
+obj-$(ACPI_FUTURE_USAGE) += rsdump.o

EXTRA_CFLAGS += $(ACPI_CFLAGS)
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/hardware/hwgpe.c.old 2004-11-10 01:56:43.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/hardware/hwgpe.c 2004-11-10 01:57:18.000000000 +0100
@@ -135,7 +135,7 @@
* DESCRIPTION: Return the status of a single GPE.
*
******************************************************************************/
-
+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_hw_get_gpe_status (
struct acpi_gpe_event_info *gpe_event_info,
@@ -194,6 +194,7 @@
unlock_and_exit:
return (status);
}
+#endif /* ACPI_FUTURE_USAGE */


/******************************************************************************
--- linux-2.6.10-rc1-mm4-full/drivers/acpi/resources/rsutils.c.old 2004-11-10 02:00:10.000000000 +0100
+++ linux-2.6.10-rc1-mm4-full/drivers/acpi/resources/rsutils.c 2004-11-10 02:00:33.000000000 +0100
@@ -175,7 +175,7 @@
* and the contents of the callers buffer is undefined.
*
******************************************************************************/
-
+#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_rs_get_prs_method_data (
acpi_handle handle,
@@ -210,6 +210,7 @@
acpi_ut_remove_reference (obj_desc);
return_ACPI_STATUS (status);
}
+#endif /* ACPI_FUTURE_USAGE */


/*******************************************************************************

2004-11-11 11:19:54

by Pavel Machek

[permalink] [raw]
Subject: Re: [2.6 patch] drivers/acpi: remove unused exported functions

Hi!

> > The patch below completely removes 7 functions that were
> > EXPORT_SYMBOL'ed but had exactly zero users in the kernel and makes
> > another one that was previously EXPORT_SYMBOL'ed static.
> >
> > It also removes another unused global function to completely remove
> > drivers/acpi/hardware/hwtimer.c which contained no function used
> > anywhere in the kernel.
> >
> > Please comment on whether this patch is correct or whether in-kernel
> > users of these functions are pending.
> >
> >
> > diffstat output:
> > drivers/acpi/acpi_ksyms.c | 8 -
> > drivers/acpi/events/evxfevnt.c | 191 -----------------------------
> > drivers/acpi/hardware/Makefile | 2
> > drivers/acpi/hardware/hwtimer.c | 200
> > -------------------------------
> > drivers/acpi/resources/rsxface.c | 52 --------
> > drivers/acpi/scan.c | 6
> > drivers/acpi/utilities/utxface.c | 89 -------------
> > include/acpi/achware.h | 17 --
> > include/acpi/acpi_bus.h | 1
> > include/acpi/acpixf.h | 24 ---
> > 10 files changed, 6 insertions(+), 584 deletions(-)
>
> No, I can't apply this one as-is.
> Some of these routines are not called now
> simply because Linux/ACPI is evolving and we don't
> yet take advantage of some of the things supported
> by ACPICA core we use.

I believe right thing to do is remove them now, and re-add them later
(if they are ever needed).

Single line patch somewhere which happens to pull whole evxfevnt.c
would be pretty "expensive", but would not certainly look so...

Pavel
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

2004-11-11 15:21:26

by Matthew Wilcox

[permalink] [raw]
Subject: Re: [ACPI] [2.6 patch] drivers/acpi: #ifdef unused functions away

On Wed, Nov 10, 2004 at 02:21:34AM +0100, Adrian Bunk wrote:
> This patch only #ifdef's completely unused code away - it does not make
> the many global functions only used inside the file they are defined in
> static.

It also ifdefs out the acpi_install_gpe_handler and acpi_remove_gpe_handler
calls I use in the driver I posted on Sunday. Please fix this.

--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain

2004-11-11 15:39:41

by Adrian Bunk

[permalink] [raw]
Subject: Re: [ACPI] [2.6 patch] drivers/acpi: #ifdef unused functions away

On Thu, Nov 11, 2004 at 03:17:27PM +0000, Matthew Wilcox wrote:
> On Wed, Nov 10, 2004 at 02:21:34AM +0100, Adrian Bunk wrote:
> > This patch only #ifdef's completely unused code away - it does not make
> > the many global functions only used inside the file they are defined in
> > static.
>
> It also ifdefs out the acpi_install_gpe_handler and acpi_remove_gpe_handler
> calls I use in the driver I posted on Sunday. Please fix this.

????

My patch doesn't #ifdef these functions away.


cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2004-11-11 15:43:45

by Matthew Wilcox

[permalink] [raw]
Subject: Re: [ACPI] [2.6 patch] drivers/acpi: #ifdef unused functions away

On Thu, Nov 11, 2004 at 04:36:50PM +0100, Adrian Bunk wrote:
> On Thu, Nov 11, 2004 at 03:17:27PM +0000, Matthew Wilcox wrote:
> > On Wed, Nov 10, 2004 at 02:21:34AM +0100, Adrian Bunk wrote:
> > > This patch only #ifdef's completely unused code away - it does not make
> > > the many global functions only used inside the file they are defined in
> > > static.
> >
> > It also ifdefs out the acpi_install_gpe_handler and acpi_remove_gpe_handler
> > calls I use in the driver I posted on Sunday. Please fix this.
>
> ????
>
> My patch doesn't #ifdef these functions away.

Sorry, acpi_remove_gpe_block, not acpi_remove_gpe_handler:

@@ -383,6 +398,7 @@
acpi_status
acpi_remove_gpe_block (
acpi_handle gpe_device);
+#endif /* ACPI_FUTURE_USAGE */

--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain

2004-11-11 15:49:51

by Adrian Bunk

[permalink] [raw]
Subject: Re: [ACPI] [2.6 patch] drivers/acpi: #ifdef unused functions away

On Thu, Nov 11, 2004 at 03:40:17PM +0000, Matthew Wilcox wrote:
> On Thu, Nov 11, 2004 at 04:36:50PM +0100, Adrian Bunk wrote:
> > On Thu, Nov 11, 2004 at 03:17:27PM +0000, Matthew Wilcox wrote:
> > > On Wed, Nov 10, 2004 at 02:21:34AM +0100, Adrian Bunk wrote:
> > > > This patch only #ifdef's completely unused code away - it does not make
> > > > the many global functions only used inside the file they are defined in
> > > > static.
> > >
> > > It also ifdefs out the acpi_install_gpe_handler and acpi_remove_gpe_handler
> > > calls I use in the driver I posted on Sunday. Please fix this.
> >
> > ????
> >
> > My patch doesn't #ifdef these functions away.
>
> Sorry, acpi_remove_gpe_block, not acpi_remove_gpe_handler:
>
> @@ -383,6 +398,7 @@
> acpi_status
> acpi_remove_gpe_block (
> acpi_handle gpe_device);
> +#endif /* ACPI_FUTURE_USAGE */

I didn't saw your patch on linux-kernel, and although Len has said that
he'd apply my patches I have yet to hear an answer indicating either
problems in my patches or that he'd applied them.

Did Len already integrate your driver into his tree?

If yes, I will correct the acpi_remove_gpe_block case (it's only this
one function?) as soon as his tree appears in the next -mm.

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2004-11-11 16:10:20

by Matthew Wilcox

[permalink] [raw]
Subject: Re: [ACPI] [2.6 patch] drivers/acpi: #ifdef unused functions away

On Thu, Nov 11, 2004 at 04:46:56PM +0100, Adrian Bunk wrote:
> I didn't saw your patch on linux-kernel

I didn't send it to linux-kernel; only acpi-devel and linux-ia64.

> Did Len already integrate your driver into his tree?

No, I just sent him a reminder today.

> If yes, I will correct the acpi_remove_gpe_block case (it's only this
> one function?) as soon as his tree appears in the next -mm.

acpi_remove_gpe_block and acpi_install_gpe_block.

--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain

2004-11-11 19:19:56

by Brown, Len

[permalink] [raw]
Subject: Re: [ACPI] [2.6 patch] drivers/acpi: #ifdef unused functions away

On Thu, 2004-11-11 at 11:08, Matthew Wilcox wrote:
> On Thu, Nov 11, 2004 at 04:46:56PM +0100, Adrian Bunk wrote:

> > If yes, I will correct the acpi_remove_gpe_block case (it's only
> this
> > one function?) as soon as his tree appears in the next -mm.
>
> acpi_remove_gpe_block and acpi_install_gpe_block.

No problem, both of these patches are on my list for today and I'll fix
this minor conflict.

thanks,
-Len



2004-11-12 04:58:25

by Brown, Len

[permalink] [raw]
Subject: Re: [2.6 patch] kill acpi_ksyms.c

Applied.

thanks,
-Len

On Mon, 2004-11-08 at 20:40, Adrian Bunk wrote:
...
> Below is as a preparation a patch that removes acpi_ksyms.c .
>
> It shouldn't make any practical difference.
>
> The function acpi_db_user_commands that wasn't available in the whole
> kernel sources was EXPORT_SYMBOL'ed. The patch removes this bogus
> export.
>
>
> diffstat output:
> drivers/acpi/Makefile | 2
> drivers/acpi/acpi_ksyms.c | 165
> ------------------------------
> drivers/acpi/bus.c | 10 +
> drivers/acpi/ec.c | 2
> drivers/acpi/events/evxface.c | 10 +
> drivers/acpi/events/evxfevnt.c | 8 +
> drivers/acpi/events/evxfregn.c | 4
> drivers/acpi/hardware/hwregs.c | 4
> drivers/acpi/hardware/hwsleep.c | 4
> drivers/acpi/hardware/hwtimer.c | 5
> drivers/acpi/namespace/nsxfeval.c | 4
> drivers/acpi/namespace/nsxfname.c | 4
> drivers/acpi/namespace/nsxfobj.c | 5
> drivers/acpi/osl.c | 18 +++
> drivers/acpi/pci_irq.c | 2
> drivers/acpi/pci_root.c | 2
> drivers/acpi/resources/rsxface.c | 7 +
> drivers/acpi/scan.c | 6 -
> drivers/acpi/tables/tbconvrt.c | 2
> drivers/acpi/tables/tbxface.c | 3
> drivers/acpi/tables/tbxfroot.c | 2
> drivers/acpi/utilities/utdebug.c | 7 +
> drivers/acpi/utilities/utglobal.c | 4
> drivers/acpi/utilities/utxface.c | 2
> drivers/acpi/utils.c | 4
> include/acpi/acdebug.h | 5
> 26 files changed, 112 insertions(+), 179 deletions(-)