]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
ACPICA: All: const keyword changes across the ACPICA source
authorBob Moore <robert.moore@intel.com>
Thu, 24 Mar 2016 01:40:40 +0000 (09:40 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 5 Apr 2016 01:53:33 +0000 (03:53 +0200)
ACPICA commit a240cbb93647bddf525b3daf6e9d31b8b9bca34e

Integrated most changes proposed by net_BSD.
>From joerg@net_BSD.org (Joerg Sonnenberger)
ACPICA BZ 732.

Link: https://github.com/acpica/acpica/commit/a240cbb9
Link: https://bugs.acpica.org/show_bug.cgi?id=732
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
26 files changed:
drivers/acpi/acpica/acdebug.h
drivers/acpi/acpica/acglobal.h
drivers/acpi/acpica/acinterp.h
drivers/acpi/acpica/acnamesp.h
drivers/acpi/acpica/acparser.h
drivers/acpi/acpica/acresrc.h
drivers/acpi/acpica/acstruct.h
drivers/acpi/acpica/acutils.h
drivers/acpi/acpica/dbinput.c
drivers/acpi/acpica/dbutils.c
drivers/acpi/acpica/evregion.c
drivers/acpi/acpica/exdump.c
drivers/acpi/acpica/hwxface.c
drivers/acpi/acpica/nsaccess.c
drivers/acpi/acpica/nsdump.c
drivers/acpi/acpica/psopinfo.c
drivers/acpi/acpica/rsdump.c
drivers/acpi/acpica/rsutils.c
drivers/acpi/acpica/tbfadt.c
drivers/acpi/acpica/utdebug.c
drivers/acpi/acpica/uteval.c
drivers/acpi/acpica/utglobal.c
drivers/acpi/acpica/utmisc.c
drivers/acpi/acpica/utprint.c
drivers/acpi/acpica/uttrack.c
include/acpi/actypes.h

index 993af9eb007a28e7b39982022e5d0f7c44602548..9e2e080ac9af979475386539e25bb063f231f9f0 100644 (file)
@@ -53,7 +53,7 @@
 #define ACPI_DEBUG_BUFFER_SIZE  0x4000 /* 16K buffer for return objects */
 
 struct acpi_db_command_info {
-       char *name;             /* Command Name */
+       const char *name;       /* Command Name */
        u8 min_args;            /* Minimum arguments required */
 };
 
@@ -64,7 +64,7 @@ struct acpi_db_command_help {
 };
 
 struct acpi_db_argument_info {
-       char *name;             /* Argument Name */
+       const char *name;       /* Argument Name */
 };
 
 struct acpi_db_execute_walk {
index 54b42a57118e0729fdf2d9135f11aa12b6203712..fded776236e224736be84f73491b23054379b448 100644 (file)
@@ -187,6 +187,8 @@ extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT];
 extern const char *acpi_gbl_lowest_dstate_names[ACPI_NUM_sx_w_METHODS];
 extern const char *acpi_gbl_highest_dstate_names[ACPI_NUM_sx_d_METHODS];
 extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
+extern const char acpi_gbl_lower_hex_digits[];
+extern const char acpi_gbl_upper_hex_digits[];
 extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES];
 
 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
index bae1a35c345f808133f3e33f35184ca2c7ef50e4..8b09d28fe5a88123c39c5df2261cba9ab0a62e5a 100644 (file)
@@ -67,7 +67,7 @@
 typedef const struct acpi_exdump_info {
        u8 opcode;
        u8 offset;
-       char *name;
+       const char *name;
 
 } acpi_exdump_info;
 
index 022d69cb345a07014d73f674e5a55dd189042952..f33a4ba8e0cb7fe2208cbbbea97615e1cb8500cc 100644 (file)
@@ -206,9 +206,10 @@ void acpi_ns_dump_tables(acpi_handle search_base, u32 max_depth);
 void acpi_ns_dump_entry(acpi_handle handle, u32 debug_level);
 
 void
-acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component);
+acpi_ns_dump_pathname(acpi_handle handle,
+                     const char *msg, u32 level, u32 component);
 
-void acpi_ns_print_pathname(u32 num_segments, char *pathname);
+void acpi_ns_print_pathname(u32 num_segments, const char *pathname);
 
 acpi_status
 acpi_ns_dump_one_object(acpi_handle obj_handle,
index 7da639d62416d2049e98c67a84379b9244e56a66..fc305775c3d73c2e45a6d37a5fa0f7578a6a45f4 100644 (file)
@@ -139,7 +139,7 @@ acpi_ps_complete_final_op(struct acpi_walk_state *walk_state,
  */
 const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode);
 
-char *acpi_ps_get_opcode_name(u16 opcode);
+const char *acpi_ps_get_opcode_name(u16 opcode);
 
 u8 acpi_ps_get_argument_count(u32 op_type);
 
index 5dd58beafa5cc9f35510bea1fe1562c2ac1ba743..83e9a296c6eebab81f40139ca8941ec335b6728b 100644 (file)
@@ -124,7 +124,7 @@ typedef enum {
 typedef const struct acpi_rsdump_info {
        u8 opcode;
        u8 offset;
-       char *name;
+       const char *name;
        const char **pointer;
 
 } acpi_rsdump_info;
@@ -209,7 +209,7 @@ acpi_rs_get_prs_method_data(struct acpi_namespace_node *node,
 
 acpi_status
 acpi_rs_get_method_data(acpi_handle handle,
-                       char *path, struct acpi_buffer *ret_buffer);
+                       const char *path, struct acpi_buffer *ret_buffer);
 
 acpi_status
 acpi_rs_set_srs_method_data(struct acpi_namespace_node *node,
index b3b386e0b1194481741ae72c7ce2a6c727769e33..6235642e31d38af81c8605789f8391ab58ef26c2 100644 (file)
@@ -184,7 +184,7 @@ struct acpi_evaluate_info {
        /* The first 3 elements are passed by the caller to acpi_ns_evaluate */
 
        struct acpi_namespace_node *prefix_node;        /* Input: starting node */
-       char *relative_pathname;        /* Input: path relative to prefix_node */
+       const char *relative_pathname;  /* Input: path relative to prefix_node */
        union acpi_operand_object **parameters; /* Input: argument list */
 
        struct acpi_namespace_node *node;       /* Resolved node (prefix_node:relative_pathname) */
index 7422ff7bfb6d45f8f2ddbc483a7ca06614f94c2b..4ff971c4c9795d9d9eb9659163500e5230c0d1c6 100644 (file)
@@ -273,7 +273,8 @@ acpi_ut_trace(u32 line_number,
 void
 acpi_ut_trace_ptr(u32 line_number,
                  const char *function_name,
-                 const char *module_name, u32 component_id, void *pointer);
+                 const char *module_name,
+                 u32 component_id, const void *pointer);
 
 void
 acpi_ut_trace_u32(u32 line_number,
@@ -283,7 +284,8 @@ acpi_ut_trace_u32(u32 line_number,
 void
 acpi_ut_trace_str(u32 line_number,
                  const char *function_name,
-                 const char *module_name, u32 component_id, char *string);
+                 const char *module_name,
+                 u32 component_id, const char *string);
 
 void
 acpi_ut_exit(u32 line_number,
@@ -342,12 +344,12 @@ void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list);
  */
 acpi_status
 acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node,
-                       char *path,
+                       const char *path,
                        u32 expected_return_btypes,
                        union acpi_operand_object **return_desc);
 
 acpi_status
-acpi_ut_evaluate_numeric_object(char *object_name,
+acpi_ut_evaluate_numeric_object(const char *object_name,
                                struct acpi_namespace_node *device_node,
                                u64 *value);
 
@@ -533,7 +535,7 @@ void acpi_ut_set_integer_width(u8 revision);
 void
 acpi_ut_display_init_pathname(u8 type,
                              struct acpi_namespace_node *obj_handle,
-                             char *path);
+                             const char *path);
 #endif
 
 /*
@@ -635,7 +637,7 @@ void acpi_ut_dump_allocation_info(void);
 void acpi_ut_dump_allocations(u32 component, const char *module);
 
 acpi_status
-acpi_ut_create_list(char *list_name,
+acpi_ut_create_list(const char *list_name,
                    u16 object_size, struct acpi_memory_list **return_cache);
 
 #endif                         /* ACPI_DBG_TRACK_ALLOCATIONS */
index 417c02a899150131666cea221fa5968ce71ed783..f53cb30e0a09763c418d0d9573128ad4da884002 100644 (file)
@@ -57,12 +57,12 @@ static u32 acpi_db_get_line(char *input_buffer);
 
 static u32 acpi_db_match_command(char *user_command);
 
-static void acpi_db_display_command_info(char *command, u8 display_all);
+static void acpi_db_display_command_info(const char *command, u8 display_all);
 
 static void acpi_db_display_help(char *command);
 
 static u8
-acpi_db_match_command_help(char *command,
+acpi_db_match_command_help(const char *command,
                           const struct acpi_db_command_help *help);
 
 /*
@@ -348,7 +348,7 @@ static const struct acpi_db_command_help acpi_gbl_db_command_help[] = {
  ******************************************************************************/
 
 static u8
-acpi_db_match_command_help(char *command,
+acpi_db_match_command_help(const char *command,
                           const struct acpi_db_command_help *help)
 {
        char *invocation = help->invocation;
@@ -402,7 +402,7 @@ acpi_db_match_command_help(char *command,
  *
  ******************************************************************************/
 
-static void acpi_db_display_command_info(char *command, u8 display_all)
+static void acpi_db_display_command_info(const char *command, u8 display_all)
 {
        const struct acpi_db_command_help *next;
        u8 matched;
@@ -656,8 +656,9 @@ static u32 acpi_db_match_command(char *user_command)
        }
 
        for (i = CMD_FIRST_VALID; acpi_gbl_db_commands[i].name; i++) {
-               if (strstr(acpi_gbl_db_commands[i].name, user_command) ==
-                   acpi_gbl_db_commands[i].name) {
+               if (strstr
+                   (ACPI_CAST_PTR(char, acpi_gbl_db_commands[i].name),
+                    user_command) == acpi_gbl_db_commands[i].name) {
                        return (i);
                }
        }
index b37a2c77b86b5bd6c86b0499a262389b08145d0d..ae80106d100052da4ce5196be2fbeebac23488e7 100644 (file)
@@ -56,8 +56,6 @@ acpi_status acpi_db_second_pass_parse(union acpi_parse_object *root);
 void acpi_db_dump_buffer(u32 address);
 #endif
 
-static char *gbl_hex_to_ascii = "0123456789ABCDEF";
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_db_match_argument
@@ -82,8 +80,9 @@ acpi_db_match_argument(char *user_argument,
        }
 
        for (i = 0; arguments[i].name; i++) {
-               if (strstr(arguments[i].name, user_argument) ==
-                   arguments[i].name) {
+               if (strstr(ACPI_CAST_PTR(char, arguments[i].name),
+                          ACPI_CAST_PTR(char,
+                                        user_argument)) == arguments[i].name) {
                        return (i);
                }
        }
@@ -339,7 +338,7 @@ void acpi_db_uint32_to_hex_string(u32 value, char *buffer)
        buffer[8] = '\0';
 
        for (i = 7; i >= 0; i--) {
-               buffer[i] = gbl_hex_to_ascii[value & 0x0F];
+               buffer[i] = acpi_gbl_upper_hex_digits[value & 0x0F];
                value = value >> 4;
        }
 }
index 63924d1c737a0b303f999fa4de9f08cf5e12a89b..17d61c6a5b85ba50168dcdb57a5ba0c49cf9c10f 100644 (file)
@@ -538,7 +538,8 @@ acpi_ev_attach_region(union acpi_operand_object *handler_obj,
 
 void acpi_ev_associate_reg_method(union acpi_operand_object *region_obj)
 {
-       acpi_name *reg_name_ptr = (acpi_name *) METHOD_NAME__REG;
+       const acpi_name *reg_name_ptr =
+           ACPI_CAST_PTR(acpi_name, METHOD_NAME__REG);
        struct acpi_namespace_node *method_node;
        struct acpi_namespace_node *node;
        union acpi_operand_object *region_obj2;
index ee30974b245a581c0956ea002c81c5cd70ce2210..fce6b2e10209b01747ae2106f93cb2ad21f120af 100644 (file)
@@ -55,9 +55,9 @@ ACPI_MODULE_NAME("exdump")
  */
 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
 /* Local prototypes */
-static void acpi_ex_out_string(char *title, char *value);
+static void acpi_ex_out_string(const char *title, const char *value);
 
-static void acpi_ex_out_pointer(char *title, void *value);
+static void acpi_ex_out_pointer(const char *title, const void *value);
 
 static void
 acpi_ex_dump_object(union acpi_operand_object *obj_desc,
@@ -365,8 +365,7 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc,
                    struct acpi_exdump_info *info)
 {
        u8 *target;
-       char *name;
-       const char *reference_name;
+       const char *name;
        u8 count;
        union acpi_operand_object *start;
        union acpi_operand_object *data = NULL;
@@ -459,9 +458,9 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc,
 
                case ACPI_EXD_REFERENCE:
 
-                       reference_name = acpi_ut_get_reference_name(obj_desc);
                        acpi_ex_out_string("Class Name",
-                                          ACPI_CAST_PTR(char, reference_name));
+                                          acpi_ut_get_reference_name
+                                          (obj_desc));
                        acpi_ex_dump_reference_obj(obj_desc);
                        break;
 
@@ -934,12 +933,12 @@ acpi_ex_dump_operands(union acpi_operand_object **operands,
  *
  ******************************************************************************/
 
-static void acpi_ex_out_string(char *title, char *value)
+static void acpi_ex_out_string(const char *title, const char *value)
 {
        acpi_os_printf("%20s : %s\n", title, value);
 }
 
-static void acpi_ex_out_pointer(char *title, void *value)
+static void acpi_ex_out_pointer(const char *title, const void *value)
 {
        acpi_os_printf("%20s : %p\n", title, value);
 }
index a01ddb393a55c92aecc66053acacba1f06116527..7caaaf3b8787dbdce1bbcdb476920a86d556151e 100644 (file)
@@ -504,9 +504,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
         * Evaluate the \_Sx namespace object containing the register values
         * for this state
         */
-       info->relative_pathname = ACPI_CAST_PTR(char,
-                                               acpi_gbl_sleep_state_names
-                                               [sleep_state]);
+       info->relative_pathname = acpi_gbl_sleep_state_names[sleep_state];
 
        status = acpi_ns_evaluate(info);
        if (ACPI_FAILURE(status)) {
index 697af810e5ad480caf3780d0097eb649e6fb5ebf..426a6307eafaebb7165436e760a15b46882153c4 100644 (file)
@@ -107,9 +107,10 @@ acpi_status acpi_ns_root_initialize(void)
                        continue;
                }
 
-               status = acpi_ns_lookup(NULL, init_val->name, init_val->type,
-                                       ACPI_IMODE_LOAD_PASS2,
-                                       ACPI_NS_NO_UPSEARCH, NULL, &new_node);
+               status =
+                   acpi_ns_lookup(NULL, (char *)init_val->name, init_val->type,
+                                  ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH,
+                                  NULL, &new_node);
                if (ACPI_FAILURE(status)) {
                        ACPI_EXCEPTION((AE_INFO, status,
                                        "Could not create predefined name %s",
index af236e348294cf450c579c6519557d3aa273c310..ce1f8605d996c8c594ac49b29e96bd475c9f0b1a 100644 (file)
@@ -81,7 +81,7 @@ acpi_ns_get_max_depth(acpi_handle obj_handle,
  *
  ******************************************************************************/
 
-void acpi_ns_print_pathname(u32 num_segments, char *pathname)
+void acpi_ns_print_pathname(u32 num_segments, const char *pathname)
 {
        u32 i;
 
@@ -114,6 +114,9 @@ void acpi_ns_print_pathname(u32 num_segments, char *pathname)
        acpi_os_printf("]\n");
 }
 
+#ifdef ACPI_OBSOLETE_FUNCTIONS
+/* Not used at this time, perhaps later */
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ns_dump_pathname
@@ -131,7 +134,8 @@ void acpi_ns_print_pathname(u32 num_segments, char *pathname)
  ******************************************************************************/
 
 void
-acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component)
+acpi_ns_dump_pathname(acpi_handle handle,
+                     const char *msg, u32 level, u32 component)
 {
 
        ACPI_FUNCTION_TRACE(ns_dump_pathname);
@@ -148,6 +152,7 @@ acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component)
        acpi_os_printf("\n");
        return_VOID;
 }
+#endif
 
 /*******************************************************************************
  *
index cfd17a4f2e91badda16dee6a7d98ffc116271399..177b05b239b701235105dbfcd746de7fbe2a553b 100644 (file)
@@ -158,7 +158,7 @@ const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode)
  *
  ******************************************************************************/
 
-char *acpi_ps_get_opcode_name(u16 opcode)
+const char *acpi_ps_get_opcode_name(u16 opcode)
 {
 #if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUG_OUTPUT)
 
index 23a17c86d5a9fdfc7be6c17c0bc612478e297216..5ffdb5602d8db31d2c06776e4f5846252f1129da 100644 (file)
@@ -52,17 +52,17 @@ ACPI_MODULE_NAME("rsdump")
  * All functions in this module are used by the AML Debugger only
  */
 /* Local prototypes */
-static void acpi_rs_out_string(char *title, char *value);
+static void acpi_rs_out_string(const char *title, const char *value);
 
-static void acpi_rs_out_integer8(char *title, u8 value);
+static void acpi_rs_out_integer8(const char *title, u8 value);
 
-static void acpi_rs_out_integer16(char *title, u16 value);
+static void acpi_rs_out_integer16(const char *title, u16 value);
 
-static void acpi_rs_out_integer32(char *title, u32 value);
+static void acpi_rs_out_integer32(const char *title, u32 value);
 
-static void acpi_rs_out_integer64(char *title, u64 value);
+static void acpi_rs_out_integer64(const char *title, u64 value);
 
-static void acpi_rs_out_title(char *title);
+static void acpi_rs_out_title(const char *title);
 
 static void acpi_rs_dump_byte_list(u16 length, u8 *data);
 
@@ -208,7 +208,7 @@ acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table)
 {
        u8 *target = NULL;
        u8 *previous_target;
-       char *name;
+       const char *name;
        u8 count;
 
        /* First table entry must contain the table length (# of table entries) */
@@ -248,10 +248,8 @@ acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table)
                case ACPI_RSD_UINT8:
 
                        if (table->pointer) {
-                               acpi_rs_out_string(name, ACPI_CAST_PTR(char,
-                                                                      table->
-                                                                      pointer
-                                                                      [*target]));
+                               acpi_rs_out_string(name,
+                                                  table->pointer[*target]);
                        } else {
                                acpi_rs_out_integer8(name, ACPI_GET8(target));
                        }
@@ -276,26 +274,20 @@ acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table)
 
                case ACPI_RSD_1BITFLAG:
 
-                       acpi_rs_out_string(name, ACPI_CAST_PTR(char,
-                                                              table->
-                                                              pointer[*target &
-                                                                      0x01]));
+                       acpi_rs_out_string(name,
+                                          table->pointer[*target & 0x01]);
                        break;
 
                case ACPI_RSD_2BITFLAG:
 
-                       acpi_rs_out_string(name, ACPI_CAST_PTR(char,
-                                                              table->
-                                                              pointer[*target &
-                                                                      0x03]));
+                       acpi_rs_out_string(name,
+                                          table->pointer[*target & 0x03]);
                        break;
 
                case ACPI_RSD_3BITFLAG:
 
-                       acpi_rs_out_string(name, ACPI_CAST_PTR(char,
-                                                              table->
-                                                              pointer[*target &
-                                                                      0x07]));
+                       acpi_rs_out_string(name,
+                                          table->pointer[*target & 0x07]);
                        break;
 
                case ACPI_RSD_SHORTLIST:
@@ -481,7 +473,7 @@ static void acpi_rs_dump_address_common(union acpi_resource_data *resource)
  *
  ******************************************************************************/
 
-static void acpi_rs_out_string(char *title, char *value)
+static void acpi_rs_out_string(const char *title, const char *value)
 {
 
        acpi_os_printf("%27s : %s", title, value);
@@ -491,30 +483,30 @@ static void acpi_rs_out_string(char *title, char *value)
        acpi_os_printf("\n");
 }
 
-static void acpi_rs_out_integer8(char *title, u8 value)
+static void acpi_rs_out_integer8(const char *title, u8 value)
 {
        acpi_os_printf("%27s : %2.2X\n", title, value);
 }
 
-static void acpi_rs_out_integer16(char *title, u16 value)
+static void acpi_rs_out_integer16(const char *title, u16 value)
 {
 
        acpi_os_printf("%27s : %4.4X\n", title, value);
 }
 
-static void acpi_rs_out_integer32(char *title, u32 value)
+static void acpi_rs_out_integer32(const char *title, u32 value)
 {
 
        acpi_os_printf("%27s : %8.8X\n", title, value);
 }
 
-static void acpi_rs_out_integer64(char *title, u64 value)
+static void acpi_rs_out_integer64(const char *title, u64 value)
 {
 
        acpi_os_printf("%27s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64(value));
 }
 
-static void acpi_rs_out_title(char *title)
+static void acpi_rs_out_title(const char *title)
 {
 
        acpi_os_printf("%27s : ", title);
index cf06e49cd91c396237e5f96bb856f12daa6867c2..e0d60239d6ff46e4965079ffa6b159dc60a5e536 100644 (file)
@@ -671,7 +671,7 @@ acpi_rs_get_aei_method_data(struct acpi_namespace_node *node,
 
 acpi_status
 acpi_rs_get_method_data(acpi_handle handle,
-                       char *path, struct acpi_buffer *ret_buffer)
+                       const char *path, struct acpi_buffer *ret_buffer)
 {
        union acpi_operand_object *obj_desc;
        acpi_status status;
index f63f3fd0d9321246f1261e8fa8fe196d9d83c0df..635d9513994d425e035742386c3818a582f8b18f 100644 (file)
@@ -53,7 +53,7 @@ static void
 acpi_tb_init_generic_address(struct acpi_generic_address *generic_address,
                             u8 space_id,
                             u8 byte_width,
-                            u64 address, char *register_name, u8 flags);
+                            u64 address, const char *register_name, u8 flags);
 
 static void acpi_tb_convert_fadt(void);
 
@@ -65,7 +65,7 @@ acpi_tb_select_address(char *register_name, u32 address32, u64 address64);
 /* Table for conversion of FADT to common internal format and FADT validation */
 
 typedef struct acpi_fadt_info {
-       char *name;
+       const char *name;
        u16 address64;
        u16 address32;
        u16 length;
@@ -192,7 +192,7 @@ static void
 acpi_tb_init_generic_address(struct acpi_generic_address *generic_address,
                             u8 space_id,
                             u8 byte_width,
-                            u64 address, char *register_name, u8 flags)
+                            u64 address, const char *register_name, u8 flags)
 {
        u8 bit_width;
 
@@ -468,7 +468,7 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
 
 static void acpi_tb_convert_fadt(void)
 {
-       char *name;
+       const char *name;
        struct acpi_generic_address *address64;
        u32 address32;
        u8 length;
index 1cfc5f69b0338048b1a76ac736543a21a95ac4fc..5744222050052b9ad29f4bdbd0ec5864654ec007 100644 (file)
 ACPI_MODULE_NAME("utdebug")
 
 #ifdef ACPI_DEBUG_OUTPUT
-static acpi_thread_id acpi_gbl_prev_thread_id = (acpi_thread_id) 0xFFFFFFFF;
-static char *acpi_gbl_fn_entry_str = "----Entry";
-static char *acpi_gbl_fn_exit_str = "----Exit-";
-
-/* Local prototypes */
-
-static const char *acpi_ut_trim_function_name(const char *function_name);
+static acpi_thread_id acpi_gbl_previous_thread_id = (acpi_thread_id) 0xFFFFFFFF;
+static const char *acpi_gbl_function_entry_prefix = "----Entry";
+static const char *acpi_gbl_function_exit_prefix = "----Exit-";
 
 /*******************************************************************************
  *
@@ -178,14 +174,14 @@ acpi_debug_print(u32 requested_debug_level,
         * Thread tracking and context switch notification
         */
        thread_id = acpi_os_get_thread_id();
-       if (thread_id != acpi_gbl_prev_thread_id) {
+       if (thread_id != acpi_gbl_previous_thread_id) {
                if (ACPI_LV_THREADS & acpi_dbg_level) {
                        acpi_os_printf
                            ("\n**** Context Switch from TID %u to TID %u ****\n\n",
-                            (u32)acpi_gbl_prev_thread_id, (u32)thread_id);
+                            (u32)acpi_gbl_previous_thread_id, (u32)thread_id);
                }
 
-               acpi_gbl_prev_thread_id = thread_id;
+               acpi_gbl_previous_thread_id = thread_id;
                acpi_gbl_nesting_level = 0;
        }
 
@@ -287,7 +283,8 @@ acpi_ut_trace(u32 line_number,
        if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
                acpi_debug_print(ACPI_LV_FUNCTIONS,
                                 line_number, function_name, module_name,
-                                component_id, "%s\n", acpi_gbl_fn_entry_str);
+                                component_id, "%s\n",
+                                acpi_gbl_function_entry_prefix);
        }
 }
 
@@ -312,7 +309,8 @@ ACPI_EXPORT_SYMBOL(acpi_ut_trace)
 void
 acpi_ut_trace_ptr(u32 line_number,
                  const char *function_name,
-                 const char *module_name, u32 component_id, void *pointer)
+                 const char *module_name,
+                 u32 component_id, const void *pointer)
 {
 
        acpi_gbl_nesting_level++;
@@ -323,8 +321,8 @@ acpi_ut_trace_ptr(u32 line_number,
        if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
                acpi_debug_print(ACPI_LV_FUNCTIONS,
                                 line_number, function_name, module_name,
-                                component_id, "%s %p\n", acpi_gbl_fn_entry_str,
-                                pointer);
+                                component_id, "%s %p\n",
+                                acpi_gbl_function_entry_prefix, pointer);
        }
 }
 
@@ -348,7 +346,7 @@ acpi_ut_trace_ptr(u32 line_number,
 void
 acpi_ut_trace_str(u32 line_number,
                  const char *function_name,
-                 const char *module_name, u32 component_id, char *string)
+                 const char *module_name, u32 component_id, const char *string)
 {
 
        acpi_gbl_nesting_level++;
@@ -359,8 +357,8 @@ acpi_ut_trace_str(u32 line_number,
        if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
                acpi_debug_print(ACPI_LV_FUNCTIONS,
                                 line_number, function_name, module_name,
-                                component_id, "%s %s\n", acpi_gbl_fn_entry_str,
-                                string);
+                                component_id, "%s %s\n",
+                                acpi_gbl_function_entry_prefix, string);
        }
 }
 
@@ -396,7 +394,7 @@ acpi_ut_trace_u32(u32 line_number,
                acpi_debug_print(ACPI_LV_FUNCTIONS,
                                 line_number, function_name, module_name,
                                 component_id, "%s %08X\n",
-                                acpi_gbl_fn_entry_str, integer);
+                                acpi_gbl_function_entry_prefix, integer);
        }
 }
 
@@ -427,7 +425,8 @@ acpi_ut_exit(u32 line_number,
        if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
                acpi_debug_print(ACPI_LV_FUNCTIONS,
                                 line_number, function_name, module_name,
-                                component_id, "%s\n", acpi_gbl_fn_exit_str);
+                                component_id, "%s\n",
+                                acpi_gbl_function_exit_prefix);
        }
 
        if (acpi_gbl_nesting_level) {
@@ -467,14 +466,14 @@ acpi_ut_status_exit(u32 line_number,
                        acpi_debug_print(ACPI_LV_FUNCTIONS,
                                         line_number, function_name,
                                         module_name, component_id, "%s %s\n",
-                                        acpi_gbl_fn_exit_str,
+                                        acpi_gbl_function_exit_prefix,
                                         acpi_format_exception(status));
                } else {
                        acpi_debug_print(ACPI_LV_FUNCTIONS,
                                         line_number, function_name,
                                         module_name, component_id,
                                         "%s ****Exception****: %s\n",
-                                        acpi_gbl_fn_exit_str,
+                                        acpi_gbl_function_exit_prefix,
                                         acpi_format_exception(status));
                }
        }
@@ -514,7 +513,7 @@ acpi_ut_value_exit(u32 line_number,
                acpi_debug_print(ACPI_LV_FUNCTIONS,
                                 line_number, function_name, module_name,
                                 component_id, "%s %8.8X%8.8X\n",
-                                acpi_gbl_fn_exit_str,
+                                acpi_gbl_function_exit_prefix,
                                 ACPI_FORMAT_UINT64(value));
        }
 
@@ -552,8 +551,8 @@ acpi_ut_ptr_exit(u32 line_number,
        if (ACPI_IS_DEBUG_ENABLED(ACPI_LV_FUNCTIONS, component_id)) {
                acpi_debug_print(ACPI_LV_FUNCTIONS,
                                 line_number, function_name, module_name,
-                                component_id, "%s %p\n", acpi_gbl_fn_exit_str,
-                                ptr);
+                                component_id, "%s %p\n",
+                                acpi_gbl_function_exit_prefix, ptr);
        }
 
        if (acpi_gbl_nesting_level) {
index 17b9f3e6e1e1a7d321a723a43077ab599b314c7f..7bad13f2e518a184f8fd79c7b09512af3b5a7abf 100644 (file)
@@ -69,7 +69,7 @@ ACPI_MODULE_NAME("uteval")
 
 acpi_status
 acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node,
-                       char *path,
+                       const char *path,
                        u32 expected_return_btypes,
                        union acpi_operand_object **return_desc)
 {
@@ -204,7 +204,7 @@ cleanup:
  ******************************************************************************/
 
 acpi_status
-acpi_ut_evaluate_numeric_object(char *object_name,
+acpi_ut_evaluate_numeric_object(const char *object_name,
                                struct acpi_namespace_node *device_node,
                                u64 *value)
 {
index d45899c17d4ec3a13adead0d158be17512f39e94..dd3fd7f97f8e2520fffeb17495c879e314845ed0 100644 (file)
@@ -80,6 +80,11 @@ const char *acpi_gbl_highest_dstate_names[ACPI_NUM_sx_d_METHODS] = {
        "_S4D"
 };
 
+/* Hex-to-ascii */
+
+const char acpi_gbl_lower_hex_digits[] = "0123456789abcdef";
+const char acpi_gbl_upper_hex_digits[] = "0123456789ABCDEF";
+
 /*******************************************************************************
  *
  * Namespace globals
index d938c27cc6cf495fbeed499eafc23af80faa5ede..389de3bd1ff1fa2c27b511d1671d9b43c9a2fae0 100644 (file)
@@ -361,7 +361,7 @@ acpi_ut_walk_package_tree(union acpi_operand_object *source_object,
 void
 acpi_ut_display_init_pathname(u8 type,
                              struct acpi_namespace_node *obj_handle,
-                             char *path)
+                             const char *path)
 {
        acpi_status status;
        struct acpi_buffer buffer;
index 8c218ad787cdf57daa6fc2711cdfb7568ace70da..208d71aa9f50aa1e510e54f348de3a28dd2e67aa 100644 (file)
@@ -67,11 +67,6 @@ static char *acpi_ut_format_number(char *string,
 
 static char *acpi_ut_put_number(char *string, u64 number, u8 base, u8 upper);
 
-/* Module globals */
-
-static const char acpi_gbl_lower_hex_digits[] = "0123456789abcdef";
-static const char acpi_gbl_upper_hex_digits[] = "0123456789ABCDEF";
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ut_bound_string_length
index 60c406a8efcb3b533b6d2fd1f1f5c9f75f13831e..0df07dfa53b6acccdce504f8b69de283f61677dc 100644 (file)
@@ -90,7 +90,7 @@ acpi_ut_remove_allocation(struct acpi_debug_mem_block *address,
  ******************************************************************************/
 
 acpi_status
-acpi_ut_create_list(char *list_name,
+acpi_ut_create_list(const char *list_name,
                    u16 object_size, struct acpi_memory_list **return_cache)
 {
        struct acpi_memory_list *cache;
index 140886e4973fab16ae1a81d6d71af630cb19085a..b9a8b72e297c5a172a7d6234d847762629838d1c 100644 (file)
@@ -995,7 +995,7 @@ struct acpi_buffer {
  * Predefined Namespace items
  */
 struct acpi_predefined_names {
-       char *name;
+       const char *name;
        u8 type;
        char *val;
 };
@@ -1228,7 +1228,7 @@ struct acpi_mem_space_context {
  * struct acpi_memory_list is used only if the ACPICA local cache is enabled
  */
 struct acpi_memory_list {
-       char *list_name;
+       const char *list_name;
        void *list_head;
        u16 object_size;
        u16 max_depth;