Skip to content

Commit

Permalink
ACPICA: All: const keyword changes across the ACPICA source
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bob Moore authored and Rafael J. Wysocki committed Apr 5, 2016
1 parent 3a05be7 commit 0dfaaa3
Show file tree
Hide file tree
Showing 26 changed files with 113 additions and 113 deletions.
4 changes: 2 additions & 2 deletions drivers/acpi/acpica/acdebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
};

Expand All @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions drivers/acpi/acpica/acglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/acinterp.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
typedef const struct acpi_exdump_info {
u8 opcode;
u8 offset;
char *name;
const char *name;

} acpi_exdump_info;

Expand Down
5 changes: 3 additions & 2 deletions drivers/acpi/acpica/acnamesp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/acparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/acpica/acresrc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/acstruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
Expand Down
14 changes: 8 additions & 6 deletions drivers/acpi/acpica/acutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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

/*
Expand Down Expand Up @@ -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 */
Expand Down
13 changes: 7 additions & 6 deletions drivers/acpi/acpica/dbinput.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
Expand Down
9 changes: 4 additions & 5 deletions drivers/acpi/acpica/dbutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
}
Expand Down Expand Up @@ -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;
}
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/acpi/acpica/evregion.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
15 changes: 7 additions & 8 deletions drivers/acpi/acpica/exdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
Expand Down
4 changes: 1 addition & 3 deletions drivers/acpi/acpica/hwxface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
7 changes: 4 additions & 3 deletions drivers/acpi/acpica/nsaccess.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 7 additions & 2 deletions drivers/acpi/acpica/nsdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand All @@ -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);
Expand All @@ -148,6 +152,7 @@ acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component)
acpi_os_printf("\n");
return_VOID;
}
#endif

/*******************************************************************************
*
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/psopinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Loading

0 comments on commit 0dfaaa3

Please sign in to comment.