ACPICA: Eliminate acpi_native_uint type v2
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>
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index a6dbcf4..afb3438 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -612,7 +612,7 @@
return 0;
}
-acpi_native_uint acpi_gbl_permanent_mmap;
+u8 acpi_gbl_permanent_mmap;
void __init acpi_early_init(void)
diff --git a/drivers/acpi/dispatcher/dsinit.c b/drivers/acpi/dispatcher/dsinit.c
index 610b1ee..949f7c75 100644
--- a/drivers/acpi/dispatcher/dsinit.c
+++ b/drivers/acpi/dispatcher/dsinit.c
@@ -151,7 +151,7 @@
******************************************************************************/
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;
diff --git a/drivers/acpi/dispatcher/dsopcode.c b/drivers/acpi/dispatcher/dsopcode.c
index a818e0d..ac0bfb1 100644
--- a/drivers/acpi/dispatcher/dsopcode.c
+++ b/drivers/acpi/dispatcher/dsopcode.c
@@ -848,7 +848,7 @@
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);
diff --git a/drivers/acpi/dispatcher/dswstate.c b/drivers/acpi/dispatcher/dswstate.c
index bda23ed..b00d4af 100644
--- a/drivers/acpi/dispatcher/dswstate.c
+++ b/drivers/acpi/dispatcher/dswstate.c
@@ -70,7 +70,7 @@
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;
@@ -122,7 +122,7 @@
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);
}
@@ -146,7 +146,7 @@
{
union acpi_generic_state *state;
acpi_status status;
- acpi_native_uint index;
+ u32 index;
ACPI_FUNCTION_NAME(ds_result_push);
@@ -400,7 +400,7 @@
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);
@@ -409,7 +409,7 @@
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;
}
diff --git a/drivers/acpi/events/evevent.c b/drivers/acpi/events/evevent.c
index 5d30e5b..c56c5c6 100644
--- a/drivers/acpi/events/evevent.c
+++ b/drivers/acpi/events/evevent.c
@@ -188,7 +188,7 @@
static acpi_status acpi_ev_fixed_event_initialize(void)
{
- acpi_native_uint i;
+ u32 i;
acpi_status status;
/*
@@ -231,7 +231,7 @@
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);
@@ -260,7 +260,7 @@
/* 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);
}
}
diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
index ca356e5..c5e53aa 100644
--- a/drivers/acpi/events/evgpe.c
+++ b/drivers/acpi/events/evgpe.c
@@ -315,7 +315,7 @@
{
union acpi_operand_object *obj_desc;
struct acpi_gpe_block_info *gpe_block;
- acpi_native_uint i;
+ u32 i;
ACPI_FUNCTION_ENTRY();
@@ -389,8 +389,8 @@
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);
@@ -472,13 +472,7 @@
*/
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);
}
}
}
diff --git a/drivers/acpi/events/evgpeblk.c b/drivers/acpi/events/evgpeblk.c
index e6c4d4c..73c058e 100644
--- a/drivers/acpi/events/evgpeblk.c
+++ b/drivers/acpi/events/evgpeblk.c
@@ -189,8 +189,8 @@
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);
@@ -203,7 +203,8 @@
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) {
@@ -744,8 +745,8 @@
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);
@@ -983,8 +984,8 @@
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);
@@ -1033,7 +1034,8 @@
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)
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c
index 2113e58..1d5670b 100644
--- a/drivers/acpi/events/evmisc.c
+++ b/drivers/acpi/events/evmisc.c
@@ -575,7 +575,7 @@
void acpi_ev_terminate(void)
{
- acpi_native_uint i;
+ u32 i;
acpi_status status;
ACPI_FUNCTION_TRACE(ev_terminate);
@@ -589,7 +589,7 @@
/* 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",
diff --git a/drivers/acpi/events/evregion.c b/drivers/acpi/events/evregion.c
index 5ab4c01..236fbd1 100644
--- a/drivers/acpi/events/evregion.c
+++ b/drivers/acpi/events/evregion.c
@@ -81,7 +81,7 @@
acpi_status acpi_ev_install_region_handlers(void)
{
acpi_status status;
- acpi_native_uint i;
+ u32 i;
ACPI_FUNCTION_TRACE(ev_install_region_handlers);
@@ -151,7 +151,7 @@
acpi_status acpi_ev_initialize_op_regions(void)
{
acpi_status status;
- acpi_native_uint i;
+ u32 i;
ACPI_FUNCTION_TRACE(ev_initialize_op_regions);
diff --git a/drivers/acpi/events/evrgnini.c b/drivers/acpi/events/evrgnini.c
index 2e3d2c5..6b94b38 100644
--- a/drivers/acpi/events/evrgnini.c
+++ b/drivers/acpi/events/evrgnini.c
@@ -380,7 +380,7 @@
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
diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c
index 39d7421..2a32c84 100644
--- a/drivers/acpi/executer/exconfig.c
+++ b/drivers/acpi/executer/exconfig.c
@@ -53,7 +53,7 @@
/* 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);
@@ -73,7 +73,7 @@
******************************************************************************/
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)
{
@@ -96,7 +96,8 @@
/* 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 */
@@ -128,12 +129,12 @@
{
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);
@@ -280,7 +281,7 @@
{
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;
@@ -437,7 +438,7 @@
{
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);
@@ -454,9 +455,9 @@
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 */
diff --git a/drivers/acpi/executer/exconvrt.c b/drivers/acpi/executer/exconvrt.c
index fd954b4..261d975 100644
--- a/drivers/acpi/executer/exconvrt.c
+++ b/drivers/acpi/executer/exconvrt.c
@@ -288,11 +288,11 @@
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;
@@ -348,7 +348,7 @@
/* 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 */
diff --git a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c
index 74f1b22..976016f 100644
--- a/drivers/acpi/executer/exdump.c
+++ b/drivers/acpi/executer/exdump.c
@@ -775,7 +775,7 @@
u32 num_levels,
char *note, char *module_name, u32 line_number)
{
- acpi_native_uint i;
+ u32 i;
ACPI_FUNCTION_NAME(ex_dump_operands);
diff --git a/drivers/acpi/executer/exfldio.c b/drivers/acpi/executer/exfldio.c
index e336b5d..9ff9d1f 100644
--- a/drivers/acpi/executer/exfldio.c
+++ b/drivers/acpi/executer/exfldio.c
@@ -153,14 +153,15 @@
/*
* 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);
}
}
diff --git a/drivers/acpi/executer/exmisc.c b/drivers/acpi/executer/exmisc.c
index cc956a5..731414a 100644
--- a/drivers/acpi/executer/exmisc.c
+++ b/drivers/acpi/executer/exmisc.c
@@ -329,8 +329,8 @@
/* 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));
@@ -352,8 +352,8 @@
/* 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));
diff --git a/drivers/acpi/executer/exregion.c b/drivers/acpi/executer/exregion.c
index 7cd8bb5..7a41c40 100644
--- a/drivers/acpi/executer/exregion.c
+++ b/drivers/acpi/executer/exregion.c
@@ -156,7 +156,7 @@
/* 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",
diff --git a/drivers/acpi/namespace/nsdump.c b/drivers/acpi/namespace/nsdump.c
index 5445751..904f951 100644
--- a/drivers/acpi/namespace/nsdump.c
+++ b/drivers/acpi/namespace/nsdump.c
@@ -73,7 +73,7 @@
void acpi_ns_print_pathname(u32 num_segments, char *pathname)
{
- acpi_native_uint i;
+ u32 i;
ACPI_FUNCTION_NAME(ns_print_pathname);
diff --git a/drivers/acpi/namespace/nsload.c b/drivers/acpi/namespace/nsload.c
index 2c92f6c..a4a412b 100644
--- a/drivers/acpi/namespace/nsload.c
+++ b/drivers/acpi/namespace/nsload.c
@@ -71,8 +71,7 @@
******************************************************************************/
acpi_status
-acpi_ns_load_table(acpi_native_uint table_index,
- struct acpi_namespace_node *node)
+acpi_ns_load_table(u32 table_index, struct acpi_namespace_node *node)
{
acpi_status status;
diff --git a/drivers/acpi/namespace/nsparse.c b/drivers/acpi/namespace/nsparse.c
index 46a79b0..a82271a 100644
--- a/drivers/acpi/namespace/nsparse.c
+++ b/drivers/acpi/namespace/nsparse.c
@@ -63,13 +63,13 @@
*
******************************************************************************/
acpi_status
-acpi_ns_one_complete_parse(acpi_native_uint pass_number,
- acpi_native_uint table_index,
- struct acpi_namespace_node * start_node)
+acpi_ns_one_complete_parse(u32 pass_number,
+ u32 table_index,
+ struct acpi_namespace_node *start_node)
{
union acpi_parse_object *parse_root;
acpi_status status;
- acpi_native_uint aml_length;
+ u32 aml_length;
u8 *aml_start;
struct acpi_walk_state *walk_state;
struct acpi_table_header *table;
@@ -112,8 +112,8 @@
aml_start = (u8 *) table + sizeof(struct acpi_table_header);
aml_length = table->length - sizeof(struct acpi_table_header);
status = acpi_ds_init_aml_walk(walk_state, parse_root, NULL,
- aml_start, (u32) aml_length,
- NULL, (u8) pass_number);
+ aml_start, aml_length, NULL,
+ (u8) pass_number);
}
if (ACPI_FAILURE(status)) {
@@ -158,8 +158,7 @@
******************************************************************************/
acpi_status
-acpi_ns_parse_table(acpi_native_uint table_index,
- struct acpi_namespace_node *start_node)
+acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node)
{
acpi_status status;
diff --git a/drivers/acpi/namespace/nsutils.c b/drivers/acpi/namespace/nsutils.c
index 64c0398..5b5619c 100644
--- a/drivers/acpi/namespace/nsutils.c
+++ b/drivers/acpi/namespace/nsutils.c
@@ -365,7 +365,7 @@
char *internal_name = info->internal_name;
char *external_name = info->next_external_char;
char *result = NULL;
- acpi_native_uint i;
+ u32 i;
ACPI_FUNCTION_TRACE(ns_build_internal_name);
@@ -400,12 +400,11 @@
result = &internal_name[i];
} else if (num_segments == 2) {
internal_name[i] = AML_DUAL_NAME_PREFIX;
- result = &internal_name[(acpi_native_uint) (i + 1)];
+ result = &internal_name[(acpi_size) i + 1];
} else {
internal_name[i] = AML_MULTI_NAME_PREFIX_OP;
- internal_name[(acpi_native_uint) (i + 1)] =
- (char)num_segments;
- result = &internal_name[(acpi_native_uint) (i + 2)];
+ internal_name[(acpi_size) i + 1] = (char)num_segments;
+ result = &internal_name[(acpi_size) i + 2];
}
}
@@ -531,12 +530,12 @@
char *internal_name,
u32 * converted_name_length, char **converted_name)
{
- acpi_native_uint names_index = 0;
- acpi_native_uint num_segments = 0;
- acpi_native_uint required_length;
- acpi_native_uint prefix_length = 0;
- acpi_native_uint i = 0;
- acpi_native_uint j = 0;
+ u32 names_index = 0;
+ u32 num_segments = 0;
+ u32 required_length;
+ u32 prefix_length = 0;
+ u32 i = 0;
+ u32 j = 0;
ACPI_FUNCTION_TRACE(ns_externalize_name);
@@ -582,9 +581,8 @@
/* <count> 4-byte names */
names_index = prefix_length + 2;
- num_segments = (acpi_native_uint) (u8)
- internal_name[(acpi_native_uint)
- (prefix_length + 1)];
+ num_segments = (u8)
+ internal_name[(acpi_size) prefix_length + 1];
break;
case AML_DUAL_NAME_PREFIX:
diff --git a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c
index b4e135e..38be586 100644
--- a/drivers/acpi/namespace/nsxfeval.c
+++ b/drivers/acpi/namespace/nsxfeval.c
@@ -441,7 +441,7 @@
u32 flags;
struct acpica_device_id hid;
struct acpi_compatible_id_list *cid;
- acpi_native_uint i;
+ u32 i;
int found;
status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
diff --git a/drivers/acpi/parser/psargs.c b/drivers/acpi/parser/psargs.c
index e944637..d830b29 100644
--- a/drivers/acpi/parser/psargs.c
+++ b/drivers/acpi/parser/psargs.c
@@ -76,7 +76,7 @@
{
u8 *aml = parser_state->aml;
u32 package_length = 0;
- acpi_native_uint byte_count;
+ u32 byte_count;
u8 byte_zero_mask = 0x3F; /* Default [0:5] */
ACPI_FUNCTION_TRACE(ps_get_next_package_length);
@@ -86,7 +86,7 @@
* used to encode the package length, either 0,1,2, or 3
*/
byte_count = (aml[0] >> 6);
- parser_state->aml += (byte_count + 1);
+ parser_state->aml += ((acpi_size) byte_count + 1);
/* Get bytes 3, 2, 1 as needed */
diff --git a/drivers/acpi/parser/psxface.c b/drivers/acpi/parser/psxface.c
index 5ee09e12..270469a 100644
--- a/drivers/acpi/parser/psxface.c
+++ b/drivers/acpi/parser/psxface.c
@@ -333,7 +333,7 @@
static void
acpi_ps_update_parameter_list(struct acpi_evaluate_info *info, u16 action)
{
- acpi_native_uint i;
+ u32 i;
if (info->parameters) {
diff --git a/drivers/acpi/resources/rscalc.c b/drivers/acpi/resources/rscalc.c
index 8a112d1..f61ebc6 100644
--- a/drivers/acpi/resources/rscalc.c
+++ b/drivers/acpi/resources/rscalc.c
@@ -73,7 +73,7 @@
static u8 acpi_rs_count_set_bits(u16 bit_field)
{
- acpi_native_uint bits_set;
+ u8 bits_set;
ACPI_FUNCTION_ENTRY();
@@ -84,7 +84,7 @@
bit_field &= (u16) (bit_field - 1);
}
- return ((u8) bits_set);
+ return bits_set;
}
/*******************************************************************************
diff --git a/drivers/acpi/resources/rsmisc.c b/drivers/acpi/resources/rsmisc.c
index de1ac38..96a6c03 100644
--- a/drivers/acpi/resources/rsmisc.c
+++ b/drivers/acpi/resources/rsmisc.c
@@ -82,7 +82,7 @@
ACPI_FUNCTION_TRACE(rs_convert_aml_to_resource);
- if (((acpi_native_uint) resource) & 0x3) {
+ if (((acpi_size) resource) & 0x3) {
/* Each internal resource struct is expected to be 32-bit aligned */
diff --git a/drivers/acpi/resources/rsutils.c b/drivers/acpi/resources/rsutils.c
index 90ed83d..f7b3bcd 100644
--- a/drivers/acpi/resources/rsutils.c
+++ b/drivers/acpi/resources/rsutils.c
@@ -62,7 +62,7 @@
******************************************************************************/
u8 acpi_rs_decode_bitmask(u16 mask, u8 * list)
{
- acpi_native_uint i;
+ u8 i;
u8 bit_count;
ACPI_FUNCTION_ENTRY();
@@ -71,7 +71,7 @@
for (i = 0, bit_count = 0; mask; i++) {
if (mask & 0x0001) {
- list[bit_count] = (u8) i;
+ list[bit_count] = i;
bit_count++;
}
@@ -96,8 +96,8 @@
u16 acpi_rs_encode_bitmask(u8 * list, u8 count)
{
- acpi_native_uint i;
- acpi_native_uint mask;
+ u32 i;
+ u16 mask;
ACPI_FUNCTION_ENTRY();
@@ -107,7 +107,7 @@
mask |= (0x1 << list[i]);
}
- return ((u16) mask);
+ return mask;
}
/*******************************************************************************
@@ -130,7 +130,7 @@
void
acpi_rs_move_data(void *destination, void *source, u16 item_count, u8 move_type)
{
- acpi_native_uint i;
+ u32 i;
ACPI_FUNCTION_ENTRY();
diff --git a/drivers/acpi/tables/tbfadt.c b/drivers/acpi/tables/tbfadt.c
index 949d411..a4a41ba 100644
--- a/drivers/acpi/tables/tbfadt.c
+++ b/drivers/acpi/tables/tbfadt.c
@@ -155,7 +155,7 @@
*
******************************************************************************/
-void acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags)
+void acpi_tb_parse_fadt(u32 table_index, u8 flags)
{
u32 length;
struct acpi_table_header *table;
@@ -280,7 +280,7 @@
{
u8 pm1_register_length;
struct acpi_generic_address *target;
- acpi_native_uint i;
+ u32 i;
/* Update the local FADT table header length */
@@ -396,7 +396,7 @@
u32 *address32;
struct acpi_generic_address *address64;
u8 length;
- acpi_native_uint i;
+ u32 i;
/* Examine all of the 64-bit extended address fields (X fields) */
diff --git a/drivers/acpi/tables/tbfind.c b/drivers/acpi/tables/tbfind.c
index 9ca3afc..531584d 100644
--- a/drivers/acpi/tables/tbfind.c
+++ b/drivers/acpi/tables/tbfind.c
@@ -65,10 +65,9 @@
******************************************************************************/
acpi_status
acpi_tb_find_table(char *signature,
- char *oem_id,
- char *oem_table_id, acpi_native_uint * table_index)
+ char *oem_id, char *oem_table_id, u32 *table_index)
{
- acpi_native_uint i;
+ u32 i;
acpi_status status;
struct acpi_table_header header;
diff --git a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c
index 5336ce8..b22185f 100644
--- a/drivers/acpi/tables/tbinstal.c
+++ b/drivers/acpi/tables/tbinstal.c
@@ -107,11 +107,10 @@
******************************************************************************/
acpi_status
-acpi_tb_add_table(struct acpi_table_desc *table_desc,
- acpi_native_uint * table_index)
+acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index)
{
- acpi_native_uint i;
- acpi_native_uint length;
+ u32 i;
+ u32 length;
acpi_status status = AE_OK;
ACPI_FUNCTION_TRACE(tb_add_table);
@@ -207,8 +206,8 @@
/* Increase the Table Array size */
- tables = ACPI_ALLOCATE_ZEROED((acpi_gbl_root_table_list.size +
- ACPI_ROOT_TABLE_SIZE_INCREMENT)
+ tables = ACPI_ALLOCATE_ZEROED(((acpi_size) acpi_gbl_root_table_list.
+ size + ACPI_ROOT_TABLE_SIZE_INCREMENT)
* sizeof(struct acpi_table_desc));
if (!tables) {
ACPI_ERROR((AE_INFO,
@@ -220,7 +219,7 @@
if (acpi_gbl_root_table_list.tables) {
ACPI_MEMCPY(tables, acpi_gbl_root_table_list.tables,
- acpi_gbl_root_table_list.size *
+ (acpi_size) acpi_gbl_root_table_list.size *
sizeof(struct acpi_table_desc));
if (acpi_gbl_root_table_list.flags & ACPI_ROOT_ORIGIN_ALLOCATED) {
@@ -253,7 +252,7 @@
acpi_status
acpi_tb_store_table(acpi_physical_address address,
struct acpi_table_header *table,
- u32 length, u8 flags, acpi_native_uint * table_index)
+ u32 length, u8 flags, u32 *table_index)
{
acpi_status status = AE_OK;
@@ -334,7 +333,7 @@
void acpi_tb_terminate(void)
{
- acpi_native_uint i;
+ u32 i;
ACPI_FUNCTION_TRACE(tb_terminate);
@@ -374,7 +373,7 @@
*
******************************************************************************/
-void acpi_tb_delete_namespace_by_owner(acpi_native_uint table_index)
+void acpi_tb_delete_namespace_by_owner(u32 table_index)
{
acpi_owner_id owner_id;
@@ -403,7 +402,7 @@
*
******************************************************************************/
-acpi_status acpi_tb_allocate_owner_id(acpi_native_uint table_index)
+acpi_status acpi_tb_allocate_owner_id(u32 table_index)
{
acpi_status status = AE_BAD_PARAMETER;
@@ -431,7 +430,7 @@
*
******************************************************************************/
-acpi_status acpi_tb_release_owner_id(acpi_native_uint table_index)
+acpi_status acpi_tb_release_owner_id(u32 table_index)
{
acpi_status status = AE_BAD_PARAMETER;
@@ -462,8 +461,7 @@
*
******************************************************************************/
-acpi_status
-acpi_tb_get_owner_id(acpi_native_uint table_index, acpi_owner_id * owner_id)
+acpi_status acpi_tb_get_owner_id(u32 table_index, acpi_owner_id *owner_id)
{
acpi_status status = AE_BAD_PARAMETER;
@@ -490,7 +488,7 @@
*
******************************************************************************/
-u8 acpi_tb_is_table_loaded(acpi_native_uint table_index)
+u8 acpi_tb_is_table_loaded(u32 table_index)
{
u8 is_loaded = FALSE;
@@ -518,7 +516,7 @@
*
******************************************************************************/
-void acpi_tb_set_table_loaded_flag(acpi_native_uint table_index, u8 is_loaded)
+void acpi_tb_set_table_loaded_flag(u32 table_index, u8 is_loaded)
{
(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);
diff --git a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c
index bc019b9..0cc92ef 100644
--- a/drivers/acpi/tables/tbutils.c
+++ b/drivers/acpi/tables/tbutils.c
@@ -49,8 +49,8 @@
/* Local prototypes */
static acpi_physical_address
-acpi_tb_get_root_table_entry(u8 * table_entry,
- acpi_native_uint table_entry_size);
+acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size);
+
/*******************************************************************************
*
* FUNCTION: acpi_tb_check_xsdt
@@ -238,7 +238,7 @@
*
******************************************************************************/
-u8 acpi_tb_checksum(u8 * buffer, acpi_native_uint length)
+u8 acpi_tb_checksum(u8 *buffer, u32 length)
{
u8 sum = 0;
u8 *end = buffer + length;
@@ -268,7 +268,7 @@
void
acpi_tb_install_table(acpi_physical_address address,
- u8 flags, char *signature, acpi_native_uint table_index)
+ u8 flags, char *signature, u32 table_index)
{
struct acpi_table_header *table;
@@ -336,8 +336,7 @@
******************************************************************************/
static acpi_physical_address
-acpi_tb_get_root_table_entry(u8 * table_entry,
- acpi_native_uint table_entry_size)
+acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size)
{
u64 address64;
@@ -395,8 +394,8 @@
acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags)
{
struct acpi_table_rsdp *rsdp;
- acpi_native_uint table_entry_size;
- acpi_native_uint i;
+ u32 table_entry_size;
+ u32 i;
u32 table_count;
struct acpi_table_header *table;
acpi_physical_address address;
diff --git a/drivers/acpi/tables/tbxface.c b/drivers/acpi/tables/tbxface.c
index 0e31960..fd7770a 100644
--- a/drivers/acpi/tables/tbxface.c
+++ b/drivers/acpi/tables/tbxface.c
@@ -125,7 +125,7 @@
/* Root Table Array has been statically allocated by the host */
ACPI_MEMSET(initial_table_array, 0,
- initial_table_count *
+ (acpi_size) initial_table_count *
sizeof(struct acpi_table_desc));
acpi_gbl_root_table_list.tables = initial_table_array;
@@ -183,9 +183,9 @@
return_ACPI_STATUS(AE_SUPPORT);
}
- new_size =
- (acpi_gbl_root_table_list.count +
- ACPI_ROOT_TABLE_SIZE_INCREMENT) * sizeof(struct acpi_table_desc);
+ new_size = ((acpi_size) acpi_gbl_root_table_list.count +
+ ACPI_ROOT_TABLE_SIZE_INCREMENT) *
+ sizeof(struct acpi_table_desc);
/* Create new array and copy the old array */
@@ -222,7 +222,7 @@
acpi_status acpi_load_table(struct acpi_table_header *table_ptr)
{
acpi_status status;
- acpi_native_uint table_index;
+ u32 table_index;
struct acpi_table_desc table_desc;
if (!table_ptr)
@@ -264,11 +264,10 @@
*****************************************************************************/
acpi_status
acpi_get_table_header(char *signature,
- acpi_native_uint instance,
- struct acpi_table_header * out_table_header)
+ u32 instance, struct acpi_table_header *out_table_header)
{
- acpi_native_uint i;
- acpi_native_uint j;
+ u32 i;
+ u32 j;
struct acpi_table_header *header;
/* Parameter validation */
@@ -378,10 +377,10 @@
*****************************************************************************/
acpi_status
acpi_get_table(char *signature,
- acpi_native_uint instance, struct acpi_table_header **out_table)
+ u32 instance, struct acpi_table_header **out_table)
{
- acpi_native_uint i;
- acpi_native_uint j;
+ u32 i;
+ u32 j;
acpi_status status;
/* Parameter validation */
@@ -435,8 +434,7 @@
*
******************************************************************************/
acpi_status
-acpi_get_table_by_index(acpi_native_uint table_index,
- struct acpi_table_header ** table)
+acpi_get_table_by_index(u32 table_index, struct acpi_table_header **table)
{
acpi_status status;
@@ -493,7 +491,7 @@
{
acpi_status status;
struct acpi_table_header *table;
- acpi_native_uint i;
+ u32 i;
ACPI_FUNCTION_TRACE(tb_load_namespace);
diff --git a/drivers/acpi/tables/tbxfroot.c b/drivers/acpi/tables/tbxfroot.c
index b8c0dfa..2d157e0 100644
--- a/drivers/acpi/tables/tbxfroot.c
+++ b/drivers/acpi/tables/tbxfroot.c
@@ -118,7 +118,7 @@
*
******************************************************************************/
-acpi_status acpi_find_root_pointer(acpi_native_uint * table_address)
+acpi_status acpi_find_root_pointer(acpi_size *table_address)
{
u8 *table_ptr;
u8 *mem_rover;
@@ -153,7 +153,7 @@
* 1b) Search EBDA paragraphs (EBDA is required to be a
* minimum of 1_k length)
*/
- table_ptr = acpi_os_map_memory((acpi_native_uint)
+ table_ptr = acpi_os_map_memory((acpi_physical_address)
physical_address,
ACPI_EBDA_WINDOW_SIZE);
if (!table_ptr) {
diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c
index 655c290..53499ac 100644
--- a/drivers/acpi/utilities/utcopy.c
+++ b/drivers/acpi/utilities/utcopy.c
@@ -572,7 +572,7 @@
acpi_status status = AE_OK;
union acpi_operand_object *package_object;
union acpi_operand_object **package_elements;
- acpi_native_uint i;
+ u32 i;
ACPI_FUNCTION_TRACE(ut_copy_epackage_to_ipackage);
@@ -599,7 +599,7 @@
/* Truncate package and delete it */
- package_object->package.count = (u32) i;
+ package_object->package.count = i;
package_elements[i] = NULL;
acpi_ut_remove_reference(package_object);
return_ACPI_STATUS(status);
diff --git a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c
index f938f46..3919fe5 100644
--- a/drivers/acpi/utilities/utdebug.c
+++ b/drivers/acpi/utilities/utdebug.c
@@ -519,8 +519,8 @@
void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display)
{
- acpi_native_uint i = 0;
- acpi_native_uint j;
+ u32 i = 0;
+ u32 j;
u32 temp32;
u8 buf_char;
@@ -539,7 +539,7 @@
/* Print current offset */
- acpi_os_printf("%6.4X: ", (u32) i);
+ acpi_os_printf("%6.4X: ", i);
/* Print 16 hex chars */
@@ -549,7 +549,7 @@
/* Dump fill spaces */
acpi_os_printf("%*s", ((display * 2) + 1), " ");
- j += (acpi_native_uint) display;
+ j += display;
continue;
}
@@ -557,32 +557,38 @@
case DB_BYTE_DISPLAY:
default: /* Default is BYTE display */
- acpi_os_printf("%02X ", buffer[i + j]);
+ acpi_os_printf("%02X ",
+ buffer[(acpi_size) i + j]);
break;
case DB_WORD_DISPLAY:
- ACPI_MOVE_16_TO_32(&temp32, &buffer[i + j]);
+ ACPI_MOVE_16_TO_32(&temp32,
+ &buffer[(acpi_size) i + j]);
acpi_os_printf("%04X ", temp32);
break;
case DB_DWORD_DISPLAY:
- ACPI_MOVE_32_TO_32(&temp32, &buffer[i + j]);
+ ACPI_MOVE_32_TO_32(&temp32,
+ &buffer[(acpi_size) i + j]);
acpi_os_printf("%08X ", temp32);
break;
case DB_QWORD_DISPLAY:
- ACPI_MOVE_32_TO_32(&temp32, &buffer[i + j]);
+ ACPI_MOVE_32_TO_32(&temp32,
+ &buffer[(acpi_size) i + j]);
acpi_os_printf("%08X", temp32);
- ACPI_MOVE_32_TO_32(&temp32, &buffer[i + j + 4]);
+ ACPI_MOVE_32_TO_32(&temp32,
+ &buffer[(acpi_size) i + j +
+ 4]);
acpi_os_printf("%08X ", temp32);
break;
}
- j += (acpi_native_uint) display;
+ j += display;
}
/*
@@ -596,7 +602,7 @@
return;
}
- buf_char = buffer[i + j];
+ buf_char = buffer[(acpi_size) i + j];
if (ACPI_IS_PRINT(buf_char)) {
acpi_os_printf("%c", buf_char);
} else {
diff --git a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c
index 1fbc351..c5c791a 100644
--- a/drivers/acpi/utilities/utdelete.c
+++ b/drivers/acpi/utilities/utdelete.c
@@ -442,7 +442,7 @@
union acpi_generic_state *state_list = NULL;
union acpi_operand_object *next_object = NULL;
union acpi_generic_state *state;
- acpi_native_uint i;
+ u32 i;
ACPI_FUNCTION_TRACE_PTR(ut_update_object_reference, object);
diff --git a/drivers/acpi/utilities/uteval.c b/drivers/acpi/utilities/uteval.c
index 7f1f634..352747e 100644
--- a/drivers/acpi/utilities/uteval.c
+++ b/drivers/acpi/utilities/uteval.c
@@ -97,7 +97,7 @@
acpi_status status;
union acpi_operand_object *string_desc;
union acpi_operand_object *return_desc;
- acpi_native_uint i;
+ u32 i;
ACPI_FUNCTION_TRACE(ut_osi_implementation);
@@ -513,7 +513,7 @@
u32 count;
u32 size;
struct acpi_compatible_id_list *cid_list;
- acpi_native_uint i;
+ u32 i;
ACPI_FUNCTION_TRACE(ut_execute_CID);
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c
index 47354d9..6175ca5 100644
--- a/drivers/acpi/utilities/utmisc.c
+++ b/drivers/acpi/utilities/utmisc.c
@@ -161,9 +161,9 @@
acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id)
{
- acpi_native_uint i;
- acpi_native_uint j;
- acpi_native_uint k;
+ u32 i;
+ u32 j;
+ u32 k;
acpi_status status;
ACPI_FUNCTION_TRACE(ut_allocate_owner_id);
@@ -269,7 +269,7 @@
{
acpi_owner_id owner_id = *owner_id_ptr;
acpi_status status;
- acpi_native_uint index;
+ u32 index;
u32 bit;
ACPI_FUNCTION_TRACE_U32(ut_release_owner_id, owner_id);
@@ -589,7 +589,7 @@
*
******************************************************************************/
-u8 acpi_ut_valid_acpi_char(char character, acpi_native_uint position)
+u8 acpi_ut_valid_acpi_char(char character, u32 position)
{
if (!((character >= 'A' && character <= 'Z') ||
@@ -624,7 +624,7 @@
u8 acpi_ut_valid_acpi_name(u32 name)
{
- acpi_native_uint i;
+ u32 i;
ACPI_FUNCTION_ENTRY();
@@ -653,7 +653,7 @@
acpi_name acpi_ut_repair_name(char *name)
{
- acpi_native_uint i;
+ u32 i;
char new_name[ACPI_NAME_SIZE];
for (i = 0; i < ACPI_NAME_SIZE; i++) {
diff --git a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c
index e68466d..ede6a80 100644
--- a/drivers/acpi/utilities/utobject.c
+++ b/drivers/acpi/utilities/utobject.c
@@ -175,8 +175,8 @@
* Create the element array. Count+1 allows the array to be null
* terminated.
*/
- package_elements = ACPI_ALLOCATE_ZEROED((acpi_size)
- (count + 1) * sizeof(void *));
+ package_elements = ACPI_ALLOCATE_ZEROED(((acpi_size) count +
+ 1) * sizeof(void *));
if (!package_elements) {
acpi_ut_remove_reference(package_desc);
return_PTR(NULL);