Skip to content

Commit

Permalink
ACPICA: Eliminate acpi_native_uint type v2
Browse files Browse the repository at this point in the history
No longer needed; replaced mostly with u32, but also acpi_size
where a type that changes 32/64 bit on 32/64-bit platforms is
required.

v2: Fix a cast of a 32-bit int to a pointer in ACPI to avoid a compiler warning.
from David Howells

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
  • Loading branch information
Bob Moore authored and Andi Kleen committed Jul 16, 2008
1 parent 11f2a61 commit 67a119f
Show file tree
Hide file tree
Showing 48 changed files with 206 additions and 221 deletions.
2 changes: 1 addition & 1 deletion drivers/acpi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ static int __init acpi_bus_init_irq(void)
return 0;
}

acpi_native_uint acpi_gbl_permanent_mmap;
u8 acpi_gbl_permanent_mmap;


void __init acpi_early_init(void)
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/dispatcher/dsinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ acpi_ds_init_one_object(acpi_handle obj_handle,
******************************************************************************/

acpi_status
acpi_ds_initialize_objects(acpi_native_uint table_index,
acpi_ds_initialize_objects(u32 table_index,
struct acpi_namespace_node * start_node)
{
acpi_status status;
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/dispatcher/dsopcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
union acpi_operand_object **operand;
struct acpi_namespace_node *node;
union acpi_parse_object *next_op;
acpi_native_uint table_index;
u32 table_index;
struct acpi_table_header *table;

ACPI_FUNCTION_TRACE_PTR(ds_eval_table_region_operands, op);
Expand Down
10 changes: 5 additions & 5 deletions drivers/acpi/dispatcher/dswstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ acpi_status
acpi_ds_result_pop(union acpi_operand_object **object,
struct acpi_walk_state *walk_state)
{
acpi_native_uint index;
u32 index;
union acpi_generic_state *state;
acpi_status status;

Expand Down Expand Up @@ -122,7 +122,7 @@ acpi_ds_result_pop(union acpi_operand_object **object,
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
"Obj=%p [%s] Index=%X State=%p Num=%X\n", *object,
acpi_ut_get_object_type_name(*object),
(u32) index, walk_state, walk_state->result_count));
index, walk_state, walk_state->result_count));

return (AE_OK);
}
Expand All @@ -146,7 +146,7 @@ acpi_ds_result_push(union acpi_operand_object * object,
{
union acpi_generic_state *state;
acpi_status status;
acpi_native_uint index;
u32 index;

ACPI_FUNCTION_NAME(ds_result_push);

Expand Down Expand Up @@ -400,7 +400,7 @@ void
acpi_ds_obj_stack_pop_and_delete(u32 pop_count,
struct acpi_walk_state *walk_state)
{
acpi_native_int i;
s32 i;
union acpi_operand_object *obj_desc;

ACPI_FUNCTION_NAME(ds_obj_stack_pop_and_delete);
Expand All @@ -409,7 +409,7 @@ acpi_ds_obj_stack_pop_and_delete(u32 pop_count,
return;
}

for (i = (acpi_native_int) (pop_count - 1); i >= 0; i--) {
for (i = (s32) pop_count - 1; i >= 0; i--) {
if (walk_state->num_operands == 0) {
return;
}
Expand Down
6 changes: 3 additions & 3 deletions drivers/acpi/events/evevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ acpi_status acpi_ev_install_xrupt_handlers(void)

static acpi_status acpi_ev_fixed_event_initialize(void)
{
acpi_native_uint i;
u32 i;
acpi_status status;

/*
Expand Down Expand Up @@ -231,7 +231,7 @@ u32 acpi_ev_fixed_event_detect(void)
u32 int_status = ACPI_INTERRUPT_NOT_HANDLED;
u32 fixed_status;
u32 fixed_enable;
acpi_native_uint i;
u32 i;

ACPI_FUNCTION_NAME(ev_fixed_event_detect);

Expand Down Expand Up @@ -260,7 +260,7 @@ u32 acpi_ev_fixed_event_detect(void)

/* Found an active (signalled) event */
acpi_os_fixed_event_count(i);
int_status |= acpi_ev_fixed_event_dispatch((u32) i);
int_status |= acpi_ev_fixed_event_dispatch(i);
}
}

Expand Down
14 changes: 4 additions & 10 deletions drivers/acpi/events/evgpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
{
union acpi_operand_object *obj_desc;
struct acpi_gpe_block_info *gpe_block;
acpi_native_uint i;
u32 i;

ACPI_FUNCTION_ENTRY();

Expand Down Expand Up @@ -389,8 +389,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
u32 status_reg;
u32 enable_reg;
acpi_cpu_flags flags;
acpi_native_uint i;
acpi_native_uint j;
u32 i;
u32 j;

ACPI_FUNCTION_NAME(ev_gpe_detect);

Expand Down Expand Up @@ -472,13 +472,7 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
*/
int_status |=
acpi_ev_gpe_dispatch(&gpe_block->
event_info[(i *
ACPI_GPE_REGISTER_WIDTH)
+
j],
(u32) j +
gpe_register_info->
base_gpe_number);
event_info[((acpi_size) i * ACPI_GPE_REGISTER_WIDTH) + j], j + gpe_register_info->base_gpe_number);
}
}
}
Expand Down
18 changes: 10 additions & 8 deletions drivers/acpi/events/evgpeblk.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
struct acpi_gpe_block_info *gpe_block)
{
struct acpi_gpe_event_info *gpe_event_info;
acpi_native_uint i;
acpi_native_uint j;
u32 i;
u32 j;

ACPI_FUNCTION_TRACE(ev_delete_gpe_handlers);

Expand All @@ -203,7 +203,8 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) {
gpe_event_info =
&gpe_block->
event_info[(i * ACPI_GPE_REGISTER_WIDTH) + j];
event_info[((acpi_size) i *
ACPI_GPE_REGISTER_WIDTH) + j];

if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) ==
ACPI_GPE_DISPATCH_HANDLER) {
Expand Down Expand Up @@ -744,8 +745,8 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
struct acpi_gpe_event_info *gpe_event_info = NULL;
struct acpi_gpe_event_info *this_event;
struct acpi_gpe_register_info *this_register;
acpi_native_uint i;
acpi_native_uint j;
u32 i;
u32 j;
acpi_status status;

ACPI_FUNCTION_TRACE(ev_create_gpe_info_blocks);
Expand Down Expand Up @@ -983,8 +984,8 @@ acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,
struct acpi_gpe_walk_info gpe_info;
u32 wake_gpe_count;
u32 gpe_enabled_count;
acpi_native_uint i;
acpi_native_uint j;
u32 i;
u32 j;

ACPI_FUNCTION_TRACE(ev_initialize_gpe_block);

Expand Down Expand Up @@ -1033,7 +1034,8 @@ acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,

gpe_event_info =
&gpe_block->
event_info[(i * ACPI_GPE_REGISTER_WIDTH) + j];
event_info[((acpi_size) i *
ACPI_GPE_REGISTER_WIDTH) + j];

if (((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) ==
ACPI_GPE_DISPATCH_METHOD)
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/events/evmisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ acpi_status acpi_ev_release_global_lock(void)

void acpi_ev_terminate(void)
{
acpi_native_uint i;
u32 i;
acpi_status status;

ACPI_FUNCTION_TRACE(ev_terminate);
Expand All @@ -589,7 +589,7 @@ void acpi_ev_terminate(void)
/* Disable all fixed events */

for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
status = acpi_disable_event((u32) i, 0);
status = acpi_disable_event(i, 0);
if (ACPI_FAILURE(status)) {
ACPI_ERROR((AE_INFO,
"Could not disable fixed event %d",
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/events/evregion.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ acpi_ev_install_handler(acpi_handle obj_handle,
acpi_status acpi_ev_install_region_handlers(void)
{
acpi_status status;
acpi_native_uint i;
u32 i;

ACPI_FUNCTION_TRACE(ev_install_region_handlers);

Expand Down Expand Up @@ -151,7 +151,7 @@ acpi_status acpi_ev_install_region_handlers(void)
acpi_status acpi_ev_initialize_op_regions(void)
{
acpi_status status;
acpi_native_uint i;
u32 i;

ACPI_FUNCTION_TRACE(ev_initialize_op_regions);

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/events/evrgnini.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node)
acpi_status status;
struct acpica_device_id hid;
struct acpi_compatible_id_list *cid;
acpi_native_uint i;
u32 i;

/*
* Get the _HID and check for a PCI Root Bridge
Expand Down
17 changes: 9 additions & 8 deletions drivers/acpi/executer/exconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ACPI_MODULE_NAME("exconfig")

/* Local prototypes */
static acpi_status
acpi_ex_add_table(acpi_native_uint table_index,
acpi_ex_add_table(u32 table_index,
struct acpi_namespace_node *parent_node,
union acpi_operand_object **ddb_handle);

Expand All @@ -73,7 +73,7 @@ acpi_ex_add_table(acpi_native_uint table_index,
******************************************************************************/

static acpi_status
acpi_ex_add_table(acpi_native_uint table_index,
acpi_ex_add_table(u32 table_index,
struct acpi_namespace_node *parent_node,
union acpi_operand_object **ddb_handle)
{
Expand All @@ -96,7 +96,8 @@ acpi_ex_add_table(acpi_native_uint table_index,

/* Install the new table into the local data structures */

obj_desc->reference.object = ACPI_CAST_PTR(void, table_index);
obj_desc->reference.object = ACPI_CAST_PTR(void,
(unsigned long)table_index);

/* Add the table to the namespace */

Expand Down Expand Up @@ -128,12 +129,12 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
{
acpi_status status;
union acpi_operand_object **operand = &walk_state->operands[0];
acpi_native_uint table_index;
struct acpi_namespace_node *parent_node;
struct acpi_namespace_node *start_node;
struct acpi_namespace_node *parameter_node = NULL;
union acpi_operand_object *ddb_handle;
struct acpi_table_header *table;
u32 table_index;

ACPI_FUNCTION_TRACE(ex_load_table_op);

Expand Down Expand Up @@ -280,7 +281,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
{
union acpi_operand_object *ddb_handle;
struct acpi_table_desc table_desc;
acpi_native_uint table_index;
u32 table_index;
acpi_status status;
u32 length;

Expand Down Expand Up @@ -437,7 +438,7 @@ acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle)
{
acpi_status status = AE_OK;
union acpi_operand_object *table_desc = ddb_handle;
acpi_native_uint table_index;
u32 table_index;
struct acpi_table_header *table;

ACPI_FUNCTION_TRACE(ex_unload_table);
Expand All @@ -454,9 +455,9 @@ acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle)
return_ACPI_STATUS(AE_BAD_PARAMETER);
}

/* Get the table index from the ddb_handle */
/* Get the table index from the ddb_handle (acpi_size for 64-bit case) */

table_index = (acpi_native_uint) table_desc->reference.object;
table_index = (u32) (acpi_size) table_desc->reference.object;

/* Invoke table handler if present */

Expand Down
12 changes: 6 additions & 6 deletions drivers/acpi/executer/exconvrt.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,11 @@ acpi_ex_convert_to_ascii(acpi_integer integer,
u16 base, u8 * string, u8 data_width)
{
acpi_integer digit;
acpi_native_uint i;
acpi_native_uint j;
acpi_native_uint k = 0;
acpi_native_uint hex_length;
acpi_native_uint decimal_length;
u32 i;
u32 j;
u32 k = 0;
u32 hex_length;
u32 decimal_length;
u32 remainder;
u8 supress_zeros;

Expand Down Expand Up @@ -348,7 +348,7 @@ acpi_ex_convert_to_ascii(acpi_integer integer,

/* hex_length: 2 ascii hex chars per data byte */

hex_length = (acpi_native_uint) ACPI_MUL_2(data_width);
hex_length = ACPI_MUL_2(data_width);
for (i = 0, j = (hex_length - 1); i < hex_length; i++, j--) {

/* Get one hex digit, most significant digits first */
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/executer/exdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ acpi_ex_dump_operands(union acpi_operand_object **operands,
u32 num_levels,
char *note, char *module_name, u32 line_number)
{
acpi_native_uint i;
u32 i;

ACPI_FUNCTION_NAME(ex_dump_operands);

Expand Down
9 changes: 5 additions & 4 deletions drivers/acpi/executer/exfldio.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,15 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
/*
* Slack mode only: We will go ahead and allow access to this
* field if it is within the region length rounded up to the next
* access width boundary.
* access width boundary. acpi_size cast for 64-bit compile.
*/
if (ACPI_ROUND_UP(rgn_desc->region.length,
obj_desc->common_field.
access_byte_width) >=
(obj_desc->common_field.base_byte_offset +
(acpi_native_uint) obj_desc->common_field.
access_byte_width + field_datum_byte_offset)) {
((acpi_size) obj_desc->common_field.
base_byte_offset +
obj_desc->common_field.access_byte_width +
field_datum_byte_offset)) {
return_ACPI_STATUS(AE_OK);
}
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/acpi/executer/exmisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0,

/* Result of two Strings is a String */

return_desc = acpi_ut_create_string_object((acpi_size)
(operand0->string.
return_desc = acpi_ut_create_string_object(((acpi_size)
operand0->string.
length +
local_operand1->
string.length));
Expand All @@ -352,8 +352,8 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0,

/* Result of two Buffers is a Buffer */

return_desc = acpi_ut_create_buffer_object((acpi_size)
(operand0->buffer.
return_desc = acpi_ut_create_buffer_object(((acpi_size)
operand0->buffer.
length +
local_operand1->
buffer.length));
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/executer/exregion.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ acpi_ex_system_memory_space_handler(u32 function,
/* Create a new mapping starting at the address given */

mem_info->mapped_logical_address =
acpi_os_map_memory((acpi_native_uint) address, window_size);
acpi_os_map_memory((acpi_physical_address) address, window_size);
if (!mem_info->mapped_logical_address) {
ACPI_ERROR((AE_INFO,
"Could not map memory at %8.8X%8.8X, size %X",
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/namespace/nsdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ acpi_ns_dump_one_device(acpi_handle obj_handle,

void acpi_ns_print_pathname(u32 num_segments, char *pathname)
{
acpi_native_uint i;
u32 i;

ACPI_FUNCTION_NAME(ns_print_pathname);

Expand Down
Loading

0 comments on commit 67a119f

Please sign in to comment.