drivers/acpi/: possible cleanups
Subsystems (4)
RFC PATCH 1/1 drivers/acpi/: possible cleanups
Before I'm getting flamed to death:
This patch isn't meant for being immediately applied.
This patch makes all needlessly global code under drivers/acpi/ static. Please review this patch.
---
drivers/acpi/ac.c | 18 ++--- drivers/acpi/battery.c | 2 drivers/acpi/button.c | 4 - drivers/acpi/container.c | 4 - drivers/acpi/debug.c | 4 - drivers/acpi/dispatcher/dsfield.c | 2 drivers/acpi/dispatcher/dsinit.c | 2 drivers/acpi/dispatcher/dsmthdat.c | 10 ++- drivers/acpi/dispatcher/dsobject.c | 2 drivers/acpi/dispatcher/dsopcode.c | 4 - drivers/acpi/dispatcher/dswload.c | 12 +++ drivers/acpi/ec.c | 2 drivers/acpi/events/evevent.c | 11 ++- drivers/acpi/events/evgpe.c | 6 + drivers/acpi/events/evregion.c | 11 ++- drivers/acpi/executer/exconfig.c | 2 drivers/acpi/executer/exconvrt.c | 2 drivers/acpi/executer/exfldio.c | 8 +- drivers/acpi/executer/exmutex.c | 2 drivers/acpi/executer/exnames.c | 4 - drivers/acpi/executer/exoparg6.c | 2 drivers/acpi/executer/exresolv.c | 6 + drivers/acpi/executer/exresop.c | 2 drivers/acpi/executer/exstore.c | 7 +- drivers/acpi/executer/exutils.c | 2 drivers/acpi/fan.c | 14 ++-- drivers/acpi/hardware/hwgpe.c | 2 drivers/acpi/ibm_acpi.c | 4 - drivers/acpi/namespace/nsalloc.c | 2 drivers/acpi/namespace/nseval.c | 11 ++- drivers/acpi/namespace/nsinit.c | 17 ++++- drivers/acpi/namespace/nsload.c | 2 drivers/acpi/namespace/nsnames.c | 2 drivers/acpi/namespace/nsparse.c | 2 drivers/acpi/namespace/nsutils.c | 14 +++- drivers/acpi/osl.c | 10 +-- drivers/acpi/parser/psargs.c | 4 - drivers/acpi/parser/psopcode.c | 2 drivers/acpi/parser/psparse.c | 8 +- drivers/acpi/parser/pswalk.c | 4 - drivers/acpi/pci_bind.c | 6 + drivers/acpi/pci_irq.c | 4 - drivers/acpi/power.c | 10 +-- drivers/acpi/processor_core.c | 6 - drivers/acpi/processor_thermal.c | 2 drivers/acpi/processor_throttling.c | 2 drivers/acpi/scan.c | 12 ++- drivers/acpi/tables/tbget.c | 14 +++- drivers/acpi/tables/tbgetall.c | 4 - drivers/acpi/tables/tbxfroot.c | 8 +- drivers/acpi/thermal.c | 2 drivers/acpi/toshiba_acpi.c | 2 drivers/acpi/utilities/utalloc.c | 23 ++++++- drivers/acpi/utilities/utcopy.c | 10 +-- drivers/acpi/utilities/utdelete.c | 2 drivers/acpi/utilities/utinit.c | 2 drivers/acpi/utilities/utmisc.c | 19 ++++- drivers/acpi/utilities/utobject.c | 6 - drivers/acpi/video.c | 2 include/acpi/acdispat.h | 57 ----------------- include/acpi/acevents.h | 27 -------- include/acpi/achware.h | 5 - include/acpi/acinterp.h | 79 ------------------------ include/acpi/acnamesp.h | 61 ------------------ include/acpi/acparser.h | 37 ----------- include/acpi/acpi_bus.h | 1 include/acpi/acpi_drivers.h | 1 include/acpi/actables.h | 32 --------- include/acpi/acutils.h | 92 ---------------------------- include/acpi/processor.h | 2 include/linux/acpi.h | 2 71 files changed, 241 insertions(+), 520 deletions(-)
drivers/acpi/ac.c renamed from drivers/acpi/ac.c.old +9 -9
@@ -51,8 +51,8 @@MODULE_DESCRIPTION (ACPI_AC_DRIVER_NAME );MODULE_LICENSE ("GPL" ); -int acpi_ac_add (struct acpi_device *device); -int acpi_ac_remove (struct acpi_device *device,int type); +static int acpi_ac_add (struct acpi_device *device); +static int acpi_ac_remove (struct acpi_device *device,int type);static int acpi_ac_open_fs (struct inode *inode,struct file *file);static struct acpi_driver acpi_ac_driver = {
@@ -108,9 +108,9 @@FS Interface (/proc) -------------------------------------------------------------------------- */ -struct proc_dir_entry *acpi_ac_dir; +static struct proc_dir_entry *acpi_ac_dir; -int acpi_ac_seq_show (struct seq_file *seq,void *offset) +static int acpi_ac_seq_show (struct seq_file *seq,void *offset) {struct acpi_ac *ac = (struct acpi_ac *) seq->private;
@@ -200,7 +200,7 @@Driver Model -------------------------------------------------------------------------- */ -void +static void acpi_ac_notify ( acpi_handle handle, u32 event,
@@ -232,7 +232,7 @@ } -int +static int acpi_ac_add (struct acpi_device *device) {
@@ -286,7 +286,7 @@ } -int +static int acpi_ac_remove (struct acpi_device *device,int type)
@@ -315,7 +315,7 @@ } -int __init +static int __init acpi_ac_init (void ) {int result =0 ;
@@ -337,7 +337,7 @@ } -void __exit +static void __exitacpi_ac_exit (void ) {ACPI_FUNCTION_TRACE ("acpi_ac_exit" );
drivers/acpi/battery.c renamed from drivers/acpi/battery.c.old +1 -1
@@ -341,7 +341,7 @@FS Interface (/proc) -------------------------------------------------------------------------- */ -struct proc_dir_entry *acpi_battery_dir; +static struct proc_dir_entry *acpi_battery_dir;static int acpi_battery_read_info (struct seq_file *seq,void *offset) {int result =0 ;
drivers/acpi/button.c renamed from drivers/acpi/button.c.old +2 -2
@@ -275,7 +275,7 @@Driver Interface -------------------------------------------------------------------------- */ -void +static void acpi_button_notify ( acpi_handle handle, u32 event,
@@ -302,7 +302,7 @@ } -acpi_status +static acpi_status acpi_button_notify_fixed (void *data) {
drivers/acpi/container.c renamed from drivers/acpi/container.c.old +2 -2
@@ -255,7 +255,7 @@ } -int __init +static int __init acpi_container_init (void ) {int result =0 ;
@@ -276,7 +276,7 @@return (0 ); } -void __exit +static void __exitacpi_container_exit (void ) {int action =UNINSTALL_NOTIFY_HANDLER ;
drivers/acpi/debug.c renamed from drivers/acpi/debug.c.old +2 -2
@@ -35,7 +35,7 @@ };#define ACPI_DEBUG_INIT (v) { .name = #v, .value = v } -const struct acpi_dlayer acpi_debug_layers[] = +static const struct acpi_dlayer acpi_debug_layers[] = {ACPI_DEBUG_INIT (ACPI_UTILITIES ),ACPI_DEBUG_INIT (ACPI_HARDWARE ),
@@ -53,7 +53,7 @@ ACPI_DEBUG_INIT(ACPI_TOOLS), }; -const struct acpi_dlevel acpi_debug_levels[] = +static const struct acpi_dlevel acpi_debug_levels[] = {ACPI_DEBUG_INIT (ACPI_LV_ERROR ),ACPI_DEBUG_INIT (ACPI_LV_WARN ),
include/acpi/acdispat.h renamed from include/acpi/acdispat.h.old +0 -57
105 lines not on this page · raw message
drivers/acpi/dispatcher/dsfield.c renamed from drivers/acpi/dispatcher/dsfield.c.old +1 -1
@@ -205,7 +205,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ds_get_field_names ( struct acpi_create_field_info *info, struct acpi_walk_state *walk_state,
drivers/acpi/dispatcher/dsinit.c renamed from drivers/acpi/dispatcher/dsinit.c.old +1 -1
@@ -70,7 +70,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ds_init_one_object ( acpi_handle obj_handle, u32 level,
drivers/acpi/dispatcher/dsmthdat.c renamed from drivers/acpi/dispatcher/dsmthdat.c.old +8 -2
@@ -52,6 +52,12 @@#define _COMPONENT ACPI_DISPATCHER ACPI_MODULE_NAME ("dsmthdat") +static acpi_status +acpi_ds_method_data_set_value ( +u16 opcode, +u32 index, +union acpi_operand_object *object, +struct acpi_walk_state *walk_state);/******************************************************************************* *
@@ -297,7 +303,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ds_method_data_set_value ( u16 opcode, u32 index,
@@ -511,7 +517,7 @@* ******************************************************************************/ -void +static void acpi_ds_method_data_delete_value ( u16 opcode, u32 index,
drivers/acpi/dispatcher/dsobject.c renamed from drivers/acpi/dispatcher/dsobject.c.old +1 -1
@@ -69,7 +69,7 @@* ****************************************************************************/ -acpi_status +static acpi_status acpi_ds_build_internal_object ( struct acpi_walk_state *walk_state, union acpi_parse_object *op,
drivers/acpi/dispatcher/dsopcode.c renamed from drivers/acpi/dispatcher/dsopcode.c.old +2 -2
@@ -69,7 +69,7 @@* ****************************************************************************/ -acpi_status +static acpi_status acpi_ds_execute_arguments ( struct acpi_namespace_node *node, struct acpi_namespace_node *scope_node,
@@ -399,7 +399,7 @@* ****************************************************************************/ -acpi_status +static acpi_status acpi_ds_init_buffer_field ( u16 aml_opcode, union acpi_operand_object *obj_desc,
drivers/acpi/dispatcher/dswload.c renamed from drivers/acpi/dispatcher/dswload.c.old +10 -2
@@ -57,6 +57,14 @@#define _COMPONENT ACPI_DISPATCHER ACPI_MODULE_NAME ("dswload") +static acpi_status +acpi_ds_load1_begin_op ( +struct acpi_walk_state *walk_state, +union acpi_parse_object **out_op); + +static acpi_status +acpi_ds_load1_end_op ( +struct acpi_walk_state *walk_state);/******************************************************************************* *
@@ -120,7 +128,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ds_load1_begin_op (struct acpi_walk_state *walk_state,union acpi_parse_object **out_op)
@@ -345,7 +353,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ds_load1_end_op (struct acpi_walk_state *walk_state) {
drivers/acpi/ec.c renamed from drivers/acpi/ec.c.old +1 -1
@@ -514,7 +514,7 @@FS Interface (/proc) -------------------------------------------------------------------------- */ -struct proc_dir_entry *acpi_ec_dir; +static struct proc_dir_entry *acpi_ec_dir; static int
include/acpi/acevents.h renamed from include/acpi/acevents.h.old +0 -27
@@ -58,18 +58,10 @@* Evfixed - Fixed event handling */ -acpi_status -acpi_ev_fixed_event_initialize ( -void ); -u32 acpi_ev_fixed_event_detect (void ); -u32 -acpi_ev_fixed_event_dispatch ( -u32 event); -/* * Evmisc
@@ -160,11 +152,6 @@ struct acpi_gpe_block_info *gpe_block);u32 -acpi_ev_gpe_dispatch ( -struct acpi_gpe_event_info *gpe_event_info, -u32 gpe_number); - -u32 acpi_ev_gpe_detect (struct acpi_gpe_xrupt_info *gpe_xrupt_list);
@@ -198,13 +185,6 @@ void *value); acpi_status -acpi_ev_install_handler ( -acpi_handle obj_handle, -u32 level, -void *context, -void **return_value); - -acpi_status acpi_ev_attach_region ( union acpi_operand_object *handler_obj, union acpi_operand_object *region_obj,
@@ -233,13 +213,6 @@union acpi_operand_object *region_obj, u32 function); -acpi_status -acpi_ev_reg_run ( -acpi_handle obj_handle, -u32 level, -void *context, -void **return_value); -/* * Evregini - Region initialization and setup */
drivers/acpi/events/evevent.c renamed from drivers/acpi/events/evevent.c.old +9 -2
@@ -47,6 +47,13 @@#define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evevent") +static u32 +acpi_ev_fixed_event_dispatch ( +u32 event); + +static acpi_status +acpi_ev_fixed_event_initialize ( +void );/******************************************************************************* *
@@ -161,7 +168,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ev_fixed_event_initialize (void ) {
@@ -259,7 +266,7 @@* ******************************************************************************/ -u32 +static u32 acpi_ev_fixed_event_dispatch (u32 event) {
drivers/acpi/events/evgpe.c renamed from drivers/acpi/events/evgpe.c.old +5 -1
@@ -48,6 +48,10 @@#define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evgpe") +static u32 +acpi_ev_gpe_dispatch ( +struct acpi_gpe_event_info *gpe_event_info, +u32 gpe_number);/******************************************************************************* *
@@ -587,7 +591,7 @@* ******************************************************************************/ -u32 +static u32 acpi_ev_gpe_dispatch (struct acpi_gpe_event_info *gpe_event_info,u32 gpe_number)
drivers/acpi/events/evregion.c renamed from drivers/acpi/events/evregion.c.old +9 -2
@@ -52,6 +52,13 @@#define ACPI_NUM_DEFAULT_SPACES 4 +static acpi_status +acpi_ev_reg_run ( +acpi_handle obj_handle, +u32 level, +void *context, +void **return_value); +static u8 acpi_gbl_default_address_spaces[ACPI_NUM_DEFAULT_SPACES ] = {ACPI_ADR_SPACE_SYSTEM_MEMORY ,ACPI_ADR_SPACE_SYSTEM_IO ,
@@ -621,7 +628,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ev_install_handler ( acpi_handle obj_handle, u32 level,
@@ -1011,7 +1018,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ev_reg_run ( acpi_handle obj_handle, u32 level,
include/acpi/acinterp.h renamed from include/acpi/acinterp.h.old +0 -79
150 lines not on this page · raw message
drivers/acpi/executer/exconfig.c renamed from drivers/acpi/executer/exconfig.c.old +1 -1
@@ -70,7 +70,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ex_add_table ( struct acpi_table_header *table, struct acpi_namespace_node *parent_node,
drivers/acpi/executer/exconvrt.c renamed from drivers/acpi/executer/exconvrt.c.old +1 -1
@@ -285,7 +285,7 @@* ******************************************************************************/ -u32 +static u32 acpi_ex_convert_to_ascii ( acpi_integer integer, u16 base,
drivers/acpi/executer/exfldio.c renamed from drivers/acpi/executer/exfldio.c.old +4 -4
@@ -69,7 +69,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ex_setup_region (union acpi_operand_object *obj_desc,u32 field_datum_byte_offset)
@@ -287,7 +287,7 @@* ******************************************************************************/ -u8 +static u8 acpi_ex_register_overflow (union acpi_operand_object *obj_desc,acpi_integer value)
@@ -333,7 +333,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ex_field_datum_io ( union acpi_operand_object *obj_desc, u32 field_datum_byte_offset,
@@ -524,7 +524,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ex_write_with_update_rule ( union acpi_operand_object *obj_desc, acpi_integer mask,
drivers/acpi/executer/exmutex.c renamed from drivers/acpi/executer/exmutex.c.old +1 -1
@@ -101,7 +101,7 @@* ******************************************************************************/ -void +static void acpi_ex_link_mutex (union acpi_operand_object *obj_desc,struct acpi_thread_state *thread)
drivers/acpi/executer/exnames.c renamed from drivers/acpi/executer/exnames.c.old +2 -2
@@ -75,7 +75,7 @@* ******************************************************************************/ -char * +static char *acpi_ex_allocate_name_string (u32 prefix_count,u32 num_name_segs)
@@ -160,7 +160,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ex_name_segment (u8 **in_aml_address,char *name_string)
drivers/acpi/executer/exoparg6.c renamed from drivers/acpi/executer/exoparg6.c.old +1 -1
@@ -90,7 +90,7 @@* ******************************************************************************/ -u8 +static u8 acpi_ex_do_match ( u32 match_op, acpi_integer package_value,
drivers/acpi/executer/exresolv.c renamed from drivers/acpi/executer/exresolv.c.old +5 -1
@@ -54,6 +54,10 @@#define _COMPONENT ACPI_EXECUTER ACPI_MODULE_NAME ("exresolv") +static acpi_status +acpi_ex_resolve_object_to_value ( +union acpi_operand_object **stack_ptr, +struct acpi_walk_state *walk_state);/******************************************************************************* *
@@ -131,7 +135,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ex_resolve_object_to_value (union acpi_operand_object **stack_ptr,struct acpi_walk_state *walk_state)
drivers/acpi/executer/exresop.c renamed from drivers/acpi/executer/exresop.c.old +1 -1
@@ -67,7 +67,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ex_check_object_type ( acpi_object_type type_needed, acpi_object_type this_type,
drivers/acpi/executer/exstore.c renamed from drivers/acpi/executer/exstore.c.old +6 -1
@@ -53,6 +53,11 @@#define _COMPONENT ACPI_EXECUTER ACPI_MODULE_NAME ("exstore") +static acpi_status +acpi_ex_store_object_to_index ( +union acpi_operand_object *source_desc, +union acpi_operand_object *index_desc, +struct acpi_walk_state *walk_state);/******************************************************************************* *
@@ -272,7 +277,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ex_store_object_to_index ( union acpi_operand_object *source_desc, union acpi_operand_object *index_desc,
drivers/acpi/executer/exutils.c renamed from drivers/acpi/executer/exutils.c.old +1 -1
@@ -273,7 +273,7 @@* ******************************************************************************/ -u32 +static u32 acpi_ex_digits_needed (acpi_integer value,u32 base)
drivers/acpi/fan.c renamed from drivers/acpi/fan.c.old +7 -7
@@ -50,8 +50,8 @@MODULE_DESCRIPTION (ACPI_FAN_DRIVER_NAME );MODULE_LICENSE ("GPL" ); -int acpi_fan_add (struct acpi_device *device); -int acpi_fan_remove (struct acpi_device *device,int type); +static int acpi_fan_add (struct acpi_device *device); +static int acpi_fan_remove (struct acpi_device *device,int type);static struct acpi_driver acpi_fan_driver = { .name =ACPI_FAN_DRIVER_NAME ,
@@ -72,7 +72,7 @@FS Interface (/proc) -------------------------------------------------------------------------- */ -struct proc_dir_entry *acpi_fan_dir; +static struct proc_dir_entry *acpi_fan_dir; static int
@@ -194,7 +194,7 @@Driver Interface -------------------------------------------------------------------------- */ -int +static int acpi_fan_add (struct acpi_device *device) {
@@ -240,7 +240,7 @@ } -int +static int acpi_fan_remove (struct acpi_device *device,int type)
@@ -262,7 +262,7 @@ } -int __init +static int __init acpi_fan_init (void ) {int result =0 ;
@@ -284,7 +284,7 @@ } -void __exit +static void __exitacpi_fan_exit (void ) {ACPI_FUNCTION_TRACE ("acpi_fan_exit" );
include/acpi/achware.h renamed from include/acpi/achware.h.old +0 -5
@@ -155,11 +155,6 @@struct acpi_gpe_xrupt_info *gpe_xrupt_info, struct acpi_gpe_block_info *gpe_block); -acpi_status -acpi_hw_enable_wakeup_gpe_block ( -struct acpi_gpe_xrupt_info *gpe_xrupt_info, -struct acpi_gpe_block_info *gpe_block); -/* ACPI Timer prototypes */
drivers/acpi/hardware/hwgpe.c renamed from drivers/acpi/hardware/hwgpe.c.old +1 -1
@@ -332,7 +332,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_hw_enable_wakeup_gpe_block (struct acpi_gpe_xrupt_info *gpe_xrupt_info,struct acpi_gpe_block_info *gpe_block)
drivers/acpi/ibm_acpi.c renamed from drivers/acpi/ibm_acpi.c.old +2 -2
@@ -155,7 +155,7 @@int experimental; }; -struct proc_dir_entry *proc_dir =NULL ; +static struct proc_dir_entry *proc_dir =NULL ;#define onoff (status,bit) ((status) & (1 << (bit)) ? "on" : "off")#define enabled (status,bit) ((status) & (1 << (bit)) ? "enabled" : "disabled")
@@ -856,7 +856,7 @@return 0 ; } -struct ibm_struct ibms[] = { +static struct ibm_struct ibms[] = { { .name ="driver" , .init = driver_init,
include/acpi/acnamesp.h renamed from include/acpi/acnamesp.h.old +0 -61
113 lines not on this page · raw message
drivers/acpi/namespace/nsalloc.c renamed from drivers/acpi/namespace/nsalloc.c.old +1 -1
@@ -548,7 +548,7 @@* ******************************************************************************/ -void +static void acpi_ns_remove_reference (struct acpi_namespace_node *node) {
drivers/acpi/namespace/nseval.c renamed from drivers/acpi/namespace/nseval.c.old +9 -2
@@ -52,6 +52,13 @@#define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nseval") +static acpi_status +acpi_ns_execute_control_method ( +struct acpi_parameter_info *info); + +static acpi_status +acpi_ns_get_object_value ( +struct acpi_parameter_info *info);/******************************************************************************* *
@@ -355,7 +362,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ns_execute_control_method (struct acpi_parameter_info *info) {
@@ -424,7 +431,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ns_get_object_value (struct acpi_parameter_info *info) {
drivers/acpi/namespace/nsinit.c renamed from drivers/acpi/namespace/nsinit.c.old +15 -2
@@ -50,6 +50,19 @@#define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nsinit") +static acpi_status +acpi_ns_init_one_device ( +acpi_handle obj_handle, +u32 nesting_level, +void *context, +void **return_value); + +static acpi_status +acpi_ns_init_one_object ( +acpi_handle obj_handle, +u32 level, +void *context, +void **return_value);/******************************************************************************* *
@@ -191,7 +204,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ns_init_one_object ( acpi_handle obj_handle, u32 level,
@@ -331,7 +344,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ns_init_one_device ( acpi_handle obj_handle, u32 nesting_level,
drivers/acpi/namespace/nsload.c renamed from drivers/acpi/namespace/nsload.c.old +1 -1
@@ -159,7 +159,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ns_load_table_by_type (acpi_table_type table_type) {
drivers/acpi/namespace/nsnames.c renamed from drivers/acpi/namespace/nsnames.c.old +1 -1
@@ -66,7 +66,7 @@* ******************************************************************************/ -void +static void acpi_ns_build_external_path ( struct acpi_namespace_node *node, acpi_size size,
drivers/acpi/namespace/nsparse.c renamed from drivers/acpi/namespace/nsparse.c.old +1 -1
@@ -65,7 +65,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ns_one_complete_parse (u32 pass_number,struct acpi_table_desc *table_desc)
drivers/acpi/namespace/nsutils.c renamed from drivers/acpi/namespace/nsutils.c.old +10 -4
@@ -51,6 +51,12 @@#define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nsutils") +static acpi_status +acpi_ns_externalize_name ( +u32 internal_name_length, +char *internal_name, +u32 *converted_name_length, +char **converted_name);/******************************************************************************* *
@@ -232,7 +238,7 @@* ******************************************************************************/ -u8 +static u8 acpi_ns_valid_path_separator (char sep) {
@@ -310,7 +316,7 @@* ******************************************************************************/ -void +static void acpi_ns_get_internal_name_length (struct acpi_namestring_info *info) {
@@ -381,7 +387,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ns_build_internal_name (struct acpi_namestring_info *info) {
@@ -562,7 +568,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ns_externalize_name ( u32 internal_name_length, char *internal_name,
drivers/acpi/osl.c renamed from drivers/acpi/osl.c.old +5 -5
@@ -563,7 +563,7 @@ }/* TODO: Change code to take advantage of driver model more */ -void +static void acpi_os_derive_pci_id_2 ( acpi_handle rhandle, /* upper bound */ acpi_handle chandle, /* current node */
@@ -1071,7 +1071,7 @@ }EXPORT_SYMBOL (acpi_os_signal); -int __init +static int __init acpi_os_name_setup (char *str) {char *p = acpi_os_name;
@@ -1101,7 +1101,7 @@* empty string disables _OSI * TBD additional string adds to _OSI */ -int __init +static int __init acpi_osi_setup (char *str) {if (str ==NULL || *str =='\0' ) {
@@ -1119,7 +1119,7 @@__setup ("acpi_osi=" , acpi_osi_setup);/* enable serialization to combat AE_ALREADY_EXISTS errors */ -int __init +static int __init acpi_serialize_setup (char *str) { printk(KERN_INFO PREFIX "serialize enabled\n");
@@ -1140,7 +1140,7 @@* Run-time events on the same GPE this flag is available * to tell Linux to keep the wake-time GPEs enabled at run-time. */ -int __init +static int __init acpi_wake_gpes_always_on_setup (char *str) { printk(KERN_INFO PREFIX "wake GPEs not disabled\n");
include/acpi/acparser.h renamed from include/acpi/acparser.h.old +0 -37
@@ -89,10 +89,6 @@acpi_ps_get_next_package_end ( struct acpi_parse_state *parser_state); -u32 -acpi_ps_get_next_package_length ( -struct acpi_parse_state *parser_state); -char *acpi_ps_get_next_namestring (struct acpi_parse_state *parser_state);
@@ -110,10 +106,6 @@union acpi_parse_object *arg, u8 method_call); -union acpi_parse_object * -acpi_ps_get_next_field ( -struct acpi_parse_state *parser_state); - acpi_status acpi_ps_get_next_arg ( struct acpi_walk_state *walk_state,
@@ -148,21 +140,6 @@/* psparse - top level parsing routines */ -u32 -acpi_ps_get_opcode_size ( -u32 opcode); - -void -acpi_ps_complete_this_op ( -struct acpi_walk_state *walk_state, -union acpi_parse_object *op); - -acpi_status -acpi_ps_next_parse_state ( -struct acpi_walk_state *walk_state, -union acpi_parse_object *op, -acpi_status callback_status); - acpi_status acpi_ps_find_object ( struct acpi_walk_state *walk_state,
@@ -173,10 +150,6 @@ union acpi_parse_object *root);acpi_status -acpi_ps_parse_loop ( -struct acpi_walk_state *walk_state); - -acpi_status acpi_ps_parse_aml (struct acpi_walk_state *walk_state);
@@ -273,16 +246,6 @@acpi_parse_downwards descending_callback, acpi_parse_upwards ascending_callback); -acpi_status -acpi_ps_get_next_walk_op ( -struct acpi_walk_state *walk_state, -union acpi_parse_object *op, -acpi_parse_upwards ascending_callback); - -acpi_status -acpi_ps_delete_completed_op ( -struct acpi_walk_state *walk_state); -/* psutils - parser utilities */
drivers/acpi/parser/psargs.c renamed from drivers/acpi/parser/psargs.c.old +2 -2
@@ -64,7 +64,7 @@* ******************************************************************************/ -u32 +static u32 acpi_ps_get_next_package_length (struct acpi_parse_state *parser_state) {
@@ -486,7 +486,7 @@* ******************************************************************************/ -union acpi_parse_object * +static union acpi_parse_object *acpi_ps_get_next_field (struct acpi_parse_state *parser_state) {
drivers/acpi/parser/psopcode.c renamed from drivers/acpi/parser/psopcode.c.old +1 -1
@@ -468,7 +468,7 @@*/ -const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES ] = +static const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES ] = {/*! [Begin] no source code translation */ /* Index Name Parser Args Interpreter Args ObjectType Class Type Flags */
drivers/acpi/parser/psparse.c renamed from drivers/acpi/parser/psparse.c.old +4 -4
@@ -77,7 +77,7 @@* ******************************************************************************/ -u32 +static u32 acpi_ps_get_opcode_size (u32 opcode) {
@@ -142,7 +142,7 @@* ******************************************************************************/ -void +static void acpi_ps_complete_this_op (struct acpi_walk_state *walk_state,union acpi_parse_object *op)
@@ -300,7 +300,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ps_next_parse_state ( struct acpi_walk_state *walk_state, union acpi_parse_object *op,
@@ -421,7 +421,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ps_parse_loop (struct acpi_walk_state *walk_state) {
drivers/acpi/parser/pswalk.c renamed from drivers/acpi/parser/pswalk.c.old +2 -2
@@ -64,7 +64,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ps_get_next_walk_op ( struct acpi_walk_state *walk_state, union acpi_parse_object *op,
@@ -225,7 +225,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ps_delete_completed_op (struct acpi_walk_state *walk_state) {
include/acpi/acpi_drivers.h renamed from include/acpi/acpi_drivers.h.old +0 -1
@@ -68,7 +68,6 @@struct pci_bus ;int acpi_pci_bind (struct acpi_device *device); -int acpi_pci_unbind (struct acpi_device *device);int acpi_pci_bind_root (struct acpi_device *device,struct acpi_pci_id *id,struct pci_bus *bus);/* Arch-defined function to add a bus to the system */
drivers/acpi/pci_bind.c renamed from drivers/acpi/pci_bind.c.old +4 -2
@@ -45,8 +45,10 @@struct pci_dev *dev; }; +static int acpi_pci_unbind ( +struct acpi_device *device); -void +static void acpi_pci_data_handler ( acpi_handle handle, u32 function,
@@ -270,7 +272,7 @@return_VALUE (result); } -int acpi_pci_unbind ( +static int acpi_pci_unbind (struct acpi_device *device) {int result =0 ;
include/linux/acpi.h renamed from include/linux/acpi.h.old +0 -2
@@ -455,8 +455,6 @@struct list_head entries; }; -extern struct acpi_prt_list acpi_prt; -struct pci_dev ;int acpi_pci_irq_enable (struct pci_dev *dev);
drivers/acpi/pci_irq.c renamed from drivers/acpi/pci_irq.c.old +2 -2
@@ -42,8 +42,8 @@#define _COMPONENT ACPI_PCI_COMPONENT ACPI_MODULE_NAME ("pci_irq") -struct acpi_prt_list acpi_prt; -DEFINE_SPINLOCK (acpi_prt_lock); +static struct acpi_prt_list acpi_prt; +static DEFINE_SPINLOCK (acpi_prt_lock);/* -------------------------------------------------------------------------- PCI IRQ Routing Table (PRT) Support
drivers/acpi/power.c renamed from drivers/acpi/power.c.old +5 -5
@@ -58,8 +58,8 @@#define ACPI_POWER_RESOURCE_STATE_ON 0x01#define ACPI_POWER_RESOURCE_STATE_UNKNOWN 0xFF -int acpi_power_add (struct acpi_device *device); -int acpi_power_remove (struct acpi_device *device,int type); +static int acpi_power_add (struct acpi_device *device); +static int acpi_power_remove (struct acpi_device *device,int type);static int acpi_power_open_fs (struct inode *inode,struct file *file);static struct acpi_driver acpi_power_driver = {
@@ -479,7 +479,7 @@FS Interface (/proc) -------------------------------------------------------------------------- */ -struct proc_dir_entry *acpi_power_dir; +static struct proc_dir_entry *acpi_power_dir;static int acpi_power_seq_show (struct seq_file *seq,void *offset) {
@@ -576,7 +576,7 @@Driver Interface -------------------------------------------------------------------------- */ -int +static int acpi_power_add (struct acpi_device *device) {
@@ -642,7 +642,7 @@ } -int +static int acpi_power_remove (struct acpi_device *device,int type)
drivers/acpi/processor_core.c renamed from drivers/acpi/processor_core.c.old +3 -3
@@ -105,7 +105,7 @@#define UNINSTALL_NOTIFY_HANDLER 2 -struct file_operations acpi_processor_info_fops = { +static struct file_operations acpi_processor_info_fops = { .open = acpi_processor_info_open_fs, .read = seq_read, .llseek = seq_lseek,
@@ -121,7 +121,7 @@Errata Handling -------------------------------------------------------------------------- */ -int +static int acpi_processor_errata_piix4 (struct pci_dev *dev) {
@@ -259,7 +259,7 @@FS Interface (/proc) -------------------------------------------------------------------------- */ -struct proc_dir_entry *acpi_processor_dir =NULL ; +static struct proc_dir_entry *acpi_processor_dir =NULL ;static int acpi_processor_info_seq_show (struct seq_file *seq,void *offset) {
include/acpi/processor.h renamed from include/acpi/processor.h.old +0 -2
@@ -201,7 +201,6 @@/* in processor_throttling.c */ int acpi_processor_get_throttling_info (struct acpi_processor *pr);int acpi_processor_set_throttling (struct acpi_processor *pr,int state); -int acpi_processor_throttling_open_fs (struct inode *inode,struct file *file); ssize_t acpi_processor_write_throttling ( struct file *file, const char __user *buffer,
@@ -217,7 +216,6 @@/* in processor_thermal.c */ int acpi_processor_get_limit_info (struct acpi_processor *pr); -int acpi_processor_limit_open_fs (struct inode *inode,struct file *file); ssize_t acpi_processor_write_limit ( struct file *file, const char __user *buffer,
drivers/acpi/processor_thermal.c renamed from drivers/acpi/processor_thermal.c.old +1 -1
@@ -345,7 +345,7 @@return_VALUE (0 ); } -int acpi_processor_limit_open_fs (struct inode *inode,struct file *file) +static int acpi_processor_limit_open_fs (struct inode *inode,struct file *file) {return single_open (file, acpi_processor_limit_seq_show,PDE (inode)->data);
drivers/acpi/processor_throttling.c renamed from drivers/acpi/processor_throttling.c.old +1 -1
@@ -308,7 +308,7 @@return_VALUE (0 ); } -int acpi_processor_throttling_open_fs (struct inode *inode,struct file *file) +static int acpi_processor_throttling_open_fs (struct inode *inode,struct file *file) {return single_open (file, acpi_processor_throttling_seq_show,PDE (inode)->data);
include/acpi/acpi_bus.h renamed from include/acpi/acpi_bus.h.old +0 -1
@@ -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);
drivers/acpi/scan.c renamed from drivers/acpi/scan.c.old +8 -4
@@ -27,6 +27,10 @@DEFINE_SPINLOCK (acpi_device_lock);LIST_HEAD (acpi_wakeup_device_list); +static int +acpi_bus_trim (struct acpi_device *start, +int rmdevice); +static void acpi_device_release (struct kobject * kobj) { struct acpi_device * dev = container_of(kobj,struct acpi_device,kobj);
@@ -849,7 +853,7 @@acpi_os_free (buffer.pointer); } -int acpi_device_set_context (struct acpi_device * device,int type) +static int acpi_device_set_context (struct acpi_device * device,int type) {acpi_status status =AE_OK ;int result =0 ;
@@ -874,7 +878,7 @@return result; } -void acpi_device_get_debug_info (struct acpi_device * device,acpi_handle handle,int type) +static void acpi_device_get_debug_info (struct acpi_device * device,acpi_handle handle,int type) {#ifdef CONFIG_ACPI_DEBUG_OUTPUT char *type_string =NULL ;
@@ -917,7 +921,7 @@ } -int +static int acpi_bus_remove (struct acpi_device *dev,int rmdevice)
@@ -1215,7 +1219,7 @@EXPORT_SYMBOL (acpi_bus_scan); -int +static int acpi_bus_trim (struct acpi_device *start,int rmdevice) {
include/acpi/actables.h renamed from include/acpi/actables.h.old +0 -32
@@ -99,17 +99,6 @@ struct acpi_table_desc *table_info); acpi_status -acpi_tb_get_this_table ( -struct acpi_pointer *address, -struct acpi_table_header *header, -struct acpi_table_desc *table_info); - -acpi_status -acpi_tb_table_override ( -struct acpi_table_header *header, -struct acpi_table_desc *table_info); - -acpi_status acpi_tb_get_table_ptr ( acpi_table_type table_type, u32 instance,
@@ -131,17 +120,6 @@acpi_tb_get_required_tables ( void); -acpi_status -acpi_tb_get_primary_table ( -struct acpi_pointer *address, -struct acpi_table_desc *table_info); - -acpi_status -acpi_tb_get_secondary_table ( -struct acpi_pointer *address, -acpi_string signature, -struct acpi_table_desc *table_info); -/* * tbinstall - Table installation */
@@ -196,16 +174,6 @@acpi_tb_get_table_rsdt ( void); -u8 * -acpi_tb_scan_memory_for_rsdp ( -u8 *start_address, -u32 length); - -acpi_status -acpi_tb_find_rsdp ( -struct acpi_table_desc *table_info, -u32 flags); -/* * tbutils - common table utilities
drivers/acpi/tables/tbget.c renamed from drivers/acpi/tables/tbget.c.old +12 -2
@@ -49,6 +49,16 @@#define _COMPONENT ACPI_TABLES ACPI_MODULE_NAME ("tbget") +static acpi_status +acpi_tb_get_this_table ( +struct acpi_pointer *address, +struct acpi_table_header *header, +struct acpi_table_desc *table_info); + +static acpi_status +acpi_tb_table_override ( +struct acpi_table_header *header, +struct acpi_table_desc *table_info);/******************************************************************************* *
@@ -241,7 +251,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_tb_table_override (struct acpi_table_header *header,struct acpi_table_desc *table_info)
@@ -315,7 +325,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_tb_get_this_table ( struct acpi_pointer *address, struct acpi_table_header *header,
drivers/acpi/tables/tbgetall.c renamed from drivers/acpi/tables/tbgetall.c.old +2 -2
@@ -63,7 +63,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_tb_get_primary_table (struct acpi_pointer *address,struct acpi_table_desc *table_info)
@@ -130,7 +130,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_tb_get_secondary_table ( struct acpi_pointer *address, acpi_string signature,
drivers/acpi/tables/tbxfroot.c renamed from drivers/acpi/tables/tbxfroot.c.old +6 -2
@@ -50,6 +50,10 @@#define _COMPONENT ACPI_TABLES ACPI_MODULE_NAME ("tbxfroot") +static acpi_status +acpi_tb_find_rsdp ( +struct acpi_table_desc *table_info, +u32 flags);/******************************************************************************* *
@@ -385,7 +389,7 @@* ******************************************************************************/ -u8 * +static u8 *acpi_tb_scan_memory_for_rsdp (u8 *start_address,u32 length)
@@ -468,7 +472,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_tb_find_rsdp (struct acpi_table_desc *table_info,u32 flags)
drivers/acpi/thermal.c renamed from drivers/acpi/thermal.c.old +1 -1
@@ -774,7 +774,7 @@FS Interface (/proc) -------------------------------------------------------------------------- */ -struct proc_dir_entry *acpi_thermal_dir; +static struct proc_dir_entry *acpi_thermal_dir;static int acpi_thermal_state_seq_show (struct seq_file *seq,void *offset) {
drivers/acpi/toshiba_acpi.c renamed from drivers/acpi/toshiba_acpi.c.old +1 -1
@@ -481,7 +481,7 @@#define PROC_TOSHIBA "toshiba" -ProcItem proc_items[] = +static ProcItem proc_items[] = { {"lcd" , read_lcd , write_lcd }, {"video" , read_video , write_video },
include/acpi/acutils.h renamed from include/acpi/acutils.h.old +0 -92
149 lines not on this page · raw message
drivers/acpi/utilities/utalloc.c renamed from drivers/acpi/utilities/utalloc.c.old +20 -3
@@ -47,6 +47,23 @@#define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("utalloc") +static acpi_status +acpi_ut_remove_allocation ( +u32 list_id, +struct acpi_debug_mem_block *allocation, +u32 component, +char *module, +u32 line); + +static acpi_status +acpi_ut_track_allocation ( +u32 list_id, +struct acpi_debug_mem_block *allocation, +acpi_size size, +u8 alloc_type, +u32 component, +char *module, +u32 line);/****************************************************************************** *
@@ -613,7 +630,7 @@* ******************************************************************************/ -struct acpi_debug_mem_block * +static struct acpi_debug_mem_block *acpi_ut_find_allocation (u32 list_id,void *allocation)
@@ -662,7 +679,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ut_track_allocation ( u32 list_id, struct acpi_debug_mem_block *allocation,
@@ -749,7 +766,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ut_remove_allocation ( u32 list_id, struct acpi_debug_mem_block *allocation,
drivers/acpi/utilities/utcopy.c renamed from drivers/acpi/utilities/utcopy.c.old +5 -5
@@ -194,7 +194,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ut_copy_ielement_to_eelement ( u8 object_type, union acpi_operand_object *source_object,
@@ -398,7 +398,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ut_copy_esimple_to_isimple (union acpi_object *external_object,union acpi_operand_object **ret_internal_object)
@@ -614,7 +614,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ut_copy_simple_object (union acpi_operand_object *source_desc,union acpi_operand_object *dest_desc)
@@ -713,7 +713,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ut_copy_ielement_to_ielement ( u8 object_type, union acpi_operand_object *source_object,
@@ -826,7 +826,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ut_copy_ipackage_to_ipackage ( union acpi_operand_object *source_obj, union acpi_operand_object *dest_obj,
drivers/acpi/utilities/utdelete.c renamed from drivers/acpi/utilities/utdelete.c.old +1 -1
@@ -64,7 +64,7 @@* ******************************************************************************/ -void +static void acpi_ut_delete_internal_obj (union acpi_operand_object *object) {
drivers/acpi/utilities/utinit.c renamed from drivers/acpi/utilities/utinit.c.old +1 -1
@@ -170,7 +170,7 @@* ******************************************************************************/ -void +static void acpi_ut_terminate (void ) {struct acpi_gpe_block_info *gpe_block;
drivers/acpi/utilities/utmisc.c renamed from drivers/acpi/utilities/utmisc.c.old +16 -3
@@ -49,6 +49,19 @@#define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("utmisc") +static acpi_status +acpi_ut_create_mutex ( +acpi_mutex_handle mutex_id); + +static union acpi_generic_state * +acpi_ut_create_pkg_state ( +void *internal_object, +void *external_object, +u16 index); + +static acpi_status +acpi_ut_delete_mutex ( +acpi_mutex_handle mutex_id);/******************************************************************************* *
@@ -595,7 +608,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ut_create_mutex (acpi_mutex_handle mutex_id) {
@@ -632,7 +645,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ut_delete_mutex (acpi_mutex_handle mutex_id) {
@@ -1092,7 +1105,7 @@* ******************************************************************************/ -union acpi_generic_state * +static union acpi_generic_state * acpi_ut_create_pkg_state ( void *internal_object, void *external_object,
drivers/acpi/utilities/utobject.c renamed from drivers/acpi/utilities/utobject.c.old +3 -3
@@ -410,7 +410,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ut_get_simple_object_size (union acpi_operand_object *internal_object,acpi_size *obj_length)
@@ -528,7 +528,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ut_get_element_length ( u8 object_type, union acpi_operand_object *source_object,
@@ -593,7 +593,7 @@* ******************************************************************************/ -acpi_status +static acpi_status acpi_ut_get_package_object_size (union acpi_operand_object *internal_object,acpi_size *obj_length)
drivers/acpi/video.c renamed from drivers/acpi/video.c.old +1 -1
@@ -683,7 +683,7 @@FS Interface (/proc) -------------------------------------------------------------------------- */ -struct proc_dir_entry *acpi_video_dir; +static struct proc_dir_entry *acpi_video_dir;/* video devices */
Quoted 6 lines · Adrian Bunk
Before I'm getting flamed to death:
This patch isn't meant for being immediately applied.This patch makes all needlessly global code under
drivers/acpi/static.
Please review this patch.
Thanks for the patch Adrian.
I agree that this is the right direction to go -- enforcing APIs with the use of static reduces the possibility of programming errors -- particularly with many cooks in the kitchen. Indeed, just on Monday we discussed a patch from Alexey Starikovskiy to do the same thing.
The problem is one of logistics.
As I've described before, the files with "R. Byron Moore" at the top are dual-licensed so Intel can distribute the core interpreter both as GPL to Linux and also to FreeBSD, HP-UX etc.
Yes, GPL is GPL and that gives the Linux community the right to do whatever is needed to those files. But patches accepted to the core interpreter under GPL can not be applied to the upstream interpreter -- so they're effectively a fork that code.
We've forked in other areas, the largest is your FUTURE_USAGE patch which I accepted. But forks have a non-zero cost on me, and I have a big enough task trying to make Linux/ACPI the best implementation possible without getting sidetracked by avoidable logisital challenges. So here is what I propose.
I've already asked Bob Moore to migrate to the use of static in the interpreter. There are some somewhat urgent functional issues he needs to focus on first, but static is on the list. If we allow him to do it upstream (w/o looking at your patch), then we can avoid a fork in the core interpreter code.
At the same time, the non "R. Byron Moore" files, such as those in drivers/acpi, but not in the lower sub-directories, are straight GPL and I'll be happy to accept patches to those files immediately. Note that there are 4 straight GPL files in include/acpi as well -- so like the drivers/acpi/* files, we can modify them any time when cleanups are appropriate in the Linux release cycle.
thanks,
-Len
Quoted 11 lines · Len Brown
Thanks for the patch Adrian.
I agree that this is the right direction to go -- enforcing APIs with the use of static reduces the possibility of programming errors -- particularly with many cooks in the kitchen. Indeed, just on Monday we discussed a patch from Alexey Starikovskiy to do the same thing.
The problem is one of logistics.
As I've described before, the files with "R. Byron Moore" at the top are dual-licensed so Intel can distribute the core interpreter both as GPL to Linux and also to FreeBSD, HP-UX etc
Well, I can not speak for Adrian but if I were to submit a patch and state that it is also dual licensed you should have no troubles applying it even to the core files, right?
Signature · 1 line
Dmitry
PATCH 1/1 drivers/acpi/: make some code static
In reply to Len BrownQuoted 7 lines · Len Brown
...
At the same time, the non "R. Byron Moore" files, such as those indrivers/acpi, but not in the lower sub-directories, are straight GPL and I'll be happy to accept patches to those files immediately. Note that there are 4 straight GPL files ininclude/acpias well -- so like thedrivers/acpi/*files, we can modify them any time when cleanups are appropriate in the Linux release cycle.
Is the patch below OK?
Quoted 2 lines
thanks,
-Len
cu
Adrian
<-- snip -->
This patch makes some needlessly global code static.
---
drivers/acpi/ac.c | 18 +++++++++--------- drivers/acpi/battery.c | 2 +- drivers/acpi/button.c | 4 ++-- drivers/acpi/container.c | 4 ++-- drivers/acpi/debug.c | 4 ++-- drivers/acpi/ec.c | 2 +- drivers/acpi/fan.c | 14 +++++++------- drivers/acpi/ibm_acpi.c | 4 ++-- drivers/acpi/osl.c | 10 +++++----- drivers/acpi/pci_irq.c | 4 ++-- drivers/acpi/power.c | 10 +++++----- drivers/acpi/processor_core.c | 6 +++--- drivers/acpi/processor_thermal.c | 2 +- drivers/acpi/processor_throttling.c | 2 +- drivers/acpi/scan.c | 12 ++++++++---- drivers/acpi/thermal.c | 2 +- drivers/acpi/toshiba_acpi.c | 2 +- drivers/acpi/video.c | 2 +- include/acpi/acpi_bus.h | 1 - include/acpi/processor.h | 2 -- include/linux/acpi.h | 2 -- 21 files changed, 54 insertions(+), 55 deletions(-)
drivers/acpi/ac.c renamed from drivers/acpi/ac.c.old +9 -9
@@ -51,8 +51,8 @@MODULE_DESCRIPTION (ACPI_AC_DRIVER_NAME );MODULE_LICENSE ("GPL" ); -int acpi_ac_add (struct acpi_device *device); -int acpi_ac_remove (struct acpi_device *device,int type); +static int acpi_ac_add (struct acpi_device *device); +static int acpi_ac_remove (struct acpi_device *device,int type);static int acpi_ac_open_fs (struct inode *inode,struct file *file);static struct acpi_driver acpi_ac_driver = {
@@ -108,9 +108,9 @@FS Interface (/proc) -------------------------------------------------------------------------- */ -struct proc_dir_entry *acpi_ac_dir; +static struct proc_dir_entry *acpi_ac_dir; -int acpi_ac_seq_show (struct seq_file *seq,void *offset) +static int acpi_ac_seq_show (struct seq_file *seq,void *offset) {struct acpi_ac *ac = (struct acpi_ac *) seq->private;
@@ -200,7 +200,7 @@Driver Model -------------------------------------------------------------------------- */ -void +static void acpi_ac_notify ( acpi_handle handle, u32 event,
@@ -232,7 +232,7 @@ } -int +static int acpi_ac_add (struct acpi_device *device) {
@@ -286,7 +286,7 @@ } -int +static int acpi_ac_remove (struct acpi_device *device,int type)
@@ -315,7 +315,7 @@ } -int __init +static int __init acpi_ac_init (void ) {int result =0 ;
@@ -337,7 +337,7 @@ } -void __exit +static void __exitacpi_ac_exit (void ) {ACPI_FUNCTION_TRACE ("acpi_ac_exit" );
drivers/acpi/battery.c renamed from drivers/acpi/battery.c.old +1 -1
@@ -341,7 +341,7 @@FS Interface (/proc) -------------------------------------------------------------------------- */ -struct proc_dir_entry *acpi_battery_dir; +static struct proc_dir_entry *acpi_battery_dir;static int acpi_battery_read_info (struct seq_file *seq,void *offset) {int result =0 ;
drivers/acpi/button.c renamed from drivers/acpi/button.c.old +2 -2
@@ -275,7 +275,7 @@Driver Interface -------------------------------------------------------------------------- */ -void +static void acpi_button_notify ( acpi_handle handle, u32 event,
@@ -302,7 +302,7 @@ } -acpi_status +static acpi_status acpi_button_notify_fixed (void *data) {
drivers/acpi/container.c renamed from drivers/acpi/container.c.old +2 -2
@@ -255,7 +255,7 @@ } -int __init +static int __init acpi_container_init (void ) {int result =0 ;
@@ -276,7 +276,7 @@return (0 ); } -void __exit +static void __exitacpi_container_exit (void ) {int action =UNINSTALL_NOTIFY_HANDLER ;
drivers/acpi/debug.c renamed from drivers/acpi/debug.c.old +2 -2
@@ -35,7 +35,7 @@ };#define ACPI_DEBUG_INIT (v) { .name = #v, .value = v } -const struct acpi_dlayer acpi_debug_layers[] = +static const struct acpi_dlayer acpi_debug_layers[] = {ACPI_DEBUG_INIT (ACPI_UTILITIES ),ACPI_DEBUG_INIT (ACPI_HARDWARE ),
@@ -53,7 +53,7 @@ ACPI_DEBUG_INIT(ACPI_TOOLS), }; -const struct acpi_dlevel acpi_debug_levels[] = +static const struct acpi_dlevel acpi_debug_levels[] = {ACPI_DEBUG_INIT (ACPI_LV_ERROR ),ACPI_DEBUG_INIT (ACPI_LV_WARN ),
drivers/acpi/ec.c renamed from drivers/acpi/ec.c.old +1 -1
@@ -514,7 +514,7 @@FS Interface (/proc) -------------------------------------------------------------------------- */ -struct proc_dir_entry *acpi_ec_dir; +static struct proc_dir_entry *acpi_ec_dir; static int
drivers/acpi/fan.c renamed from drivers/acpi/fan.c.old +7 -7
@@ -50,8 +50,8 @@MODULE_DESCRIPTION (ACPI_FAN_DRIVER_NAME );MODULE_LICENSE ("GPL" ); -int acpi_fan_add (struct acpi_device *device); -int acpi_fan_remove (struct acpi_device *device,int type); +static int acpi_fan_add (struct acpi_device *device); +static int acpi_fan_remove (struct acpi_device *device,int type);static struct acpi_driver acpi_fan_driver = { .name =ACPI_FAN_DRIVER_NAME ,
@@ -72,7 +72,7 @@FS Interface (/proc) -------------------------------------------------------------------------- */ -struct proc_dir_entry *acpi_fan_dir; +static struct proc_dir_entry *acpi_fan_dir; static int
@@ -194,7 +194,7 @@Driver Interface -------------------------------------------------------------------------- */ -int +static int acpi_fan_add (struct acpi_device *device) {
@@ -240,7 +240,7 @@ } -int +static int acpi_fan_remove (struct acpi_device *device,int type)
@@ -262,7 +262,7 @@ } -int __init +static int __init acpi_fan_init (void ) {int result =0 ;
@@ -284,7 +284,7 @@ } -void __exit +static void __exitacpi_fan_exit (void ) {ACPI_FUNCTION_TRACE ("acpi_fan_exit" );
drivers/acpi/ibm_acpi.c renamed from drivers/acpi/ibm_acpi.c.old +2 -2
@@ -155,7 +155,7 @@int experimental; }; -struct proc_dir_entry *proc_dir =NULL ; +static struct proc_dir_entry *proc_dir =NULL ;#define onoff (status,bit) ((status) & (1 << (bit)) ? "on" : "off")#define enabled (status,bit) ((status) & (1 << (bit)) ? "enabled" : "disabled")
@@ -856,7 +856,7 @@return 0 ; } -struct ibm_struct ibms[] = { +static struct ibm_struct ibms[] = { { .name ="driver" , .init = driver_init,
drivers/acpi/osl.c renamed from drivers/acpi/osl.c.old +5 -5
@@ -563,7 +563,7 @@ }/* TODO: Change code to take advantage of driver model more */ -void +static void acpi_os_derive_pci_id_2 ( acpi_handle rhandle, /* upper bound */ acpi_handle chandle, /* current node */
@@ -1071,7 +1071,7 @@ }EXPORT_SYMBOL (acpi_os_signal); -int __init +static int __init acpi_os_name_setup (char *str) {char *p = acpi_os_name;
@@ -1101,7 +1101,7 @@* empty string disables _OSI * TBD additional string adds to _OSI */ -int __init +static int __init acpi_osi_setup (char *str) {if (str ==NULL || *str =='\0' ) {
@@ -1119,7 +1119,7 @@__setup ("acpi_osi=" , acpi_osi_setup);/* enable serialization to combat AE_ALREADY_EXISTS errors */ -int __init +static int __init acpi_serialize_setup (char *str) { printk(KERN_INFO PREFIX "serialize enabled\n");
@@ -1140,7 +1140,7 @@* Run-time events on the same GPE this flag is available * to tell Linux to keep the wake-time GPEs enabled at run-time. */ -int __init +static int __init acpi_wake_gpes_always_on_setup (char *str) { printk(KERN_INFO PREFIX "wake GPEs not disabled\n");
include/linux/acpi.h renamed from include/linux/acpi.h.old +0 -2
@@ -455,8 +455,6 @@struct list_head entries; }; -extern struct acpi_prt_list acpi_prt; -struct pci_dev ;int acpi_pci_irq_enable (struct pci_dev *dev);
drivers/acpi/pci_irq.c renamed from drivers/acpi/pci_irq.c.old +2 -2
@@ -42,8 +42,8 @@#define _COMPONENT ACPI_PCI_COMPONENT ACPI_MODULE_NAME ("pci_irq") -struct acpi_prt_list acpi_prt; -DEFINE_SPINLOCK (acpi_prt_lock); +static struct acpi_prt_list acpi_prt; +static DEFINE_SPINLOCK (acpi_prt_lock);/* -------------------------------------------------------------------------- PCI IRQ Routing Table (PRT) Support
drivers/acpi/power.c renamed from drivers/acpi/power.c.old +5 -5
@@ -58,8 +58,8 @@#define ACPI_POWER_RESOURCE_STATE_ON 0x01#define ACPI_POWER_RESOURCE_STATE_UNKNOWN 0xFF -int acpi_power_add (struct acpi_device *device); -int acpi_power_remove (struct acpi_device *device,int type); +static int acpi_power_add (struct acpi_device *device); +static int acpi_power_remove (struct acpi_device *device,int type);static int acpi_power_open_fs (struct inode *inode,struct file *file);static struct acpi_driver acpi_power_driver = {
@@ -479,7 +479,7 @@FS Interface (/proc) -------------------------------------------------------------------------- */ -struct proc_dir_entry *acpi_power_dir; +static struct proc_dir_entry *acpi_power_dir;static int acpi_power_seq_show (struct seq_file *seq,void *offset) {
@@ -576,7 +576,7 @@Driver Interface -------------------------------------------------------------------------- */ -int +static int acpi_power_add (struct acpi_device *device) {
@@ -642,7 +642,7 @@ } -int +static int acpi_power_remove (struct acpi_device *device,int type)
drivers/acpi/processor_core.c renamed from drivers/acpi/processor_core.c.old +3 -3
@@ -105,7 +105,7 @@#define UNINSTALL_NOTIFY_HANDLER 2 -struct file_operations acpi_processor_info_fops = { +static struct file_operations acpi_processor_info_fops = { .open = acpi_processor_info_open_fs, .read = seq_read, .llseek = seq_lseek,
@@ -121,7 +121,7 @@Errata Handling -------------------------------------------------------------------------- */ -int +static int acpi_processor_errata_piix4 (struct pci_dev *dev) {
@@ -259,7 +259,7 @@FS Interface (/proc) -------------------------------------------------------------------------- */ -struct proc_dir_entry *acpi_processor_dir =NULL ; +static struct proc_dir_entry *acpi_processor_dir =NULL ;static int acpi_processor_info_seq_show (struct seq_file *seq,void *offset) {
include/acpi/processor.h renamed from include/acpi/processor.h.old +0 -2
@@ -201,7 +201,6 @@/* in processor_throttling.c */ int acpi_processor_get_throttling_info (struct acpi_processor *pr);int acpi_processor_set_throttling (struct acpi_processor *pr,int state); -int acpi_processor_throttling_open_fs (struct inode *inode,struct file *file); ssize_t acpi_processor_write_throttling ( struct file *file, const char __user *buffer,
@@ -217,7 +216,6 @@/* in processor_thermal.c */ int acpi_processor_get_limit_info (struct acpi_processor *pr); -int acpi_processor_limit_open_fs (struct inode *inode,struct file *file); ssize_t acpi_processor_write_limit ( struct file *file, const char __user *buffer,
drivers/acpi/processor_thermal.c renamed from drivers/acpi/processor_thermal.c.old +1 -1
@@ -345,7 +345,7 @@return_VALUE (0 ); } -int acpi_processor_limit_open_fs (struct inode *inode,struct file *file) +static int acpi_processor_limit_open_fs (struct inode *inode,struct file *file) {return single_open (file, acpi_processor_limit_seq_show,PDE (inode)->data);
drivers/acpi/processor_throttling.c renamed from drivers/acpi/processor_throttling.c.old +1 -1
@@ -308,7 +308,7 @@return_VALUE (0 ); } -int acpi_processor_throttling_open_fs (struct inode *inode,struct file *file) +static int acpi_processor_throttling_open_fs (struct inode *inode,struct file *file) {return single_open (file, acpi_processor_throttling_seq_show,PDE (inode)->data);
include/acpi/acpi_bus.h renamed from include/acpi/acpi_bus.h.old +0 -1
@@ -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);
drivers/acpi/scan.c renamed from drivers/acpi/scan.c.old +8 -4
@@ -27,6 +27,10 @@DEFINE_SPINLOCK (acpi_device_lock);LIST_HEAD (acpi_wakeup_device_list); +static int +acpi_bus_trim (struct acpi_device *start, +int rmdevice); +static void acpi_device_release (struct kobject * kobj) { struct acpi_device * dev = container_of(kobj,struct acpi_device,kobj);
@@ -849,7 +853,7 @@acpi_os_free (buffer.pointer); } -int acpi_device_set_context (struct acpi_device * device,int type) +static int acpi_device_set_context (struct acpi_device * device,int type) {acpi_status status =AE_OK ;int result =0 ;
@@ -874,7 +878,7 @@return result; } -void acpi_device_get_debug_info (struct acpi_device * device,acpi_handle handle,int type) +static void acpi_device_get_debug_info (struct acpi_device * device,acpi_handle handle,int type) {#ifdef CONFIG_ACPI_DEBUG_OUTPUT char *type_string =NULL ;
@@ -917,7 +921,7 @@ } -int +static int acpi_bus_remove (struct acpi_device *dev,int rmdevice)
@@ -1215,7 +1219,7 @@EXPORT_SYMBOL (acpi_bus_scan); -int +static int acpi_bus_trim (struct acpi_device *start,int rmdevice) {
drivers/acpi/thermal.c renamed from drivers/acpi/thermal.c.old +1 -1
@@ -774,7 +774,7 @@FS Interface (/proc) -------------------------------------------------------------------------- */ -struct proc_dir_entry *acpi_thermal_dir; +static struct proc_dir_entry *acpi_thermal_dir;static int acpi_thermal_state_seq_show (struct seq_file *seq,void *offset) {
drivers/acpi/toshiba_acpi.c renamed from drivers/acpi/toshiba_acpi.c.old +1 -1
@@ -481,7 +481,7 @@#define PROC_TOSHIBA "toshiba" -ProcItem proc_items[] = +static ProcItem proc_items[] = { {"lcd" , read_lcd , write_lcd }, {"video" , read_video , write_video },
drivers/acpi/video.c renamed from drivers/acpi/video.c.old +1 -1
@@ -683,7 +683,7 @@FS Interface (/proc) -------------------------------------------------------------------------- */ -struct proc_dir_entry *acpi_video_dir; +static struct proc_dir_entry *acpi_video_dir;/* video devices */
Quoted 6 lines · Len Brown
I've already asked Bob Moore to migrate to the use of static in the interpreter. There are some somewhat urgent functional issues he needs to focus on first, but static is on the list. If we allow him to do it upstream (w/o looking at your patch), then we can avoid a fork in the core interpreter code.
Quoted 6 lines
At the same time, the non "R. Byron Moore" files, such as those in
drivers/acpi, but not in the lower sub-directories, are straight GPL and I'll be happy to accept patches to those files immediately. Note that there are 4 straight GPL files ininclude/acpias well -- so like thedrivers/acpi/*files, we can modify them any time when cleanups are appropriate in the Linux release cycle.
The files are licensed under a BSD license so all patches against it are aswell unless explicitly marked.