From 53c78d75d8a4615e5c2f1d9fe94f25e049f0e61b Mon Sep 17 00:00:00 2001 From: Will Miles Date: Thu, 24 Mar 2016 09:40:26 +0800 Subject: ACPICA: Add support for QNX 6.6 platform ACPICA commit 37a1dec2391272251e59948c16c60713183ae78f Link: https://github.com/acpica/acpica/commit/37a1dec2 Signed-off-by: Will Miles Signed-off-by: Bob Moore Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- tools/power/acpi/os_specific/service_layers/osunixmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/power') diff --git a/tools/power/acpi/os_specific/service_layers/osunixmap.c b/tools/power/acpi/os_specific/service_layers/osunixmap.c index 3818fd07e50f..cbfbce18783d 100644 --- a/tools/power/acpi/os_specific/service_layers/osunixmap.c +++ b/tools/power/acpi/os_specific/service_layers/osunixmap.c @@ -54,7 +54,7 @@ ACPI_MODULE_NAME("osunixmap") #ifndef O_BINARY #define O_BINARY 0 #endif -#if defined(_dragon_fly) || defined(_free_BSD) +#if defined(_dragon_fly) || defined(_free_BSD) || defined(_QNX) #define MMAP_FLAGS MAP_SHARED #else #define MMAP_FLAGS MAP_PRIVATE -- cgit v1.2.3 From 3a05be7575a46cf3b16abb77e1072afa13307a1b Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Thu, 24 Mar 2016 09:40:33 +0800 Subject: ACPICA: Utilities: Update for strtoul64 merger ACPICA commit 795e136d2ac77c1c8b091fba019b5fe36a44a323 Fixes a problem with the merger of the two internal versions of this function. Make the maximum integer width (32-bit or 64-bit) a parameter to the function so that it no longer exclusively uses the integer width specified in the DSDT/SSDT. ACPICA BZ 1260 Link: https://github.com/acpica/acpica/commit/795e136d Signed-off-by: Bob Moore Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/acutils.h | 9 ++++- drivers/acpi/acpica/dbconvert.c | 4 +- drivers/acpi/acpica/exconvrt.c | 4 +- drivers/acpi/acpica/nsconvert.c | 3 +- drivers/acpi/acpica/utnonansi.c | 67 ++++++++++++++++++-------------- tools/power/acpi/tools/acpidump/apdump.c | 3 +- tools/power/acpi/tools/acpidump/apmain.c | 3 +- 7 files changed, 57 insertions(+), 36 deletions(-) (limited to 'tools/power') diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h index e43ab6f2ad7e..7422ff7bfb6d 100644 --- a/drivers/acpi/acpica/acutils.h +++ b/drivers/acpi/acpica/acutils.h @@ -175,7 +175,14 @@ void acpi_ut_strlwr(char *src_string); int acpi_ut_stricmp(char *string1, char *string2); -acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer); +acpi_status +acpi_ut_strtoul64(char *string, + u32 base, u32 max_integer_byte_width, u64 *ret_integer); + +/* Values for max_integer_byte_width above */ + +#define ACPI_MAX32_BYTE_WIDTH 4 +#define ACPI_MAX64_BYTE_WIDTH 8 /* * utglobal - Global data structures and procedures diff --git a/drivers/acpi/acpica/dbconvert.c b/drivers/acpi/acpica/dbconvert.c index 68f4e0f4b095..c79c5fb23fb6 100644 --- a/drivers/acpi/acpica/dbconvert.c +++ b/drivers/acpi/acpica/dbconvert.c @@ -277,7 +277,9 @@ acpi_db_convert_to_object(acpi_object_type type, default: object->type = ACPI_TYPE_INTEGER; - status = acpi_ut_strtoul64(string, 16, &object->integer.value); + status = + acpi_ut_strtoul64(string, 16, acpi_gbl_integer_byte_width, + &object->integer.value); break; } diff --git a/drivers/acpi/acpica/exconvrt.c b/drivers/acpi/acpica/exconvrt.c index 0b9f2c13b98a..d0d16daa7ed5 100644 --- a/drivers/acpi/acpica/exconvrt.c +++ b/drivers/acpi/acpica/exconvrt.c @@ -124,7 +124,9 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc, * of ACPI 3.0) is that the to_integer() operator allows both decimal * and hexadecimal strings (hex prefixed with "0x"). */ - status = acpi_ut_strtoul64((char *)pointer, flags, &result); + status = acpi_ut_strtoul64((char *)pointer, flags, + acpi_gbl_integer_byte_width, + &result); if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); } diff --git a/drivers/acpi/acpica/nsconvert.c b/drivers/acpi/acpica/nsconvert.c index 878e8fb6a64c..256f56c583d6 100644 --- a/drivers/acpi/acpica/nsconvert.c +++ b/drivers/acpi/acpica/nsconvert.c @@ -79,7 +79,8 @@ acpi_ns_convert_to_integer(union acpi_operand_object *original_object, /* String-to-Integer conversion */ status = acpi_ut_strtoul64(original_object->string.pointer, - ACPI_ANY_BASE, &value); + ACPI_ANY_BASE, + acpi_gbl_integer_byte_width, &value); if (ACPI_FAILURE(status)) { return (status); } diff --git a/drivers/acpi/acpica/utnonansi.c b/drivers/acpi/acpica/utnonansi.c index d5c3adf19bd0..3465fe2c5a5c 100644 --- a/drivers/acpi/acpica/utnonansi.c +++ b/drivers/acpi/acpica/utnonansi.c @@ -205,37 +205,41 @@ acpi_ut_safe_strncat(char *dest, * * FUNCTION: acpi_ut_strtoul64 * - * PARAMETERS: string - Null terminated string - * base - Radix of the string: 16 or ACPI_ANY_BASE; - * ACPI_ANY_BASE means 'in behalf of to_integer' - * ret_integer - Where the converted integer is returned + * PARAMETERS: string - Null terminated string + * base - Radix of the string: 16 or 10 or + * ACPI_ANY_BASE + * max_integer_byte_width - Maximum allowable integer,in bytes: + * 4 or 8 (32 or 64 bits) + * ret_integer - Where the converted integer is + * returned * * RETURN: Status and Converted value * * DESCRIPTION: Convert a string into an unsigned value. Performs either a - * 32-bit or 64-bit conversion, depending on the current mode - * of the interpreter. + * 32-bit or 64-bit conversion, depending on the input integer + * size (often the current mode of the interpreter). * - * NOTES: acpi_gbl_integer_byte_width should be set to the proper width. + * NOTES: Negative numbers are not supported, as they are not supported + * by ACPI. + * + * acpi_gbl_integer_byte_width should be set to the proper width. * For the core ACPICA code, this width depends on the DSDT - * version. For iASL, the default byte width is always 8. + * version. For iASL, the default byte width is always 8 for the + * parser, but error checking is performed later to flag cases + * where a 64-bit constant is defined in a 32-bit DSDT/SSDT. * * Does not support Octal strings, not needed at this time. * - * There is an earlier version of the function after this one, - * below. It is slightly different than this one, and the two - * may eventually may need to be merged. (01/2016). - * ******************************************************************************/ -acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer) +acpi_status +acpi_ut_strtoul64(char *string, + u32 base, u32 max_integer_byte_width, u64 *ret_integer) { u32 this_digit = 0; u64 return_value = 0; u64 quotient; u64 dividend; - u32 to_integer_op = (base == ACPI_ANY_BASE); - u32 mode32 = (acpi_gbl_integer_byte_width == 4); u8 valid_digits = 0; u8 sign_of0x = 0; u8 term = 0; @@ -244,6 +248,7 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer) switch (base) { case ACPI_ANY_BASE: + case 10: case 16: break; @@ -265,9 +270,9 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer) string++; } - if (to_integer_op) { + if (base == ACPI_ANY_BASE) { /* - * Base equal to ACPI_ANY_BASE means 'ToInteger operation case'. + * Base equal to ACPI_ANY_BASE means 'Either decimal or hex'. * We need to determine if it is decimal or hexadecimal. */ if ((*string == '0') && (tolower((int)*(string + 1)) == 'x')) { @@ -284,7 +289,7 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer) /* Any string left? Check that '0x' is not followed by white space. */ if (!(*string) || isspace((int)*string) || *string == '\t') { - if (to_integer_op) { + if (base == ACPI_ANY_BASE) { goto error_exit; } else { goto all_done; @@ -292,10 +297,11 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer) } /* - * Perform a 32-bit or 64-bit conversion, depending upon the current - * execution mode of the interpreter + * Perform a 32-bit or 64-bit conversion, depending upon the input + * byte width */ - dividend = (mode32) ? ACPI_UINT32_MAX : ACPI_UINT64_MAX; + dividend = (max_integer_byte_width <= ACPI_MAX32_BYTE_WIDTH) ? + ACPI_UINT32_MAX : ACPI_UINT64_MAX; /* Main loop: convert the string to a 32- or 64-bit integer */ @@ -323,7 +329,7 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer) } if (term) { - if (to_integer_op) { + if (base == ACPI_ANY_BASE) { goto error_exit; } else { break; @@ -338,12 +344,13 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer) valid_digits++; - if (sign_of0x - && ((valid_digits > 16) - || ((valid_digits > 8) && mode32))) { + if (sign_of0x && ((valid_digits > 16) || + ((valid_digits > 8) + && (max_integer_byte_width <= + ACPI_MAX32_BYTE_WIDTH)))) { /* * This is to_integer operation case. - * No any restrictions for string-to-integer conversion, + * No restrictions for string-to-integer conversion, * see ACPI spec. */ goto error_exit; @@ -355,7 +362,7 @@ acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer) "ient, NULL); if (return_value > quotient) { - if (to_integer_op) { + if (base == ACPI_ANY_BASE) { goto error_exit; } else { break; @@ -378,7 +385,8 @@ all_done: return_ACPI_STATUS(AE_OK); error_exit: - /* Base was set/validated above */ + + /* Base was set/validated above (10 or 16) */ if (base == 10) { return_ACPI_STATUS(AE_BAD_DECIMAL_CONSTANT); @@ -388,8 +396,7 @@ error_exit: } #ifdef _OBSOLETE_FUNCTIONS -/* TBD: use version in ACPICA main code base? */ -/* DONE: 01/2016 */ +/* Removed: 01/2016 */ /******************************************************************************* * diff --git a/tools/power/acpi/tools/acpidump/apdump.c b/tools/power/acpi/tools/acpidump/apdump.c index da44458d3b6c..9c2db0eb467f 100644 --- a/tools/power/acpi/tools/acpidump/apdump.c +++ b/tools/power/acpi/tools/acpidump/apdump.c @@ -286,7 +286,8 @@ int ap_dump_table_by_address(char *ascii_address) /* Convert argument to an integer physical address */ - status = acpi_ut_strtoul64(ascii_address, 0, &long_address); + status = acpi_ut_strtoul64(ascii_address, ACPI_ANY_BASE, + ACPI_MAX64_BYTE_WIDTH, &long_address); if (ACPI_FAILURE(status)) { acpi_log_error("%s: Could not convert to a physical address\n", ascii_address); diff --git a/tools/power/acpi/tools/acpidump/apmain.c b/tools/power/acpi/tools/acpidump/apmain.c index c3c09152fac6..7692e6b887e1 100644 --- a/tools/power/acpi/tools/acpidump/apmain.c +++ b/tools/power/acpi/tools/acpidump/apmain.c @@ -209,7 +209,8 @@ static int ap_do_options(int argc, char **argv) case 'r': /* Dump tables from specified RSDP */ status = - acpi_ut_strtoul64(acpi_gbl_optarg, 0, + acpi_ut_strtoul64(acpi_gbl_optarg, ACPI_ANY_BASE, + ACPI_MAX64_BYTE_WIDTH, &gbl_rsdp_base); if (ACPI_FAILURE(status)) { acpi_log_error -- cgit v1.2.3 From f5c1e1c5a652e4b43eb9b571577ef72731f3fa8b Mon Sep 17 00:00:00 2001 From: Lv Zheng Date: Thu, 5 May 2016 12:57:53 +0800 Subject: ACPICA: Divergence: remove unwanted spaces for typedef ACPICA commit b2294cae776f5a66a7697414b21949d307e6856f This patch removes unwanted spaces for typedef. This solution doesn't cover function types. Note that the linuxize result of this commit is very giant and should have many conflicts against the current Linux upstream. Thus it is required to modify the linuxize result of this commit and the commits around it manually in order to have them merged to the Linux upstream. Since this is very costy, we should do this only once, and if we can't ensure to do this only once, we need to revert the Linux code to the wrong indentation result before merging the linuxize result of this commit. Lv Zheng. Link: https://github.com/acpica/acpica/commit/b2294cae Signed-off-by: Lv Zheng Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/acdebug.h | 6 +- drivers/acpi/acpica/acevents.h | 1 + drivers/acpi/acpica/acinterp.h | 2 +- drivers/acpi/acpica/aclocal.h | 31 ++++---- drivers/acpi/acpica/acresrc.h | 8 +- drivers/acpi/acpica/acutils.h | 22 +++--- drivers/acpi/acpica/dbcmds.c | 4 +- drivers/acpi/acpica/dbconvert.c | 4 +- drivers/acpi/acpica/dbexec.c | 2 +- drivers/acpi/acpica/dbinput.c | 6 +- drivers/acpi/acpica/dbnames.c | 2 +- drivers/acpi/acpica/dbxface.c | 4 +- drivers/acpi/acpica/dscontrol.c | 4 +- drivers/acpi/acpica/dsinit.c | 2 +- drivers/acpi/acpica/dsmethod.c | 2 +- drivers/acpi/acpica/dsutils.c | 2 +- drivers/acpi/acpica/dswload.c | 4 +- drivers/acpi/acpica/dswload2.c | 4 +- drivers/acpi/acpica/dswstate.c | 10 +-- drivers/acpi/acpica/evgpe.c | 4 +- drivers/acpi/acpica/evgpeblk.c | 4 +- drivers/acpi/acpica/evgpeutil.c | 4 +- drivers/acpi/acpica/evhandler.c | 2 +- drivers/acpi/acpica/evmisc.c | 3 +- drivers/acpi/acpica/evrgnini.c | 2 +- drivers/acpi/acpica/evxfgpe.c | 2 +- drivers/acpi/acpica/exconcat.c | 4 +- drivers/acpi/acpica/exconvrt.c | 4 +- drivers/acpi/acpica/excreate.c | 2 +- drivers/acpi/acpica/exfield.c | 4 +- drivers/acpi/acpica/exfldio.c | 2 +- drivers/acpi/acpica/exoparg3.c | 8 +- drivers/acpi/acpica/exoparg6.c | 2 +- drivers/acpi/acpica/exregion.c | 6 +- drivers/acpi/acpica/exresnte.c | 4 +- drivers/acpi/acpica/exresolv.c | 2 +- drivers/acpi/acpica/exresop.c | 4 +- drivers/acpi/acpica/exstorob.c | 4 +- drivers/acpi/acpica/hwgpe.c | 6 +- drivers/acpi/acpica/hwxface.c | 7 +- drivers/acpi/acpica/nsconvert.c | 6 +- drivers/acpi/acpica/nsnames.c | 2 +- drivers/acpi/acpica/nsobject.c | 4 +- drivers/acpi/acpica/nsrepair.c | 2 +- drivers/acpi/acpica/nsrepair2.c | 6 +- drivers/acpi/acpica/nsutils.c | 8 +- drivers/acpi/acpica/nsxfeval.c | 2 +- drivers/acpi/acpica/nsxfname.c | 6 +- drivers/acpi/acpica/nsxfobj.c | 6 +- drivers/acpi/acpica/psargs.c | 2 +- drivers/acpi/acpica/psparse.c | 4 +- drivers/acpi/acpica/psxface.c | 2 +- drivers/acpi/acpica/rscalc.c | 90 +++++++++++----------- drivers/acpi/acpica/rscreate.c | 2 +- drivers/acpi/acpica/rsmisc.c | 2 +- drivers/acpi/acpica/rsutils.c | 12 +-- drivers/acpi/acpica/rsxface.c | 6 +- drivers/acpi/acpica/tbdata.c | 9 +-- drivers/acpi/acpica/tbfadt.c | 2 +- drivers/acpi/acpica/tbutils.c | 6 +- drivers/acpi/acpica/tbxface.c | 6 +- drivers/acpi/acpica/tbxfroot.c | 8 +- drivers/acpi/acpica/utalloc.c | 5 +- drivers/acpi/acpica/utbuffer.c | 24 +++--- drivers/acpi/acpica/utcache.c | 7 +- drivers/acpi/acpica/utcopy.c | 16 ++-- drivers/acpi/acpica/utids.c | 8 +- drivers/acpi/acpica/utmath.c | 4 +- drivers/acpi/acpica/utobject.c | 18 ++--- drivers/acpi/acpica/utosi.c | 4 +- drivers/acpi/acpica/utownerid.c | 6 +- drivers/acpi/acpica/utprint.c | 14 ++-- drivers/acpi/acpica/utstring.c | 2 +- drivers/acpi/acpica/utxface.c | 4 +- include/acpi/acpiosxf.h | 8 +- include/acpi/acpixf.h | 21 ++--- include/acpi/actypes.h | 41 +++++----- .../acpi/os_specific/service_layers/oslinuxtbl.c | 47 ++++++----- .../acpi/os_specific/service_layers/osunixxf.c | 24 +++--- tools/power/acpi/tools/acpidump/apdump.c | 2 +- 80 files changed, 324 insertions(+), 324 deletions(-) (limited to 'tools/power') diff --git a/drivers/acpi/acpica/acdebug.h b/drivers/acpi/acpica/acdebug.h index 9e2e080ac9af..f6404ea928cb 100644 --- a/drivers/acpi/acpica/acdebug.h +++ b/drivers/acpi/acpica/acdebug.h @@ -196,7 +196,7 @@ ACPI_DBR_DEPENDENT_RETURN_VOID(void acpi_walk_state *walk_state)) - acpi_status acpi_db_display_all_methods(char *display_count_arg); +acpi_status acpi_db_display_all_methods(char *display_count_arg); void acpi_db_display_arguments(void); @@ -220,7 +220,7 @@ ACPI_DBR_DEPENDENT_RETURN_VOID(void * dbexec - debugger control method execution */ void -acpi_db_execute(char *name, char **args, acpi_object_type * types, u32 flags); +acpi_db_execute(char *name, char **args, acpi_object_type *types, u32 flags); void acpi_db_create_execution_threads(char *num_threads_arg, @@ -271,7 +271,7 @@ void ACPI_SYSTEM_XFACE acpi_db_execute_thread(void *context); acpi_status acpi_db_user_commands(void); char *acpi_db_get_next_token(char *string, - char **next, acpi_object_type * return_type); + char **next, acpi_object_type *return_type); /* * dbobject diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h index 17f221782d2f..77af91cf46d4 100644 --- a/drivers/acpi/acpica/acevents.h +++ b/drivers/acpi/acpica/acevents.h @@ -72,6 +72,7 @@ acpi_status acpi_ev_init_global_lock_handler(void); ACPI_HW_DEPENDENT_RETURN_OK(acpi_status acpi_ev_acquire_global_lock(u16 timeout)) ACPI_HW_DEPENDENT_RETURN_OK(acpi_status acpi_ev_release_global_lock(void)) + acpi_status acpi_ev_remove_global_lock_handler(void); /* diff --git a/drivers/acpi/acpica/acinterp.h b/drivers/acpi/acpica/acinterp.h index 8b09d28fe5a8..7ead235555cf 100644 --- a/drivers/acpi/acpica/acinterp.h +++ b/drivers/acpi/acpica/acinterp.h @@ -370,7 +370,7 @@ acpi_ex_resolve_to_value(union acpi_operand_object **stack_ptr, acpi_status acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state, union acpi_operand_object *operand, - acpi_object_type * return_type, + acpi_object_type *return_type, union acpi_operand_object **return_desc); /* diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h index 083b16ada31e..166a67fb271d 100644 --- a/drivers/acpi/acpica/aclocal.h +++ b/drivers/acpi/acpica/aclocal.h @@ -278,7 +278,7 @@ struct acpi_create_field_info { }; typedef -acpi_status(*acpi_internal_method) (struct acpi_walk_state * walk_state); +acpi_status (*acpi_internal_method) (struct acpi_walk_state * walk_state); /* * Bitmapped ACPI types. Used internally only @@ -395,11 +395,12 @@ union acpi_predefined_info { /* Return object auto-repair info */ -typedef acpi_status(*acpi_object_converter) (struct acpi_namespace_node * scope, - union acpi_operand_object - *original_object, - union acpi_operand_object - **converted_object); +typedef acpi_status (*acpi_object_converter) (struct acpi_namespace_node * + scope, + union acpi_operand_object * + original_object, + union acpi_operand_object ** + converted_object); struct acpi_simple_repair_info { char name[ACPI_NAME_SIZE]; @@ -539,10 +540,10 @@ struct acpi_gpe_device_info { struct acpi_namespace_node *gpe_device; }; -typedef acpi_status(*acpi_gpe_callback) (struct acpi_gpe_xrupt_info * - gpe_xrupt_info, - struct acpi_gpe_block_info *gpe_block, - void *context); +typedef acpi_status (*acpi_gpe_callback) (struct acpi_gpe_xrupt_info * + gpe_xrupt_info, + struct acpi_gpe_block_info * + gpe_block, void *context); /* Information about each particular fixed event */ @@ -657,10 +658,11 @@ struct acpi_result_values { }; typedef -acpi_status(*acpi_parse_downwards) (struct acpi_walk_state * walk_state, - union acpi_parse_object ** out_op); +acpi_status (*acpi_parse_downwards) (struct acpi_walk_state * walk_state, + union acpi_parse_object ** out_op); -typedef acpi_status(*acpi_parse_upwards) (struct acpi_walk_state * walk_state); +typedef +acpi_status (*acpi_parse_upwards) (struct acpi_walk_state * walk_state); /* Global handlers for AML Notifies */ @@ -700,7 +702,8 @@ union acpi_generic_state { * ****************************************************************************/ -typedef acpi_status(*acpi_execute_op) (struct acpi_walk_state * walk_state); +typedef +acpi_status (*acpi_execute_op) (struct acpi_walk_state * walk_state); /* Address Range info block */ diff --git a/drivers/acpi/acpica/acresrc.h b/drivers/acpi/acpica/acresrc.h index 83e9a296c6ee..63da1e37caba 100644 --- a/drivers/acpi/acpica/acresrc.h +++ b/drivers/acpi/acpica/acresrc.h @@ -223,16 +223,16 @@ acpi_rs_get_aei_method_data(struct acpi_namespace_node *node, * rscalc */ acpi_status -acpi_rs_get_list_length(u8 * aml_buffer, - u32 aml_buffer_length, acpi_size * size_needed); +acpi_rs_get_list_length(u8 *aml_buffer, + u32 aml_buffer_length, acpi_size *size_needed); acpi_status acpi_rs_get_aml_length(struct acpi_resource *resource_list, - acpi_size resource_list_size, acpi_size * size_needed); + acpi_size resource_list_size, acpi_size *size_needed); acpi_status acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object, - acpi_size * buffer_size_needed); + acpi_size *buffer_size_needed); acpi_status acpi_rs_convert_aml_to_resources(u8 * aml, diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h index 4ff971c4c979..107f9e0090f7 100644 --- a/drivers/acpi/acpica/acutils.h +++ b/drivers/acpi/acpica/acutils.h @@ -136,16 +136,16 @@ extern const char *acpi_gbl_pt_decode[]; #define ACPI_SMALL_VARIABLE_LENGTH 3 typedef -acpi_status(*acpi_walk_aml_callback) (u8 *aml, - u32 length, - u32 offset, - u8 resource_index, void **context); +acpi_status (*acpi_walk_aml_callback) (u8 *aml, + u32 length, + u32 offset, + u8 resource_index, void **context); typedef -acpi_status(*acpi_pkg_callback) (u8 object_type, - union acpi_operand_object *source_object, - union acpi_generic_state * state, - void *context); +acpi_status (*acpi_pkg_callback) (u8 object_type, + union acpi_operand_object * source_object, + union acpi_generic_state * state, + void *context); struct acpi_pkg_info { u8 *free_space; @@ -424,7 +424,7 @@ union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size); union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size); acpi_status -acpi_ut_get_object_size(union acpi_operand_object *obj, acpi_size * obj_length); +acpi_ut_get_object_size(union acpi_operand_object *obj, acpi_size *obj_length); /* * utosi - Support for the _OSI predefined control method @@ -541,9 +541,9 @@ acpi_ut_display_init_pathname(u8 type, /* * utownerid - Support for Table/Method Owner IDs */ -acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id); +acpi_status acpi_ut_allocate_owner_id(acpi_owner_id *owner_id); -void acpi_ut_release_owner_id(acpi_owner_id * owner_id); +void acpi_ut_release_owner_id(acpi_owner_id *owner_id); /* * utresrc diff --git a/drivers/acpi/acpica/dbcmds.c b/drivers/acpi/acpica/dbcmds.c index 772178c96ccf..62bd446535f5 100644 --- a/drivers/acpi/acpica/dbcmds.c +++ b/drivers/acpi/acpica/dbcmds.c @@ -738,9 +738,9 @@ acpi_dm_test_resource_conversion(struct acpi_namespace_node *node, char *name) original_aml = return_buffer.pointer; acpi_dm_compare_aml_resources(original_aml->buffer.pointer, - (acpi_rsdesc_size) original_aml->buffer. + (acpi_rsdesc_size)original_aml->buffer. length, new_aml.pointer, - (acpi_rsdesc_size) new_aml.length); + (acpi_rsdesc_size)new_aml.length); /* Cleanup and exit */ diff --git a/drivers/acpi/acpica/dbconvert.c b/drivers/acpi/acpica/dbconvert.c index c79c5fb23fb6..7cd07b27f758 100644 --- a/drivers/acpi/acpica/dbconvert.c +++ b/drivers/acpi/acpica/dbconvert.c @@ -194,7 +194,7 @@ acpi_db_convert_to_buffer(char *string, union acpi_object *object) * ******************************************************************************/ -acpi_status acpi_db_convert_to_package(char *string, union acpi_object * object) +acpi_status acpi_db_convert_to_package(char *string, union acpi_object *object) { char *this; char *next; @@ -252,7 +252,7 @@ acpi_status acpi_db_convert_to_package(char *string, union acpi_object * object) acpi_status acpi_db_convert_to_object(acpi_object_type type, - char *string, union acpi_object * object) + char *string, union acpi_object *object) { acpi_status status = AE_OK; diff --git a/drivers/acpi/acpica/dbexec.c b/drivers/acpi/acpica/dbexec.c index c814855376e2..12df2915ad74 100644 --- a/drivers/acpi/acpica/dbexec.c +++ b/drivers/acpi/acpica/dbexec.c @@ -361,7 +361,7 @@ acpi_db_execution_walk(acpi_handle obj_handle, ******************************************************************************/ void -acpi_db_execute(char *name, char **args, acpi_object_type * types, u32 flags) +acpi_db_execute(char *name, char **args, acpi_object_type *types, u32 flags) { acpi_status status; struct acpi_buffer return_obj; diff --git a/drivers/acpi/acpica/dbinput.c b/drivers/acpi/acpica/dbinput.c index f53cb30e0a09..7cd5d2e022da 100644 --- a/drivers/acpi/acpica/dbinput.c +++ b/drivers/acpi/acpica/dbinput.c @@ -466,7 +466,7 @@ static void acpi_db_display_help(char *command) ******************************************************************************/ char *acpi_db_get_next_token(char *string, - char **next, acpi_object_type * return_type) + char **next, acpi_object_type *return_type) { char *start; u32 depth; @@ -684,8 +684,8 @@ static u32 acpi_db_match_command(char *user_command) acpi_status acpi_db_command_dispatch(char *input_buffer, - struct acpi_walk_state * walk_state, - union acpi_parse_object * op) + struct acpi_walk_state *walk_state, + union acpi_parse_object *op) { u32 temp; u32 command_index; diff --git a/drivers/acpi/acpica/dbnames.c b/drivers/acpi/acpica/dbnames.c index 3c23b5a1079b..4c9e59a86db1 100644 --- a/drivers/acpi/acpica/dbnames.c +++ b/drivers/acpi/acpica/dbnames.c @@ -285,7 +285,7 @@ void acpi_db_dump_namespace_by_owner(char *owner_arg, char *depth_arg) u32 max_depth = ACPI_UINT32_MAX; acpi_owner_id owner_id; - owner_id = (acpi_owner_id) strtoul(owner_arg, NULL, 0); + owner_id = (acpi_owner_id)strtoul(owner_arg, NULL, 0); /* Now we can check for the depth argument */ diff --git a/drivers/acpi/acpica/dbxface.c b/drivers/acpi/acpica/dbxface.c index e94e0d80bc7b..124db237775d 100644 --- a/drivers/acpi/acpica/dbxface.c +++ b/drivers/acpi/acpica/dbxface.c @@ -162,8 +162,8 @@ void acpi_db_signal_break_point(struct acpi_walk_state *walk_state) ******************************************************************************/ acpi_status -acpi_db_single_step(struct acpi_walk_state * walk_state, - union acpi_parse_object * op, u32 opcode_class) +acpi_db_single_step(struct acpi_walk_state *walk_state, + union acpi_parse_object *op, u32 opcode_class) { union acpi_parse_object *next; acpi_status status = AE_OK; diff --git a/drivers/acpi/acpica/dscontrol.c b/drivers/acpi/acpica/dscontrol.c index c9a663f21ac8..4ddcbf100234 100644 --- a/drivers/acpi/acpica/dscontrol.c +++ b/drivers/acpi/acpica/dscontrol.c @@ -163,8 +163,8 @@ acpi_ds_exec_begin_control_op(struct acpi_walk_state *walk_state, ******************************************************************************/ acpi_status -acpi_ds_exec_end_control_op(struct acpi_walk_state * walk_state, - union acpi_parse_object * op) +acpi_ds_exec_end_control_op(struct acpi_walk_state *walk_state, + union acpi_parse_object *op) { acpi_status status = AE_OK; union acpi_generic_state *control_state; diff --git a/drivers/acpi/acpica/dsinit.c b/drivers/acpi/acpica/dsinit.c index 5aa1c5feee50..f1e6dcc7a827 100644 --- a/drivers/acpi/acpica/dsinit.c +++ b/drivers/acpi/acpica/dsinit.c @@ -188,7 +188,7 @@ acpi_ds_init_one_object(acpi_handle obj_handle, acpi_status acpi_ds_initialize_objects(u32 table_index, - struct acpi_namespace_node * start_node) + struct acpi_namespace_node *start_node) { acpi_status status; struct acpi_init_walk_info info; diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c index 1982310e6d83..ddfec05cbb4b 100644 --- a/drivers/acpi/acpica/dsmethod.c +++ b/drivers/acpi/acpica/dsmethod.c @@ -209,7 +209,7 @@ acpi_ds_detect_named_opcodes(struct acpi_walk_state *walk_state, ******************************************************************************/ acpi_status -acpi_ds_method_error(acpi_status status, struct acpi_walk_state * walk_state) +acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state) { u32 aml_offset; diff --git a/drivers/acpi/acpica/dsutils.c b/drivers/acpi/acpica/dsutils.c index 8ca9416320e0..f393de9f5887 100644 --- a/drivers/acpi/acpica/dsutils.c +++ b/drivers/acpi/acpica/dsutils.c @@ -569,7 +569,7 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state, /* TBD: May only be temporary */ obj_desc = - acpi_ut_create_string_object((acpi_size) name_length); + acpi_ut_create_string_object((acpi_size)name_length); strncpy(obj_desc->string.pointer, name_string, name_length); diff --git a/drivers/acpi/acpica/dswload.c b/drivers/acpi/acpica/dswload.c index d1cedcfda1d2..fd34040d4f44 100644 --- a/drivers/acpi/acpica/dswload.c +++ b/drivers/acpi/acpica/dswload.c @@ -137,8 +137,8 @@ acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number) ******************************************************************************/ acpi_status -acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state, - union acpi_parse_object ** out_op) +acpi_ds_load1_begin_op(struct acpi_walk_state *walk_state, + union acpi_parse_object **out_op) { union acpi_parse_object *op; struct acpi_namespace_node *node; diff --git a/drivers/acpi/acpica/dswload2.c b/drivers/acpi/acpica/dswload2.c index 0bac6e14170e..762db3fa70e0 100644 --- a/drivers/acpi/acpica/dswload2.c +++ b/drivers/acpi/acpica/dswload2.c @@ -490,8 +490,8 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state) status = acpi_ds_create_index_field(op, - (acpi_handle) arg-> - common.node, walk_state); + (acpi_handle)arg->common. + node, walk_state); break; case AML_BANK_FIELD_OP: diff --git a/drivers/acpi/acpica/dswstate.c b/drivers/acpi/acpica/dswstate.c index 3a26ddbaed6d..e3338698e56b 100644 --- a/drivers/acpi/acpica/dswstate.c +++ b/drivers/acpi/acpica/dswstate.c @@ -143,8 +143,8 @@ acpi_ds_result_pop(union acpi_operand_object **object, ******************************************************************************/ acpi_status -acpi_ds_result_push(union acpi_operand_object * object, - struct acpi_walk_state * walk_state) +acpi_ds_result_push(union acpi_operand_object *object, + struct acpi_walk_state *walk_state) { union acpi_generic_state *state; acpi_status status; @@ -307,7 +307,7 @@ static acpi_status acpi_ds_result_stack_pop(struct acpi_walk_state *walk_state) ******************************************************************************/ acpi_status -acpi_ds_obj_stack_push(void *object, struct acpi_walk_state * walk_state) +acpi_ds_obj_stack_push(void *object, struct acpi_walk_state *walk_state) { ACPI_FUNCTION_NAME(ds_obj_stack_push); @@ -354,7 +354,7 @@ acpi_ds_obj_stack_push(void *object, struct acpi_walk_state * walk_state) ******************************************************************************/ acpi_status -acpi_ds_obj_stack_pop(u32 pop_count, struct acpi_walk_state * walk_state) +acpi_ds_obj_stack_pop(u32 pop_count, struct acpi_walk_state *walk_state) { u32 i; @@ -411,7 +411,7 @@ acpi_ds_obj_stack_pop_and_delete(u32 pop_count, return; } - for (i = (s32) 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/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c index b47e62aaf654..4b4949ce05bc 100644 --- a/drivers/acpi/acpica/evgpe.c +++ b/drivers/acpi/acpica/evgpe.c @@ -440,7 +440,7 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list) gpe_event_info = &gpe_block-> - event_info[((acpi_size) i * + event_info[((acpi_size)i * ACPI_GPE_REGISTER_WIDTH) + j]; gpe_number = j + gpe_register_info->base_gpe_number; @@ -652,7 +652,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_enable_gpe(void *context) * ******************************************************************************/ -acpi_status acpi_ev_finish_gpe(struct acpi_gpe_event_info * gpe_event_info) +acpi_status acpi_ev_finish_gpe(struct acpi_gpe_event_info *gpe_event_info) { acpi_status status; diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c index 447fa1cac64f..d54014cab01d 100644 --- a/drivers/acpi/acpica/evgpeblk.c +++ b/drivers/acpi/acpica/evgpeblk.c @@ -211,7 +211,7 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block) /* Allocate the GPE register information block */ - gpe_register_info = ACPI_ALLOCATE_ZEROED((acpi_size) gpe_block-> + gpe_register_info = ACPI_ALLOCATE_ZEROED((acpi_size)gpe_block-> register_count * sizeof(struct acpi_gpe_register_info)); @@ -225,7 +225,7 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block) * Allocate the GPE event_info block. There are eight distinct GPEs * per register. Initialization to zeros is sufficient. */ - gpe_event_info = ACPI_ALLOCATE_ZEROED((acpi_size) gpe_block->gpe_count * + gpe_event_info = ACPI_ALLOCATE_ZEROED((acpi_size)gpe_block->gpe_count * sizeof(struct acpi_gpe_event_info)); if (!gpe_event_info) { diff --git a/drivers/acpi/acpica/evgpeutil.c b/drivers/acpi/acpica/evgpeutil.c index 66c4b5b7cd64..3f150d567e64 100644 --- a/drivers/acpi/acpica/evgpeutil.c +++ b/drivers/acpi/acpica/evgpeutil.c @@ -163,7 +163,7 @@ acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info, acpi_status acpi_ev_get_gpe_xrupt_block(u32 interrupt_number, - struct acpi_gpe_xrupt_info ** gpe_xrupt_block) + struct acpi_gpe_xrupt_info **gpe_xrupt_block) { struct acpi_gpe_xrupt_info *next_gpe_xrupt; struct acpi_gpe_xrupt_info *gpe_xrupt; @@ -320,7 +320,7 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, /* Now look at the individual GPEs in this byte register */ for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) { - gpe_event_info = &gpe_block->event_info[((acpi_size) i * + gpe_event_info = &gpe_block->event_info[((acpi_size)i * ACPI_GPE_REGISTER_WIDTH) + j]; diff --git a/drivers/acpi/acpica/evhandler.c b/drivers/acpi/acpica/evhandler.c index 0f6be8956a99..24768ca03f19 100644 --- a/drivers/acpi/acpica/evhandler.c +++ b/drivers/acpi/acpica/evhandler.c @@ -359,7 +359,7 @@ union acpi_operand_object *acpi_ev_find_region_handler(acpi_adr_space_type ******************************************************************************/ acpi_status -acpi_ev_install_space_handler(struct acpi_namespace_node * node, +acpi_ev_install_space_handler(struct acpi_namespace_node *node, acpi_adr_space_type space_id, acpi_adr_space_handler handler, acpi_adr_space_setup setup, void *context) diff --git a/drivers/acpi/acpica/evmisc.c b/drivers/acpi/acpica/evmisc.c index c67d78c5995f..f51d43adb7d1 100644 --- a/drivers/acpi/acpica/evmisc.c +++ b/drivers/acpi/acpica/evmisc.c @@ -99,8 +99,7 @@ u8 acpi_ev_is_notify_object(struct acpi_namespace_node *node) ******************************************************************************/ acpi_status -acpi_ev_queue_notify_request(struct acpi_namespace_node * node, - u32 notify_value) +acpi_ev_queue_notify_request(struct acpi_namespace_node *node, u32 notify_value) { union acpi_operand_object *obj_desc; union acpi_operand_object *handler_list_head = NULL; diff --git a/drivers/acpi/acpica/evrgnini.c b/drivers/acpi/acpica/evrgnini.c index 6972ab4ddb66..b6ea9c0d0d8c 100644 --- a/drivers/acpi/acpica/evrgnini.c +++ b/drivers/acpi/acpica/evrgnini.c @@ -227,7 +227,7 @@ acpi_ev_pci_config_region_setup(acpi_handle handle, /* Install a handler for this PCI root bridge */ - status = acpi_install_address_space_handler((acpi_handle) pci_root_node, ACPI_ADR_SPACE_PCI_CONFIG, ACPI_DEFAULT_HANDLER, NULL, NULL); + status = acpi_install_address_space_handler((acpi_handle)pci_root_node, ACPI_ADR_SPACE_PCI_CONFIG, ACPI_DEFAULT_HANDLER, NULL, NULL); if (ACPI_FAILURE(status)) { if (status == AE_SAME_HANDLER) { /* diff --git a/drivers/acpi/acpica/evxfgpe.c b/drivers/acpi/acpica/evxfgpe.c index 90456714821f..17cfef721d00 100644 --- a/drivers/acpi/acpica/evxfgpe.c +++ b/drivers/acpi/acpica/evxfgpe.c @@ -917,7 +917,7 @@ ACPI_EXPORT_SYMBOL(acpi_remove_gpe_block) * the FADT-defined gpe blocks. Otherwise, the GPE block device. * ******************************************************************************/ -acpi_status acpi_get_gpe_device(u32 index, acpi_handle * gpe_device) +acpi_status acpi_get_gpe_device(u32 index, acpi_handle *gpe_device) { struct acpi_gpe_device_info info; acpi_status status; diff --git a/drivers/acpi/acpica/exconcat.c b/drivers/acpi/acpica/exconcat.c index 553e0146338e..2423fe03e879 100644 --- a/drivers/acpi/acpica/exconcat.c +++ b/drivers/acpi/acpica/exconcat.c @@ -340,7 +340,7 @@ acpi_ex_convert_to_object_type_string(union acpi_operand_object *obj_desc, type_string = acpi_ut_get_type_name(obj_desc->common.type); - return_desc = acpi_ut_create_string_object(((acpi_size) strlen(type_string) + 9)); /* 9 For "[ Object]" */ + return_desc = acpi_ut_create_string_object(((acpi_size)strlen(type_string) + 9)); /* 9 For "[ Object]" */ if (!return_desc) { return (AE_NO_MEMORY); } @@ -372,7 +372,7 @@ acpi_status acpi_ex_concat_template(union acpi_operand_object *operand0, union acpi_operand_object *operand1, union acpi_operand_object **actual_return_desc, - struct acpi_walk_state * walk_state) + struct acpi_walk_state *walk_state) { acpi_status status; union acpi_operand_object *return_desc; diff --git a/drivers/acpi/acpica/exconvrt.c b/drivers/acpi/acpica/exconvrt.c index d0d16daa7ed5..b7e9b3d803e1 100644 --- a/drivers/acpi/acpica/exconvrt.c +++ b/drivers/acpi/acpica/exconvrt.c @@ -441,7 +441,7 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc, * Need enough space for one ASCII integer (plus null terminator) */ return_desc = - acpi_ut_create_string_object((acpi_size) string_length); + acpi_ut_create_string_object((acpi_size)string_length); if (!return_desc) { return_ACPI_STATUS(AE_NO_MEMORY); } @@ -520,7 +520,7 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc, } return_desc = - acpi_ut_create_string_object((acpi_size) string_length); + acpi_ut_create_string_object((acpi_size)string_length); if (!return_desc) { return_ACPI_STATUS(AE_NO_MEMORY); } diff --git a/drivers/acpi/acpica/excreate.c b/drivers/acpi/acpica/excreate.c index bea9612e4720..613ba6eb08bb 100644 --- a/drivers/acpi/acpica/excreate.c +++ b/drivers/acpi/acpica/excreate.c @@ -394,7 +394,7 @@ acpi_status acpi_ex_create_processor(struct acpi_walk_state *walk_state) obj_desc->processor.proc_id = (u8) operand[1]->integer.value; obj_desc->processor.length = (u8) operand[3]->integer.value; obj_desc->processor.address = - (acpi_io_address) operand[2]->integer.value; + (acpi_io_address)operand[2]->integer.value; /* Install the processor object in the parent Node */ diff --git a/drivers/acpi/acpica/exfield.c b/drivers/acpi/acpica/exfield.c index d5d8020a8523..d7d3ee36338b 100644 --- a/drivers/acpi/acpica/exfield.c +++ b/drivers/acpi/acpica/exfield.c @@ -126,7 +126,7 @@ acpi_ex_get_serial_access_length(u32 accessor_type, u32 access_length) ******************************************************************************/ acpi_status -acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state, +acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state, union acpi_operand_object *obj_desc, union acpi_operand_object **ret_buffer_desc) { @@ -233,7 +233,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state, * Note: Field.length is in bits. */ length = - (acpi_size) ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->field.bit_length); + (acpi_size)ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->field.bit_length); if (length > acpi_gbl_integer_byte_width) { diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c index f0c5ed0b7db8..72f917618578 100644 --- a/drivers/acpi/acpica/exfldio.c +++ b/drivers/acpi/acpica/exfldio.c @@ -164,7 +164,7 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc, if (ACPI_ROUND_UP(rgn_desc->region.length, obj_desc->common_field. access_byte_width) >= - ((acpi_size) obj_desc->common_field. + ((acpi_size)obj_desc->common_field. base_byte_offset + obj_desc->common_field.access_byte_width + field_datum_byte_offset)) { diff --git a/drivers/acpi/acpica/exoparg3.c b/drivers/acpi/acpica/exoparg3.c index 5aa21c4eda1d..69e4e269ad2f 100644 --- a/drivers/acpi/acpica/exoparg3.c +++ b/drivers/acpi/acpica/exoparg3.c @@ -184,7 +184,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state) /* Get the Integer values from the objects */ index = operand[1]->integer.value; - length = (acpi_size) operand[2]->integer.value; + length = (acpi_size)operand[2]->integer.value; /* * If the index is beyond the length of the String/Buffer, or if the @@ -198,8 +198,8 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state) else if ((index + length) > operand[0]->string.length) { length = - (acpi_size) operand[0]->string.length - - (acpi_size) index; + (acpi_size)operand[0]->string.length - + (acpi_size)index; } /* Strings always have a sub-pointer, not so for buffers */ @@ -209,7 +209,7 @@ acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state) /* Always allocate a new buffer for the String */ - buffer = ACPI_ALLOCATE_ZEROED((acpi_size) length + 1); + buffer = ACPI_ALLOCATE_ZEROED((acpi_size)length + 1); if (!buffer) { status = AE_NO_MEMORY; goto cleanup; diff --git a/drivers/acpi/acpica/exoparg6.c b/drivers/acpi/acpica/exoparg6.c index e2b63483857f..786d53b0bb37 100644 --- a/drivers/acpi/acpica/exoparg6.c +++ b/drivers/acpi/acpica/exoparg6.c @@ -207,7 +207,7 @@ acpi_ex_do_match(u32 match_op, * ******************************************************************************/ -acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state * walk_state) +acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state *walk_state) { union acpi_operand_object **operand = &walk_state->operands[0]; union acpi_operand_object *return_desc = NULL; diff --git a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c index 076074daf2b6..31b381cae94d 100644 --- a/drivers/acpi/acpica/exregion.c +++ b/drivers/acpi/acpica/exregion.c @@ -325,15 +325,15 @@ acpi_ex_system_io_space_handler(u32 function, switch (function) { case ACPI_READ: - status = acpi_hw_read_port((acpi_io_address) address, + status = acpi_hw_read_port((acpi_io_address)address, &value32, bit_width); *value = value32; break; case ACPI_WRITE: - status = acpi_hw_write_port((acpi_io_address) address, - (u32) * value, bit_width); + status = acpi_hw_write_port((acpi_io_address)address, + (u32)*value, bit_width); break; default: diff --git a/drivers/acpi/acpica/exresnte.c b/drivers/acpi/acpica/exresnte.c index c1e8bfb0f7f4..a183cb740d24 100644 --- a/drivers/acpi/acpica/exresnte.c +++ b/drivers/acpi/acpica/exresnte.c @@ -93,7 +93,7 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr, */ node = *object_ptr; source_desc = acpi_ns_get_attached_object(node); - entry_type = acpi_ns_get_type((acpi_handle) node); + entry_type = acpi_ns_get_type((acpi_handle)node); ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Entry=%p SourceDesc=%p [%s]\n", node, source_desc, @@ -106,7 +106,7 @@ acpi_ex_resolve_node_to_value(struct acpi_namespace_node **object_ptr, node = ACPI_CAST_PTR(struct acpi_namespace_node, node->object); source_desc = acpi_ns_get_attached_object(node); - entry_type = acpi_ns_get_type((acpi_handle) node); + entry_type = acpi_ns_get_type((acpi_handle)node); *object_ptr = node; } diff --git a/drivers/acpi/acpica/exresolv.c b/drivers/acpi/acpica/exresolv.c index fedacf13dc36..e1d3878be2c6 100644 --- a/drivers/acpi/acpica/exresolv.c +++ b/drivers/acpi/acpica/exresolv.c @@ -334,7 +334,7 @@ acpi_ex_resolve_object_to_value(union acpi_operand_object **stack_ptr, acpi_status acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state, union acpi_operand_object *operand, - acpi_object_type * return_type, + acpi_object_type *return_type, union acpi_operand_object **return_desc) { union acpi_operand_object *obj_desc = ACPI_CAST_PTR(void, operand); diff --git a/drivers/acpi/acpica/exresop.c b/drivers/acpi/acpica/exresop.c index cc2c26c46a6d..27b41fd7542d 100644 --- a/drivers/acpi/acpica/exresop.c +++ b/drivers/acpi/acpica/exresop.c @@ -131,8 +131,8 @@ acpi_ex_check_object_type(acpi_object_type type_needed, acpi_status acpi_ex_resolve_operands(u16 opcode, - union acpi_operand_object ** stack_ptr, - struct acpi_walk_state * walk_state) + union acpi_operand_object **stack_ptr, + struct acpi_walk_state *walk_state) { union acpi_operand_object *obj_desc; acpi_status status = AE_OK; diff --git a/drivers/acpi/acpica/exstorob.c b/drivers/acpi/acpica/exstorob.c index 28b724827f0f..1dab82746d06 100644 --- a/drivers/acpi/acpica/exstorob.c +++ b/drivers/acpi/acpica/exstorob.c @@ -188,7 +188,7 @@ acpi_ex_store_string_to_string(union acpi_operand_object *source_desc, * Clear old string and copy in the new one */ memset(target_desc->string.pointer, 0, - (acpi_size) target_desc->string.length + 1); + (acpi_size)target_desc->string.length + 1); memcpy(target_desc->string.pointer, buffer, length); } else { /* @@ -204,7 +204,7 @@ acpi_ex_store_string_to_string(union acpi_operand_object *source_desc, } target_desc->string.pointer = - ACPI_ALLOCATE_ZEROED((acpi_size) length + 1); + ACPI_ALLOCATE_ZEROED((acpi_size)length + 1); if (!target_desc->string.pointer) { return_ACPI_STATUS(AE_NO_MEMORY); diff --git a/drivers/acpi/acpica/hwgpe.c b/drivers/acpi/acpica/hwgpe.c index 1c4f4518611a..bdecd5e76e87 100644 --- a/drivers/acpi/acpica/hwgpe.c +++ b/drivers/acpi/acpica/hwgpe.c @@ -166,7 +166,7 @@ acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u32 action) * ******************************************************************************/ -acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info) +acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info *gpe_event_info) { struct acpi_gpe_register_info *gpe_register_info; acpi_status status; @@ -206,7 +206,7 @@ acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info) ******************************************************************************/ acpi_status -acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info, +acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info, acpi_event_status *event_status) { u32 in_byte; @@ -391,7 +391,7 @@ acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, acpi_status acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, - struct acpi_gpe_block_info * gpe_block, + struct acpi_gpe_block_info *gpe_block, void *context) { u32 i; diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c index 7caaaf3b8787..98c26ff39409 100644 --- a/drivers/acpi/acpica/hwxface.c +++ b/drivers/acpi/acpica/hwxface.c @@ -91,10 +91,9 @@ acpi_status acpi_reset(void) * compatibility with other ACPI implementations that have allowed * BIOS code with bad register width values to go unnoticed. */ - status = - acpi_os_write_port((acpi_io_address) reset_reg->address, - acpi_gbl_FADT.reset_value, - ACPI_RESET_REGISTER_WIDTH); + status = acpi_os_write_port((acpi_io_address)reset_reg->address, + acpi_gbl_FADT.reset_value, + ACPI_RESET_REGISTER_WIDTH); } else { /* Write the reset value to the reset register */ diff --git a/drivers/acpi/acpica/nsconvert.c b/drivers/acpi/acpica/nsconvert.c index 256f56c583d6..c803bda7915c 100644 --- a/drivers/acpi/acpica/nsconvert.c +++ b/drivers/acpi/acpica/nsconvert.c @@ -318,7 +318,7 @@ acpi_ns_convert_to_buffer(union acpi_operand_object *original_object, ******************************************************************************/ acpi_status -acpi_ns_convert_to_unicode(struct acpi_namespace_node * scope, +acpi_ns_convert_to_unicode(struct acpi_namespace_node *scope, union acpi_operand_object *original_object, union acpi_operand_object **return_object) { @@ -385,7 +385,7 @@ acpi_ns_convert_to_unicode(struct acpi_namespace_node * scope, ******************************************************************************/ acpi_status -acpi_ns_convert_to_resource(struct acpi_namespace_node * scope, +acpi_ns_convert_to_resource(struct acpi_namespace_node *scope, union acpi_operand_object *original_object, union acpi_operand_object **return_object) { @@ -464,7 +464,7 @@ acpi_ns_convert_to_resource(struct acpi_namespace_node * scope, ******************************************************************************/ acpi_status -acpi_ns_convert_to_reference(struct acpi_namespace_node * scope, +acpi_ns_convert_to_reference(struct acpi_namespace_node *scope, union acpi_operand_object *original_object, union acpi_operand_object **return_object) { diff --git a/drivers/acpi/acpica/nsnames.c b/drivers/acpi/acpica/nsnames.c index eb6e1b88a51d..f03dd41e86d0 100644 --- a/drivers/acpi/acpica/nsnames.c +++ b/drivers/acpi/acpica/nsnames.c @@ -113,7 +113,7 @@ acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node) acpi_status acpi_ns_handle_to_pathname(acpi_handle target_handle, - struct acpi_buffer * buffer, u8 no_trailing) + struct acpi_buffer *buffer, u8 no_trailing) { acpi_status status; struct acpi_namespace_node *node; diff --git a/drivers/acpi/acpica/nsobject.c b/drivers/acpi/acpica/nsobject.c index 051306f0d0d6..cfa2bb7162d8 100644 --- a/drivers/acpi/acpica/nsobject.c +++ b/drivers/acpi/acpica/nsobject.c @@ -399,7 +399,7 @@ acpi_ns_attach_data(struct acpi_namespace_node *node, ******************************************************************************/ acpi_status -acpi_ns_detach_data(struct acpi_namespace_node * node, +acpi_ns_detach_data(struct acpi_namespace_node *node, acpi_object_handler handler) { union acpi_operand_object *obj_desc; @@ -444,7 +444,7 @@ acpi_ns_detach_data(struct acpi_namespace_node * node, ******************************************************************************/ acpi_status -acpi_ns_get_attached_data(struct acpi_namespace_node * node, +acpi_ns_get_attached_data(struct acpi_namespace_node *node, acpi_object_handler handler, void **data) { union acpi_operand_object *obj_desc; diff --git a/drivers/acpi/acpica/nsrepair.c b/drivers/acpi/acpica/nsrepair.c index 805e36de8707..9523d41c7ae9 100644 --- a/drivers/acpi/acpica/nsrepair.c +++ b/drivers/acpi/acpica/nsrepair.c @@ -399,7 +399,7 @@ static const struct acpi_simple_repair_info *acpi_ns_match_simple_repair(struct ******************************************************************************/ acpi_status -acpi_ns_repair_null_element(struct acpi_evaluate_info * info, +acpi_ns_repair_null_element(struct acpi_evaluate_info *info, u32 expected_btypes, u32 package_index, union acpi_operand_object **return_object_ptr) diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c index 63edbbbf9ae4..d5336122486b 100644 --- a/drivers/acpi/acpica/nsrepair2.c +++ b/drivers/acpi/acpica/nsrepair2.c @@ -54,9 +54,9 @@ ACPI_MODULE_NAME("nsrepair2") * be repaired on a per-name basis. */ typedef -acpi_status(*acpi_repair_function) (struct acpi_evaluate_info * info, - union acpi_operand_object - **return_object_ptr); +acpi_status (*acpi_repair_function) (struct acpi_evaluate_info * info, + union acpi_operand_object ** + return_object_ptr); typedef struct acpi_repair_info { char name[ACPI_NAME_SIZE]; diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c index c72cc62b92d0..784a30b76e0f 100644 --- a/drivers/acpi/acpica/nsutils.c +++ b/drivers/acpi/acpica/nsutils.c @@ -272,11 +272,11 @@ acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info) result = &internal_name[i]; } else if (num_segments == 2) { internal_name[i] = AML_DUAL_NAME_PREFIX; - result = &internal_name[(acpi_size) i + 1]; + result = &internal_name[(acpi_size)i + 1]; } else { internal_name[i] = AML_MULTI_NAME_PREFIX_OP; - internal_name[(acpi_size) i + 1] = (char)num_segments; - result = &internal_name[(acpi_size) i + 2]; + internal_name[(acpi_size)i + 1] = (char)num_segments; + result = &internal_name[(acpi_size)i + 2]; } } @@ -456,7 +456,7 @@ acpi_ns_externalize_name(u32 internal_name_length, names_index = prefix_length + 2; num_segments = (u8) - internal_name[(acpi_size) prefix_length + 1]; + internal_name[(acpi_size)prefix_length + 1]; break; case AML_DUAL_NAME_PREFIX: diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c index a7deeaa8eddc..614e4baacaf4 100644 --- a/drivers/acpi/acpica/nsxfeval.c +++ b/drivers/acpi/acpica/nsxfeval.c @@ -256,7 +256,7 @@ acpi_evaluate_object(acpi_handle handle, * Allocate a new parameter block for the internal objects * Add 1 to count to allow for null terminated internal list */ - info->parameters = ACPI_ALLOCATE_ZEROED(((acpi_size) info-> + info->parameters = ACPI_ALLOCATE_ZEROED(((acpi_size)info-> param_count + 1) * sizeof(void *)); if (!info->parameters) { diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c index 285b82044e7b..76a1bd4bb070 100644 --- a/drivers/acpi/acpica/nsxfname.c +++ b/drivers/acpi/acpica/nsxfname.c @@ -78,7 +78,7 @@ static char *acpi_ns_copy_device_id(struct acpi_pnp_device_id *dest, acpi_status acpi_get_handle(acpi_handle parent, - acpi_string pathname, acpi_handle * ret_handle) + acpi_string pathname, acpi_handle *ret_handle) { acpi_status status; struct acpi_namespace_node *node = NULL; @@ -155,7 +155,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_handle) * ******************************************************************************/ acpi_status -acpi_get_name(acpi_handle handle, u32 name_type, struct acpi_buffer * buffer) +acpi_get_name(acpi_handle handle, u32 name_type, struct acpi_buffer *buffer) { acpi_status status; struct acpi_namespace_node *node; @@ -448,7 +448,7 @@ acpi_get_object_info(acpi_handle handle, /* Point past the CID PNP_DEVICE_ID array */ next_id_string += - ((acpi_size) cid_list->count * + ((acpi_size)cid_list->count * sizeof(struct acpi_pnp_device_id)); } diff --git a/drivers/acpi/acpica/nsxfobj.c b/drivers/acpi/acpica/nsxfobj.c index c312cd490450..32d372b85243 100644 --- a/drivers/acpi/acpica/nsxfobj.c +++ b/drivers/acpi/acpica/nsxfobj.c @@ -63,7 +63,7 @@ ACPI_MODULE_NAME("nsxfobj") * DESCRIPTION: This routine returns the type associatd with a particular handle * ******************************************************************************/ -acpi_status acpi_get_type(acpi_handle handle, acpi_object_type * ret_type) +acpi_status acpi_get_type(acpi_handle handle, acpi_object_type *ret_type) { struct acpi_namespace_node *node; acpi_status status; @@ -115,7 +115,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_type) * Handle. * ******************************************************************************/ -acpi_status acpi_get_parent(acpi_handle handle, acpi_handle * ret_handle) +acpi_status acpi_get_parent(acpi_handle handle, acpi_handle *ret_handle) { struct acpi_namespace_node *node; struct acpi_namespace_node *parent_node; @@ -183,7 +183,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_parent) acpi_status acpi_get_next_object(acpi_object_type type, acpi_handle parent, - acpi_handle child, acpi_handle * ret_handle) + acpi_handle child, acpi_handle *ret_handle) { acpi_status status; struct acpi_namespace_node *node; diff --git a/drivers/acpi/acpica/psargs.c b/drivers/acpi/acpica/psargs.c index d48cbed342c1..c29c930ffa08 100644 --- a/drivers/acpi/acpica/psargs.c +++ b/drivers/acpi/acpica/psargs.c @@ -87,7 +87,7 @@ acpi_ps_get_next_package_length(struct acpi_parse_state *parser_state) * used to encode the package length, either 0,1,2, or 3 */ byte_count = (aml[0] >> 6); - parser_state->aml += ((acpi_size) byte_count + 1); + parser_state->aml += ((acpi_size)byte_count + 1); /* Get bytes 3, 2, 1 as needed */ diff --git a/drivers/acpi/acpica/psparse.c b/drivers/acpi/acpica/psparse.c index 8038ed2aca05..0a23897d8adf 100644 --- a/drivers/acpi/acpica/psparse.c +++ b/drivers/acpi/acpica/psparse.c @@ -130,8 +130,8 @@ u16 acpi_ps_peek_opcode(struct acpi_parse_state * parser_state) ******************************************************************************/ acpi_status -acpi_ps_complete_this_op(struct acpi_walk_state * walk_state, - union acpi_parse_object * op) +acpi_ps_complete_this_op(struct acpi_walk_state *walk_state, + union acpi_parse_object *op) { union acpi_parse_object *prev; union acpi_parse_object *next; diff --git a/drivers/acpi/acpica/psxface.c b/drivers/acpi/acpica/psxface.c index 04b37fcca684..cf30cd821f5e 100644 --- a/drivers/acpi/acpica/psxface.c +++ b/drivers/acpi/acpica/psxface.c @@ -115,7 +115,7 @@ acpi_debug_trace(const char *name, u32 debug_level, u32 debug_layer, u32 flags) * ******************************************************************************/ -acpi_status acpi_ps_execute_method(struct acpi_evaluate_info * info) +acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info) { acpi_status status; union acpi_parse_object *op; diff --git a/drivers/acpi/acpica/rscalc.c b/drivers/acpi/acpica/rscalc.c index 2b1209d73e44..f1e83addd5b4 100644 --- a/drivers/acpi/acpica/rscalc.c +++ b/drivers/acpi/acpica/rscalc.c @@ -112,7 +112,7 @@ acpi_rs_struct_option_length(struct acpi_resource_source *resource_source) * resource_source_index (1). */ if (resource_source->string_ptr) { - return ((acpi_rs_length) (resource_source->string_length + 1)); + return ((acpi_rs_length)(resource_source->string_length + 1)); } return (0); @@ -188,7 +188,7 @@ acpi_rs_stream_option_length(u32 resource_length, acpi_status acpi_rs_get_aml_length(struct acpi_resource *resource, - acpi_size resource_list_size, acpi_size * size_needed) + acpi_size resource_list_size, acpi_size *size_needed) { acpi_size aml_size_needed = 0; struct acpi_resource *resource_end; @@ -278,11 +278,11 @@ acpi_rs_get_aml_length(struct acpi_resource *resource, * 16-Bit Address Resource: * Add the size of the optional resource_source info */ - total_size = (acpi_rs_length) (total_size + - acpi_rs_struct_option_length - (&resource->data. - address16. - resource_source)); + total_size = (acpi_rs_length)(total_size + + acpi_rs_struct_option_length + (&resource->data. + address16. + resource_source)); break; case ACPI_RESOURCE_TYPE_ADDRESS32: @@ -290,11 +290,11 @@ acpi_rs_get_aml_length(struct acpi_resource *resource, * 32-Bit Address Resource: * Add the size of the optional resource_source info */ - total_size = (acpi_rs_length) (total_size + - acpi_rs_struct_option_length - (&resource->data. - address32. - resource_source)); + total_size = (acpi_rs_length)(total_size + + acpi_rs_struct_option_length + (&resource->data. + address32. + resource_source)); break; case ACPI_RESOURCE_TYPE_ADDRESS64: @@ -302,11 +302,11 @@ acpi_rs_get_aml_length(struct acpi_resource *resource, * 64-Bit Address Resource: * Add the size of the optional resource_source info */ - total_size = (acpi_rs_length) (total_size + - acpi_rs_struct_option_length - (&resource->data. - address64. - resource_source)); + total_size = (acpi_rs_length)(total_size + + acpi_rs_struct_option_length + (&resource->data. + address64. + resource_source)); break; case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: @@ -315,28 +315,28 @@ acpi_rs_get_aml_length(struct acpi_resource *resource, * Add the size of each additional optional interrupt beyond the * required 1 (4 bytes for each u32 interrupt number) */ - total_size = (acpi_rs_length) (total_size + - ((resource->data. - extended_irq. - interrupt_count - - 1) * 4) + - /* Add the size of the optional resource_source info */ - acpi_rs_struct_option_length - (&resource->data. + total_size = (acpi_rs_length)(total_size + + ((resource->data. extended_irq. - resource_source)); + interrupt_count - + 1) * 4) + + /* Add the size of the optional resource_source info */ + acpi_rs_struct_option_length + (&resource->data. + extended_irq. + resource_source)); break; case ACPI_RESOURCE_TYPE_GPIO: - total_size = (acpi_rs_length) (total_size + - (resource->data.gpio. - pin_table_length * 2) + - resource->data.gpio. - resource_source. - string_length + - resource->data.gpio. - vendor_length); + total_size = (acpi_rs_length)(total_size + + (resource->data.gpio. + pin_table_length * 2) + + resource->data.gpio. + resource_source. + string_length + + resource->data.gpio. + vendor_length); break; @@ -348,14 +348,14 @@ acpi_rs_get_aml_length(struct acpi_resource *resource, common_serial_bus. type]; - total_size = (acpi_rs_length) (total_size + - resource->data. - i2c_serial_bus. - resource_source. - string_length + - resource->data. - i2c_serial_bus. - vendor_length); + total_size = (acpi_rs_length)(total_size + + resource->data. + i2c_serial_bus. + resource_source. + string_length + + resource->data. + i2c_serial_bus. + vendor_length); break; @@ -397,8 +397,8 @@ acpi_rs_get_aml_length(struct acpi_resource *resource, ******************************************************************************/ acpi_status -acpi_rs_get_list_length(u8 * aml_buffer, - u32 aml_buffer_length, acpi_size * size_needed) +acpi_rs_get_list_length(u8 *aml_buffer, + u32 aml_buffer_length, acpi_size *size_needed) { acpi_status status; u8 *end_aml; @@ -610,7 +610,7 @@ acpi_rs_get_list_length(u8 * aml_buffer, acpi_status acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object, - acpi_size * buffer_size_needed) + acpi_size *buffer_size_needed) { u32 number_of_elements; acpi_size temp_size_needed = 0; diff --git a/drivers/acpi/acpica/rscreate.c b/drivers/acpi/acpica/rscreate.c index 12978891e842..809b61c114fe 100644 --- a/drivers/acpi/acpica/rscreate.c +++ b/drivers/acpi/acpica/rscreate.c @@ -347,7 +347,7 @@ acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, (u8 *) output_buffer->pointer); path_buffer.pointer = user_prt->source; - status = acpi_ns_handle_to_pathname((acpi_handle) node, &path_buffer, FALSE); + status = acpi_ns_handle_to_pathname((acpi_handle)node, &path_buffer, FALSE); /* +1 to include null terminator */ diff --git a/drivers/acpi/acpica/rsmisc.c b/drivers/acpi/acpica/rsmisc.c index ce3d0b77ec89..25165ca42051 100644 --- a/drivers/acpi/acpica/rsmisc.c +++ b/drivers/acpi/acpica/rsmisc.c @@ -87,7 +87,7 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource, return_ACPI_STATUS(AE_BAD_PARAMETER); } - if (((acpi_size) resource) & 0x3) { + if (((acpi_size)resource) & 0x3) { /* Each internal resource struct is expected to be 32-bit aligned */ diff --git a/drivers/acpi/acpica/rsutils.c b/drivers/acpi/acpica/rsutils.c index e0d60239d6ff..fa491c64c040 100644 --- a/drivers/acpi/acpica/rsutils.c +++ b/drivers/acpi/acpica/rsutils.c @@ -338,7 +338,7 @@ acpi_rs_get_resource_source(acpi_rs_length resource_length, * Note: Some resource descriptors will have an additional null, so * we add 1 to the minimum length. */ - if (total_length > (acpi_rsdesc_size) (minimum_length + 1)) { + if (total_length > (acpi_rsdesc_size)(minimum_length + 1)) { /* Get the resource_source_index */ @@ -377,7 +377,7 @@ acpi_rs_get_resource_source(acpi_rs_length resource_length, ACPI_CAST_PTR(char, &aml_resource_source[1])); - return ((acpi_rs_length) total_length); + return ((acpi_rs_length)total_length); } /* resource_source is not present */ @@ -406,9 +406,9 @@ acpi_rs_get_resource_source(acpi_rs_length resource_length, ******************************************************************************/ acpi_rsdesc_size -acpi_rs_set_resource_source(union aml_resource * aml, +acpi_rs_set_resource_source(union aml_resource *aml, acpi_rs_length minimum_length, - struct acpi_resource_source * resource_source) + struct acpi_resource_source *resource_source) { u8 *aml_resource_source; acpi_rsdesc_size descriptor_length; @@ -466,8 +466,8 @@ acpi_rs_set_resource_source(union aml_resource * aml, ******************************************************************************/ acpi_status -acpi_rs_get_prt_method_data(struct acpi_namespace_node * node, - struct acpi_buffer * ret_buffer) +acpi_rs_get_prt_method_data(struct acpi_namespace_node *node, + struct acpi_buffer *ret_buffer) { union acpi_operand_object *obj_desc; acpi_status status; diff --git a/drivers/acpi/acpica/rsxface.c b/drivers/acpi/acpica/rsxface.c index 900933be9909..465ed8137167 100644 --- a/drivers/acpi/acpica/rsxface.c +++ b/drivers/acpi/acpica/rsxface.c @@ -433,8 +433,8 @@ ACPI_EXPORT_SYMBOL(acpi_resource_to_address64) acpi_status acpi_get_vendor_resource(acpi_handle device_handle, char *name, - struct acpi_vendor_uuid * uuid, - struct acpi_buffer * ret_buffer) + struct acpi_vendor_uuid *uuid, + struct acpi_buffer *ret_buffer) { struct acpi_vendor_walk_info info; acpi_status status; @@ -539,7 +539,7 @@ acpi_rs_match_vendor_resource(struct acpi_resource *resource, void *context) ******************************************************************************/ acpi_status -acpi_walk_resource_buffer(struct acpi_buffer * buffer, +acpi_walk_resource_buffer(struct acpi_buffer *buffer, acpi_walk_resource_callback user_function, void *context) { diff --git a/drivers/acpi/acpica/tbdata.c b/drivers/acpi/acpica/tbdata.c index 7da79ce74080..d471df3988bb 100644 --- a/drivers/acpi/acpica/tbdata.c +++ b/drivers/acpi/acpica/tbdata.c @@ -368,7 +368,7 @@ acpi_status acpi_tb_validate_temp_table(struct acpi_table_desc *table_desc) *****************************************************************************/ acpi_status -acpi_tb_verify_temp_table(struct acpi_table_desc * table_desc, char *signature) +acpi_tb_verify_temp_table(struct acpi_table_desc *table_desc, char *signature) { acpi_status status = AE_OK; @@ -454,7 +454,7 @@ acpi_status acpi_tb_resize_root_table_list(void) table_count = acpi_gbl_root_table_list.current_table_count; } - tables = ACPI_ALLOCATE_ZEROED(((acpi_size) table_count + + tables = ACPI_ALLOCATE_ZEROED(((acpi_size)table_count + ACPI_ROOT_TABLE_SIZE_INCREMENT) * sizeof(struct acpi_table_desc)); if (!tables) { @@ -467,8 +467,7 @@ acpi_status acpi_tb_resize_root_table_list(void) if (acpi_gbl_root_table_list.tables) { memcpy(tables, acpi_gbl_root_table_list.tables, - (acpi_size) table_count * - sizeof(struct acpi_table_desc)); + (acpi_size)table_count * sizeof(struct acpi_table_desc)); if (acpi_gbl_root_table_list.flags & ACPI_ROOT_ORIGIN_ALLOCATED) { ACPI_FREE(acpi_gbl_root_table_list.tables); @@ -701,7 +700,7 @@ acpi_status acpi_tb_release_owner_id(u32 table_index) * ******************************************************************************/ -acpi_status acpi_tb_get_owner_id(u32 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; diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c index 635d9513994d..620806965243 100644 --- a/drivers/acpi/acpica/tbfadt.c +++ b/drivers/acpi/acpica/tbfadt.c @@ -344,7 +344,7 @@ void acpi_tb_parse_fadt(void) /* Obtain the DSDT and FACS tables via their addresses within the FADT */ - acpi_tb_install_fixed_table((acpi_physical_address) acpi_gbl_FADT.Xdsdt, + acpi_tb_install_fixed_table((acpi_physical_address)acpi_gbl_FADT.Xdsdt, ACPI_SIG_DSDT, &acpi_gbl_dsdt_index); /* If Hardware Reduced flag is set, there is no FACS */ diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index 9240c76d2823..a962a85b1d02 100644 --- a/drivers/acpi/acpica/tbutils.c +++ b/drivers/acpi/acpica/tbutils.c @@ -231,7 +231,7 @@ acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size) ACPI_FORMAT_UINT64(address64))); } #endif - return ((acpi_physical_address) (address64)); + return ((acpi_physical_address)(address64)); } } @@ -287,12 +287,12 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address) * the XSDT if the revision is > 1 and the XSDT pointer is present, * as per the ACPI specification. */ - address = (acpi_physical_address) rsdp->xsdt_physical_address; + address = (acpi_physical_address)rsdp->xsdt_physical_address; table_entry_size = ACPI_XSDT_ENTRY_SIZE; } else { /* Root table is an RSDT (32-bit physical addresses) */ - address = (acpi_physical_address) rsdp->rsdt_physical_address; + address = (acpi_physical_address)rsdp->rsdt_physical_address; table_entry_size = ACPI_RSDT_ENTRY_SIZE; } diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c index 326df65decef..3ecec937e8c9 100644 --- a/drivers/acpi/acpica/tbxface.c +++ b/drivers/acpi/acpica/tbxface.c @@ -99,7 +99,7 @@ acpi_status acpi_allocate_root_table(u32 initial_table_count) ******************************************************************************/ acpi_status __init -acpi_initialize_tables(struct acpi_table_desc * initial_table_array, +acpi_initialize_tables(struct acpi_table_desc *initial_table_array, u32 initial_table_count, u8 allow_resize) { acpi_physical_address rsdp_address; @@ -120,7 +120,7 @@ acpi_initialize_tables(struct acpi_table_desc * initial_table_array, /* Root Table Array has been statically allocated by the host */ memset(initial_table_array, 0, - (acpi_size) initial_table_count * + (acpi_size)initial_table_count * sizeof(struct acpi_table_desc)); acpi_gbl_root_table_list.tables = initial_table_array; @@ -352,7 +352,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_table) * ******************************************************************************/ acpi_status -acpi_get_table_by_index(u32 table_index, struct acpi_table_header ** table) +acpi_get_table_by_index(u32 table_index, struct acpi_table_header **table) { acpi_status status; diff --git a/drivers/acpi/acpica/tbxfroot.c b/drivers/acpi/acpica/tbxfroot.c index b9a78e457d19..adb6cfc54661 100644 --- a/drivers/acpi/acpica/tbxfroot.c +++ b/drivers/acpi/acpica/tbxfroot.c @@ -90,7 +90,7 @@ u32 acpi_tb_get_rsdp_length(struct acpi_table_rsdp *rsdp) * ******************************************************************************/ -acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp * rsdp) +acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp *rsdp) { /* @@ -142,7 +142,7 @@ acpi_status acpi_tb_validate_rsdp(struct acpi_table_rsdp * rsdp) * ******************************************************************************/ -acpi_status __init acpi_find_root_pointer(acpi_physical_address * table_address) +acpi_status __init acpi_find_root_pointer(acpi_physical_address *table_address) { u8 *table_ptr; u8 *mem_rover; @@ -201,7 +201,7 @@ acpi_status __init acpi_find_root_pointer(acpi_physical_address * table_address) (u32) ACPI_PTR_DIFF(mem_rover, table_ptr); *table_address = - (acpi_physical_address) physical_address; + (acpi_physical_address)physical_address; return_ACPI_STATUS(AE_OK); } } @@ -234,7 +234,7 @@ acpi_status __init acpi_find_root_pointer(acpi_physical_address * table_address) (ACPI_HI_RSDP_WINDOW_BASE + ACPI_PTR_DIFF(mem_rover, table_ptr)); - *table_address = (acpi_physical_address) physical_address; + *table_address = (acpi_physical_address)physical_address; return_ACPI_STATUS(AE_OK); } diff --git a/drivers/acpi/acpica/utalloc.c b/drivers/acpi/acpica/utalloc.c index 3dbdc3ab8b78..13324a27b99b 100644 --- a/drivers/acpi/acpica/utalloc.c +++ b/drivers/acpi/acpica/utalloc.c @@ -231,7 +231,7 @@ acpi_status acpi_ut_delete_caches(void) * ******************************************************************************/ -acpi_status acpi_ut_validate_buffer(struct acpi_buffer * buffer) +acpi_status acpi_ut_validate_buffer(struct acpi_buffer *buffer) { /* Obviously, the structure pointer must be valid */ @@ -272,8 +272,7 @@ acpi_status acpi_ut_validate_buffer(struct acpi_buffer * buffer) ******************************************************************************/ acpi_status -acpi_ut_initialize_buffer(struct acpi_buffer * buffer, - acpi_size required_length) +acpi_ut_initialize_buffer(struct acpi_buffer *buffer, acpi_size required_length) { acpi_size input_buffer_length; diff --git a/drivers/acpi/acpica/utbuffer.c b/drivers/acpi/acpica/utbuffer.c index 0cfb2b8edad5..bd31faf5da7c 100644 --- a/drivers/acpi/acpica/utbuffer.c +++ b/drivers/acpi/acpica/utbuffer.c @@ -106,31 +106,31 @@ void acpi_ut_dump_buffer(u8 *buffer, u32 count, u32 display, u32 base_offset) default: /* Default is BYTE display */ acpi_os_printf("%02X ", - buffer[(acpi_size) i + j]); + buffer[(acpi_size)i + j]); break; case DB_WORD_DISPLAY: ACPI_MOVE_16_TO_32(&temp32, - &buffer[(acpi_size) i + j]); + &buffer[(acpi_size)i + j]); acpi_os_printf("%04X ", temp32); break; case DB_DWORD_DISPLAY: ACPI_MOVE_32_TO_32(&temp32, - &buffer[(acpi_size) i + j]); + &buffer[(acpi_size)i + j]); acpi_os_printf("%08X ", temp32); break; case DB_QWORD_DISPLAY: ACPI_MOVE_32_TO_32(&temp32, - &buffer[(acpi_size) i + j]); + &buffer[(acpi_size)i + j]); acpi_os_printf("%08X", temp32); ACPI_MOVE_32_TO_32(&temp32, - &buffer[(acpi_size) i + j + + &buffer[(acpi_size)i + j + 4]); acpi_os_printf("%08X ", temp32); break; @@ -158,7 +158,7 @@ void acpi_ut_dump_buffer(u8 *buffer, u32 count, u32 display, u32 base_offset) acpi_os_printf("// "); } - buf_char = buffer[(acpi_size) i + j]; + buf_char = buffer[(acpi_size)i + j]; if (isprint(buf_char)) { acpi_os_printf("%c", buf_char); } else { @@ -274,31 +274,31 @@ acpi_ut_dump_buffer_to_file(ACPI_FILE file, default: /* Default is BYTE display */ acpi_ut_file_printf(file, "%02X ", - buffer[(acpi_size) i + j]); + buffer[(acpi_size)i + j]); break; case DB_WORD_DISPLAY: ACPI_MOVE_16_TO_32(&temp32, - &buffer[(acpi_size) i + j]); + &buffer[(acpi_size)i + j]); acpi_ut_file_printf(file, "%04X ", temp32); break; case DB_DWORD_DISPLAY: ACPI_MOVE_32_TO_32(&temp32, - &buffer[(acpi_size) i + j]); + &buffer[(acpi_size)i + j]); acpi_ut_file_printf(file, "%08X ", temp32); break; case DB_QWORD_DISPLAY: ACPI_MOVE_32_TO_32(&temp32, - &buffer[(acpi_size) i + j]); + &buffer[(acpi_size)i + j]); acpi_ut_file_printf(file, "%08X", temp32); ACPI_MOVE_32_TO_32(&temp32, - &buffer[(acpi_size) i + j + + &buffer[(acpi_size)i + j + 4]); acpi_ut_file_printf(file, "%08X ", temp32); break; @@ -318,7 +318,7 @@ acpi_ut_dump_buffer_to_file(ACPI_FILE file, return; } - buf_char = buffer[(acpi_size) i + j]; + buf_char = buffer[(acpi_size)i + j]; if (isprint(buf_char)) { acpi_ut_file_printf(file, "%c", buf_char); } else { diff --git a/drivers/acpi/acpica/utcache.c b/drivers/acpi/acpica/utcache.c index f8e9978888e1..3b8d23ef351f 100644 --- a/drivers/acpi/acpica/utcache.c +++ b/drivers/acpi/acpica/utcache.c @@ -105,7 +105,7 @@ acpi_os_create_cache(char *cache_name, * ******************************************************************************/ -acpi_status acpi_os_purge_cache(struct acpi_memory_list * cache) +acpi_status acpi_os_purge_cache(struct acpi_memory_list *cache) { void *next; acpi_status status; @@ -151,7 +151,7 @@ acpi_status acpi_os_purge_cache(struct acpi_memory_list * cache) * ******************************************************************************/ -acpi_status acpi_os_delete_cache(struct acpi_memory_list * cache) +acpi_status acpi_os_delete_cache(struct acpi_memory_list *cache) { acpi_status status; @@ -184,8 +184,7 @@ acpi_status acpi_os_delete_cache(struct acpi_memory_list * cache) * ******************************************************************************/ -acpi_status -acpi_os_release_object(struct acpi_memory_list * cache, void *object) +acpi_status acpi_os_release_object(struct acpi_memory_list *cache, void *object) { acpi_status status; diff --git a/drivers/acpi/acpica/utcopy.c b/drivers/acpi/acpica/utcopy.c index 98d53e59ce55..82f971402d85 100644 --- a/drivers/acpi/acpica/utcopy.c +++ b/drivers/acpi/acpica/utcopy.c @@ -53,7 +53,7 @@ ACPI_MODULE_NAME("utcopy") static acpi_status acpi_ut_copy_isimple_to_esimple(union acpi_operand_object *internal_object, union acpi_object *external_object, - u8 * data_space, acpi_size * buffer_space_used); + u8 *data_space, acpi_size *buffer_space_used); static acpi_status acpi_ut_copy_ielement_to_ielement(u8 object_type, @@ -63,7 +63,7 @@ acpi_ut_copy_ielement_to_ielement(u8 object_type, static acpi_status acpi_ut_copy_ipackage_to_epackage(union acpi_operand_object *internal_object, - u8 * buffer, acpi_size * space_used); + u8 *buffer, acpi_size *space_used); static acpi_status acpi_ut_copy_esimple_to_isimple(union acpi_object *user_obj, @@ -111,7 +111,7 @@ acpi_ut_copy_ipackage_to_ipackage(union acpi_operand_object *source_obj, static acpi_status acpi_ut_copy_isimple_to_esimple(union acpi_operand_object *internal_object, union acpi_object *external_object, - u8 * data_space, acpi_size * buffer_space_used) + u8 *data_space, acpi_size *buffer_space_used) { acpi_status status = AE_OK; @@ -151,7 +151,7 @@ acpi_ut_copy_isimple_to_esimple(union acpi_operand_object *internal_object, memcpy((void *)data_space, (void *)internal_object->string.pointer, - (acpi_size) internal_object->string.length + 1); + (acpi_size)internal_object->string.length + 1); break; case ACPI_TYPE_BUFFER: @@ -331,7 +331,7 @@ acpi_ut_copy_ielement_to_eelement(u8 object_type, static acpi_status acpi_ut_copy_ipackage_to_epackage(union acpi_operand_object *internal_object, - u8 * buffer, acpi_size * space_used) + u8 *buffer, acpi_size *space_used) { union acpi_object *external_object; acpi_status status; @@ -362,7 +362,7 @@ acpi_ut_copy_ipackage_to_epackage(union acpi_operand_object *internal_object, * Leave room for an array of ACPI_OBJECTS in the buffer * and move the free space past it */ - info.length += (acpi_size) external_object->package.count * + info.length += (acpi_size)external_object->package.count * ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object)); info.free_space += external_object->package.count * ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object)); @@ -738,7 +738,7 @@ acpi_ut_copy_simple_object(union acpi_operand_object *source_desc, */ if (source_desc->string.pointer) { dest_desc->string.pointer = - ACPI_ALLOCATE((acpi_size) source_desc->string. + ACPI_ALLOCATE((acpi_size)source_desc->string. length + 1); if (!dest_desc->string.pointer) { return (AE_NO_MEMORY); @@ -748,7 +748,7 @@ acpi_ut_copy_simple_object(union acpi_operand_object *source_desc, memcpy(dest_desc->string.pointer, source_desc->string.pointer, - (acpi_size) source_desc->string.length + 1); + (acpi_size)source_desc->string.length + 1); } break; diff --git a/drivers/acpi/acpica/utids.c b/drivers/acpi/acpica/utids.c index 6fb4ec365272..f7cd2d52643b 100644 --- a/drivers/acpi/acpica/utids.c +++ b/drivers/acpi/acpica/utids.c @@ -95,7 +95,7 @@ acpi_ut_execute_HID(struct acpi_namespace_node *device_node, hid = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_pnp_device_id) + - (acpi_size) length); + (acpi_size)length); if (!hid) { status = AE_NO_MEMORY; goto cleanup; @@ -173,7 +173,7 @@ acpi_ut_execute_UID(struct acpi_namespace_node *device_node, uid = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_pnp_device_id) + - (acpi_size) length); + (acpi_size)length); if (!uid) { status = AE_NO_MEMORY; goto cleanup; @@ -309,7 +309,7 @@ acpi_ut_execute_CID(struct acpi_namespace_node *device_node, /* Area for CID strings starts after the CID PNP_DEVICE_ID array */ next_id_string = ACPI_CAST_PTR(char, cid_list->ids) + - ((acpi_size) count * sizeof(struct acpi_pnp_device_id)); + ((acpi_size)count * sizeof(struct acpi_pnp_device_id)); /* Copy/convert the CIDs to the return buffer */ @@ -413,7 +413,7 @@ acpi_ut_execute_CLS(struct acpi_namespace_node *device_node, cls = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_pnp_device_id) + - (acpi_size) length); + (acpi_size)length); if (!cls) { status = AE_NO_MEMORY; goto cleanup; diff --git a/drivers/acpi/acpica/utmath.c b/drivers/acpi/acpica/utmath.c index 667372093de1..2d6530ee7e51 100644 --- a/drivers/acpi/acpica/utmath.c +++ b/drivers/acpi/acpica/utmath.c @@ -236,8 +236,8 @@ acpi_ut_divide(u64 in_dividend, } remainder.full = remainder.full - dividend.full; - remainder.part.hi = (u32) - ((s32) remainder.part.hi); - remainder.part.lo = (u32) - ((s32) remainder.part.lo); + remainder.part.hi = (u32)-((s32)remainder.part.hi); + remainder.part.lo = (u32)-((s32)remainder.part.lo); if (remainder.part.lo) { remainder.part.hi--; diff --git a/drivers/acpi/acpica/utobject.c b/drivers/acpi/acpica/utobject.c index edad3f043ab9..72b9a062bbab 100644 --- a/drivers/acpi/acpica/utobject.c +++ b/drivers/acpi/acpica/utobject.c @@ -51,11 +51,11 @@ ACPI_MODULE_NAME("utobject") /* Local prototypes */ static acpi_status acpi_ut_get_simple_object_size(union acpi_operand_object *obj, - acpi_size * obj_length); + acpi_size *obj_length); static acpi_status acpi_ut_get_package_object_size(union acpi_operand_object *obj, - acpi_size * obj_length); + acpi_size *obj_length); static acpi_status acpi_ut_get_element_length(u8 object_type, @@ -177,7 +177,7 @@ union acpi_operand_object *acpi_ut_create_package_object(u32 count) * Create the element array. Count+1 allows the array to be null * terminated. */ - package_elements = ACPI_ALLOCATE_ZEROED(((acpi_size) count + + package_elements = ACPI_ALLOCATE_ZEROED(((acpi_size)count + 1) * sizeof(void *)); if (!package_elements) { ACPI_FREE(package_desc); @@ -454,7 +454,7 @@ void acpi_ut_delete_object_desc(union acpi_operand_object *object) static acpi_status acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object, - acpi_size * obj_length) + acpi_size *obj_length) { acpi_size length; acpi_size size; @@ -495,12 +495,12 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object, switch (internal_object->common.type) { case ACPI_TYPE_STRING: - length += (acpi_size) internal_object->string.length + 1; + length += (acpi_size)internal_object->string.length + 1; break; case ACPI_TYPE_BUFFER: - length += (acpi_size) internal_object->buffer.length; + length += (acpi_size)internal_object->buffer.length; break; case ACPI_TYPE_INTEGER: @@ -640,7 +640,7 @@ acpi_ut_get_element_length(u8 object_type, static acpi_status acpi_ut_get_package_object_size(union acpi_operand_object *internal_object, - acpi_size * obj_length) + acpi_size *obj_length) { acpi_status status; struct acpi_pkg_info info; @@ -665,7 +665,7 @@ acpi_ut_get_package_object_size(union acpi_operand_object *internal_object, */ info.length += ACPI_ROUND_UP_TO_NATIVE_WORD(sizeof(union acpi_object)) * - (acpi_size) info.num_packages; + (acpi_size)info.num_packages; /* Return the total package length */ @@ -689,7 +689,7 @@ acpi_ut_get_package_object_size(union acpi_operand_object *internal_object, acpi_status acpi_ut_get_object_size(union acpi_operand_object *internal_object, - acpi_size * obj_length) + acpi_size *obj_length) { acpi_status status; diff --git a/drivers/acpi/acpica/utosi.c b/drivers/acpi/acpica/utosi.c index b5cfe577fabf..3f5fed670271 100644 --- a/drivers/acpi/acpica/utosi.c +++ b/drivers/acpi/acpica/utosi.c @@ -150,7 +150,7 @@ acpi_status acpi_ut_initialize_interfaces(void) i < (ACPI_ARRAY_LENGTH(acpi_default_supported_interfaces) - 1); i++) { acpi_default_supported_interfaces[i].next = - &acpi_default_supported_interfaces[(acpi_size) i + 1]; + &acpi_default_supported_interfaces[(acpi_size)i + 1]; } acpi_os_release_mutex(acpi_gbl_osi_mutex); @@ -397,7 +397,7 @@ struct acpi_interface_info *acpi_ut_get_interface(acpi_string interface_name) * ******************************************************************************/ -acpi_status acpi_ut_osi_implementation(struct acpi_walk_state * walk_state) +acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state) { union acpi_operand_object *string_desc; union acpi_operand_object *return_desc; diff --git a/drivers/acpi/acpica/utownerid.c b/drivers/acpi/acpica/utownerid.c index 813520ab8ca4..3cd573c5f7f9 100644 --- a/drivers/acpi/acpica/utownerid.c +++ b/drivers/acpi/acpica/utownerid.c @@ -61,7 +61,7 @@ ACPI_MODULE_NAME("utownerid") * when the method exits or the table is unloaded. * ******************************************************************************/ -acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) +acpi_status acpi_ut_allocate_owner_id(acpi_owner_id *owner_id) { u32 i; u32 j; @@ -122,7 +122,7 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) * permanently allocated (prevents +1 overflow) */ *owner_id = - (acpi_owner_id) ((k + 1) + ACPI_MUL_32(j)); + (acpi_owner_id)((k + 1) + ACPI_MUL_32(j)); ACPI_DEBUG_PRINT((ACPI_DB_VALUES, "Allocated OwnerId: %2.2X\n", @@ -167,7 +167,7 @@ exit: * ******************************************************************************/ -void acpi_ut_release_owner_id(acpi_owner_id * owner_id_ptr) +void acpi_ut_release_owner_id(acpi_owner_id *owner_id_ptr) { acpi_owner_id owner_id = *owner_id_ptr; acpi_status status; diff --git a/drivers/acpi/acpica/utprint.c b/drivers/acpi/acpica/utprint.c index 208d71aa9f50..dd084cf52502 100644 --- a/drivers/acpi/acpica/utprint.c +++ b/drivers/acpi/acpica/utprint.c @@ -264,9 +264,9 @@ static char *acpi_ut_format_number(char *string, sign = '\0'; if (type & ACPI_FORMAT_SIGN) { - if ((s64) number < 0) { + if ((s64)number < 0) { sign = '-'; - number = -(s64) number; + number = -(s64)number; width--; } else if (type & ACPI_FORMAT_SIGN_PLUS) { sign = '+'; @@ -404,7 +404,7 @@ acpi_ut_vsnprintf(char *string, width = -1; if (isdigit((int)*format)) { format = acpi_ut_scan_number(format, &number); - width = (s32) number; + width = (s32)number; } else if (*format == '*') { ++format; width = va_arg(args, int); @@ -421,7 +421,7 @@ acpi_ut_vsnprintf(char *string, ++format; if (isdigit((int)*format)) { format = acpi_ut_scan_number(format, &number); - precision = (s32) number; + precision = (s32)number; } else if (*format == '*') { ++format; precision = va_arg(args, int); @@ -550,17 +550,17 @@ acpi_ut_vsnprintf(char *string, if (qualifier == 'L') { number = va_arg(args, u64); if (type & ACPI_FORMAT_SIGN) { - number = (s64) number; + number = (s64)number; } } else if (qualifier == 'l') { number = va_arg(args, unsigned long); if (type & ACPI_FORMAT_SIGN) { - number = (s32) number; + number = (s32)number; } } else if (qualifier == 'h') { number = (u16)va_arg(args, int); if (type & ACPI_FORMAT_SIGN) { - number = (s16) number; + number = (s16)number; } } else { number = va_arg(args, unsigned int); diff --git a/drivers/acpi/acpica/utstring.c b/drivers/acpi/acpica/utstring.c index 0b005728db4e..241259bfed64 100644 --- a/drivers/acpi/acpica/utstring.c +++ b/drivers/acpi/acpica/utstring.c @@ -130,7 +130,7 @@ void acpi_ut_print_string(char *string, u16 max_length) } else { /* All others will be Hex escapes */ - acpi_os_printf("\\x%2.2X", (s32) string[i]); + acpi_os_printf("\\x%2.2X", (s32)string[i]); } break; } diff --git a/drivers/acpi/acpica/utxface.c b/drivers/acpi/acpica/utxface.c index 68d4673f62e6..d9e6aac7dc83 100644 --- a/drivers/acpi/acpica/utxface.c +++ b/drivers/acpi/acpica/utxface.c @@ -127,7 +127,7 @@ ACPI_EXPORT_SYMBOL(acpi_subsystem_status) * and the value of out_buffer is undefined. * ******************************************************************************/ -acpi_status acpi_get_system_info(struct acpi_buffer * out_buffer) +acpi_status acpi_get_system_info(struct acpi_buffer *out_buffer) { struct acpi_system_info *info_ptr; acpi_status status; @@ -483,7 +483,7 @@ ACPI_EXPORT_SYMBOL(acpi_check_address_range) ******************************************************************************/ acpi_status acpi_decode_pld_buffer(u8 *in_buffer, - acpi_size length, struct acpi_pld_info ** return_buffer) + acpi_size length, struct acpi_pld_info **return_buffer) { struct acpi_pld_info *pld_info; u32 *buffer = ACPI_CAST_PTR(u32, in_buffer); diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 6026308f5b26..562603d7aabe 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h @@ -108,7 +108,7 @@ acpi_os_table_override(struct acpi_table_header *existing_table, #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_physical_table_override acpi_status acpi_os_physical_table_override(struct acpi_table_header *existing_table, - acpi_physical_address * new_address, + acpi_physical_address *new_address, u32 *new_table_length); #endif @@ -203,7 +203,7 @@ void acpi_os_unmap_memory(void *logical_address, acpi_size size); #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_physical_address acpi_status acpi_os_get_physical_address(void *logical_address, - acpi_physical_address * physical_address); + acpi_physical_address *physical_address); #endif /* @@ -379,14 +379,14 @@ acpi_status acpi_os_get_table_by_name(char *signature, u32 instance, struct acpi_table_header **table, - acpi_physical_address * address); + acpi_physical_address *address); #endif #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_index acpi_status acpi_os_get_table_by_index(u32 index, struct acpi_table_header **table, - u32 *instance, acpi_physical_address * address); + u32 *instance, acpi_physical_address *address); #endif #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_address diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 83583a251e72..fcd8119547bc 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -484,8 +484,8 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_load_tables(void)) ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_reallocate_root_table(void)) ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init - acpi_find_root_pointer(acpi_physical_address * - rsdp_address)) + acpi_find_root_pointer(acpi_physical_address + *rsdp_address)) ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_get_table_header(acpi_string signature, u32 instance, @@ -530,7 +530,7 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_get_handle(acpi_handle parent, acpi_string pathname, - acpi_handle * ret_handle)) + acpi_handle *ret_handle)) ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_attach_data(acpi_handle object, acpi_object_handler handler, @@ -575,15 +575,15 @@ ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_get_next_object(acpi_object_type type, acpi_handle parent, acpi_handle child, - acpi_handle * out_handle)) + acpi_handle *out_handle)) ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_get_type(acpi_handle object, - acpi_object_type * out_type)) + acpi_object_type *out_type)) ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_get_parent(acpi_handle object, - acpi_handle * out_handle)) + acpi_handle *out_handle)) /* * Handler interfaces @@ -755,7 +755,7 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_wakeup_gpes(void)) ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_gpe_device(u32 gpe_index, - acpi_handle * gpe_device)) + acpi_handle *gpe_device)) ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_install_gpe_block(acpi_handle gpe_device, @@ -771,8 +771,8 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status * Resource interfaces */ typedef -acpi_status(*acpi_walk_resource_callback) (struct acpi_resource * resource, - void *context); +acpi_status (*acpi_walk_resource_callback) (struct acpi_resource * resource, + void *context); ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_get_vendor_resource(acpi_handle device, @@ -938,7 +938,8 @@ ACPI_DBG_DEPENDENT_RETURN_VOID(void ACPI_APP_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(1) void ACPI_INTERNAL_VAR_XFACE acpi_log_error(const char *format, ...)) - acpi_status acpi_initialize_debugger(void); + +acpi_status acpi_initialize_debugger(void); void acpi_terminate_debugger(void); diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index b9a8b72e297c..cb389efd321c 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -893,7 +893,7 @@ typedef u8 acpi_adr_space_type; /* Sleep function dispatch */ -typedef acpi_status(*acpi_sleep_function) (u8 sleep_state); +typedef acpi_status (*acpi_sleep_function) (u8 sleep_state); struct acpi_sleep_functions { acpi_sleep_function legacy_function; @@ -1072,20 +1072,21 @@ void (*acpi_notify_handler) (acpi_handle device, u32 value, void *context); typedef void (*acpi_object_handler) (acpi_handle object, void *data); -typedef acpi_status(*acpi_init_handler) (acpi_handle object, u32 function); +typedef +acpi_status (*acpi_init_handler) (acpi_handle object, u32 function); #define ACPI_INIT_DEVICE_INI 1 typedef -acpi_status(*acpi_exception_handler) (acpi_status aml_status, - acpi_name name, - u16 opcode, - u32 aml_offset, void *context); +acpi_status (*acpi_exception_handler) (acpi_status aml_status, + acpi_name name, + u16 opcode, + u32 aml_offset, void *context); /* Table Event handler (Load, load_table, etc.) and types */ typedef -acpi_status(*acpi_table_handler) (u32 event, void *table, void *context); +acpi_status (*acpi_table_handler) (u32 event, void *table, void *context); #define ACPI_TABLE_LOAD 0x0 #define ACPI_TABLE_UNLOAD 0x1 @@ -1094,12 +1095,12 @@ acpi_status(*acpi_table_handler) (u32 event, void *table, void *context); /* Address Spaces (For Operation Regions) */ typedef -acpi_status(*acpi_adr_space_handler) (u32 function, - acpi_physical_address address, - u32 bit_width, - u64 *value, - void *handler_context, - void *region_context); +acpi_status (*acpi_adr_space_handler) (u32 function, + acpi_physical_address address, + u32 bit_width, + u64 *value, + void *handler_context, + void *region_context); #define ACPI_DEFAULT_HANDLER NULL @@ -1112,18 +1113,18 @@ struct acpi_connection_info { }; typedef -acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle, - u32 function, - void *handler_context, - void **region_context); +acpi_status (*acpi_adr_space_setup) (acpi_handle region_handle, + u32 function, + void *handler_context, + void **region_context); #define ACPI_REGION_ACTIVATE 0 #define ACPI_REGION_DEACTIVATE 1 typedef -acpi_status(*acpi_walk_callback) (acpi_handle object, - u32 nesting_level, - void *context, void **return_value); +acpi_status (*acpi_walk_callback) (acpi_handle object, + u32 nesting_level, + void *context, void **return_value); typedef u32 (*acpi_interface_handler) (acpi_string interface_name, u32 supported); diff --git a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c index d0e6b857d8d1..546cf4a503b7 100644 --- a/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c +++ b/tools/power/acpi/os_specific/service_layers/oslinuxtbl.c @@ -91,7 +91,7 @@ osl_get_customized_table(char *pathname, char *signature, u32 instance, struct acpi_table_header **table, - acpi_physical_address * address); + acpi_physical_address *address); static acpi_status osl_list_bios_tables(void); @@ -99,7 +99,7 @@ static acpi_status osl_get_bios_table(char *signature, u32 instance, struct acpi_table_header **table, - acpi_physical_address * address); + acpi_physical_address *address); static acpi_status osl_get_last_status(acpi_status default_status); @@ -187,7 +187,7 @@ static acpi_status osl_get_last_status(acpi_status default_status) acpi_status acpi_os_get_table_by_address(acpi_physical_address address, - struct acpi_table_header ** table) + struct acpi_table_header **table) { u32 table_length; struct acpi_table_header *mapped_table; @@ -252,8 +252,8 @@ exit: acpi_status acpi_os_get_table_by_name(char *signature, u32 instance, - struct acpi_table_header ** table, - acpi_physical_address * address) + struct acpi_table_header **table, + acpi_physical_address *address) { acpi_status status; @@ -380,8 +380,8 @@ static acpi_status osl_add_table_to_list(char *signature, u32 instance) acpi_status acpi_os_get_table_by_index(u32 index, - struct acpi_table_header ** table, - u32 *instance, acpi_physical_address * address) + struct acpi_table_header **table, + u32 *instance, acpi_physical_address *address) { struct osl_table_info *info; acpi_status status; @@ -447,7 +447,7 @@ osl_find_rsdp_via_efi_by_keyword(FILE * file, const char *keyword) } } - return ((acpi_physical_address) (address)); + return ((acpi_physical_address)(address)); } /****************************************************************************** @@ -751,10 +751,10 @@ static acpi_status osl_list_bios_tables(void) for (i = 0; i < number_of_tables; ++i, table_data += item_size) { if (osl_can_use_xsdt()) { table_address = - (acpi_physical_address) (*ACPI_CAST64(table_data)); + (acpi_physical_address)(*ACPI_CAST64(table_data)); } else { table_address = - (acpi_physical_address) (*ACPI_CAST32(table_data)); + (acpi_physical_address)(*ACPI_CAST32(table_data)); } /* Skip NULL entries in RSDT/XSDT */ @@ -800,7 +800,7 @@ static acpi_status osl_get_bios_table(char *signature, u32 instance, struct acpi_table_header **table, - acpi_physical_address * address) + acpi_physical_address *address) { struct acpi_table_header *local_table = NULL; struct acpi_table_header *mapped_table = NULL; @@ -833,38 +833,37 @@ osl_get_bios_table(char *signature, if ((gbl_fadt->header.length >= MIN_FADT_FOR_XDSDT) && gbl_fadt->Xdsdt) { table_address = - (acpi_physical_address) gbl_fadt->Xdsdt; + (acpi_physical_address)gbl_fadt->Xdsdt; } else if ((gbl_fadt->header.length >= MIN_FADT_FOR_DSDT) && gbl_fadt->dsdt) { table_address = - (acpi_physical_address) gbl_fadt->dsdt; + (acpi_physical_address)gbl_fadt->dsdt; } } else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_FACS)) { if ((gbl_fadt->header.length >= MIN_FADT_FOR_XFACS) && gbl_fadt->Xfacs) { table_address = - (acpi_physical_address) gbl_fadt->Xfacs; + (acpi_physical_address)gbl_fadt->Xfacs; } else if ((gbl_fadt->header.length >= MIN_FADT_FOR_FACS) && gbl_fadt->facs) { table_address = - (acpi_physical_address) gbl_fadt->facs; + (acpi_physical_address)gbl_fadt->facs; } } else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_XSDT)) { if (!gbl_revision) { return (AE_BAD_SIGNATURE); } table_address = - (acpi_physical_address) gbl_rsdp. + (acpi_physical_address)gbl_rsdp. xsdt_physical_address; } else if (ACPI_COMPARE_NAME(signature, ACPI_SIG_RSDT)) { table_address = - (acpi_physical_address) gbl_rsdp. + (acpi_physical_address)gbl_rsdp. rsdt_physical_address; } else { - table_address = - (acpi_physical_address) gbl_rsdp_address; + table_address = (acpi_physical_address)gbl_rsdp_address; signature = ACPI_SIG_RSDP; } @@ -904,12 +903,12 @@ osl_get_bios_table(char *signature, for (i = 0; i < number_of_tables; ++i, table_data += item_size) { if (osl_can_use_xsdt()) { table_address = - (acpi_physical_address) (*ACPI_CAST64 - (table_data)); + (acpi_physical_address)(*ACPI_CAST64 + (table_data)); } else { table_address = - (acpi_physical_address) (*ACPI_CAST32 - (table_data)); + (acpi_physical_address)(*ACPI_CAST32 + (table_data)); } /* Skip NULL entries in RSDT/XSDT */ @@ -1301,7 +1300,7 @@ osl_get_customized_table(char *pathname, char *signature, u32 instance, struct acpi_table_header **table, - acpi_physical_address * address) + acpi_physical_address *address) { void *table_dir; u32 current_instance = 0; diff --git a/tools/power/acpi/os_specific/service_layers/osunixxf.c b/tools/power/acpi/os_specific/service_layers/osunixxf.c index 08cb8b2035f2..88aa66ef4ad5 100644 --- a/tools/power/acpi/os_specific/service_layers/osunixxf.c +++ b/tools/power/acpi/os_specific/service_layers/osunixxf.c @@ -246,8 +246,8 @@ acpi_physical_address acpi_os_get_root_pointer(void) *****************************************************************************/ acpi_status -acpi_os_predefined_override(const struct acpi_predefined_names * init_val, - acpi_string * new_val) +acpi_os_predefined_override(const struct acpi_predefined_names *init_val, + acpi_string *new_val) { if (!init_val || !new_val) { @@ -274,8 +274,8 @@ acpi_os_predefined_override(const struct acpi_predefined_names * init_val, *****************************************************************************/ acpi_status -acpi_os_table_override(struct acpi_table_header * existing_table, - struct acpi_table_header ** new_table) +acpi_os_table_override(struct acpi_table_header *existing_table, + struct acpi_table_header **new_table) { if (!existing_table || !new_table) { @@ -311,8 +311,8 @@ acpi_os_table_override(struct acpi_table_header * existing_table, *****************************************************************************/ acpi_status -acpi_os_physical_table_override(struct acpi_table_header * existing_table, - acpi_physical_address * new_address, +acpi_os_physical_table_override(struct acpi_table_header *existing_table, + acpi_physical_address *new_address, u32 *new_table_length) { @@ -506,7 +506,7 @@ acpi_status acpi_os_get_line(char *buffer, u32 buffer_length, u32 *bytes_read) void *acpi_os_map_memory(acpi_physical_address where, acpi_size length) { - return (ACPI_TO_POINTER((acpi_size) where)); + return (ACPI_TO_POINTER((acpi_size)where)); } /****************************************************************************** @@ -603,9 +603,9 @@ void acpi_os_free(void *mem) acpi_status acpi_os_create_semaphore(u32 max_units, - u32 initial_units, acpi_handle * out_handle) + u32 initial_units, acpi_handle *out_handle) { - *out_handle = (acpi_handle) 1; + *out_handle = (acpi_handle)1; return (AE_OK); } @@ -640,7 +640,7 @@ acpi_status acpi_os_signal_semaphore(acpi_handle handle, u32 units) acpi_status acpi_os_create_semaphore(u32 max_units, - u32 initial_units, acpi_handle * out_handle) + u32 initial_units, acpi_handle *out_handle) { sem_t *sem; @@ -672,7 +672,7 @@ acpi_os_create_semaphore(u32 max_units, } #endif - *out_handle = (acpi_handle) sem; + *out_handle = (acpi_handle)sem; return (AE_OK); } @@ -1035,7 +1035,7 @@ acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id, *****************************************************************************/ acpi_status -acpi_os_write_pci_configuration(struct acpi_pci_id * pci_id, +acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id, u32 pci_register, u64 value, u32 width) { diff --git a/tools/power/acpi/tools/acpidump/apdump.c b/tools/power/acpi/tools/acpidump/apdump.c index 9c2db0eb467f..a39e44533369 100644 --- a/tools/power/acpi/tools/acpidump/apdump.c +++ b/tools/power/acpi/tools/acpidump/apdump.c @@ -294,7 +294,7 @@ int ap_dump_table_by_address(char *ascii_address) return (-1); } - address = (acpi_physical_address) long_address; + address = (acpi_physical_address)long_address; status = acpi_os_get_table_by_address(address, &table); if (ACPI_FAILURE(status)) { acpi_log_error("Could not get table at 0x%8.8X%8.8X, %s\n", -- cgit v1.2.3 From 6a0df32c22fdfc414e6613c1bc911f19f39df01b Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Thu, 5 May 2016 13:00:36 +0800 Subject: ACPICA: Move all ASCII utilities to a common file ACPICA commit ba60e4500053010bf775d58f6f61febbdb94d817 New file is utascii.c Link: https://github.com/acpica/acpica/commit/ba60e450 Signed-off-by: Bob Moore Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/Makefile | 1 + drivers/acpi/acpica/actables.h | 2 - drivers/acpi/acpica/acutils.h | 13 ++- drivers/acpi/acpica/dbnames.c | 2 +- drivers/acpi/acpica/exnames.c | 2 +- drivers/acpi/acpica/tbdata.c | 6 +- drivers/acpi/acpica/tbfind.c | 2 +- drivers/acpi/acpica/tbinstal.c | 6 +- drivers/acpi/acpica/tbutils.c | 27 ------ drivers/acpi/acpica/utascii.c | 140 +++++++++++++++++++++++++++++++ drivers/acpi/acpica/utstring.c | 69 +-------------- tools/power/acpi/tools/acpidump/Makefile | 1 + tools/power/acpi/tools/acpidump/apdump.c | 8 +- 13 files changed, 168 insertions(+), 111 deletions(-) create mode 100644 drivers/acpi/acpica/utascii.c (limited to 'tools/power') diff --git a/drivers/acpi/acpica/Makefile b/drivers/acpi/acpica/Makefile index 188597fface7..227bb7bb19d7 100644 --- a/drivers/acpi/acpica/Makefile +++ b/drivers/acpi/acpica/Makefile @@ -150,6 +150,7 @@ acpi-y += \ acpi-y += \ utaddress.o \ utalloc.o \ + utascii.o \ utbuffer.o \ utcopy.o \ utexcep.o \ diff --git a/drivers/acpi/acpica/actables.h b/drivers/acpi/acpica/actables.h index 848ad3ac938f..cd5a135fcf29 100644 --- a/drivers/acpi/acpica/actables.h +++ b/drivers/acpi/acpica/actables.h @@ -161,8 +161,6 @@ acpi_tb_install_fixed_table(acpi_physical_address address, acpi_status acpi_tb_parse_root_table(acpi_physical_address rsdp_address); -u8 acpi_is_valid_signature(char *signature); - /* * tbxfload */ diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h index 107f9e0090f7..a7dbb2b882cf 100644 --- a/drivers/acpi/acpica/acutils.h +++ b/drivers/acpi/acpica/acutils.h @@ -166,6 +166,15 @@ struct acpi_pkg_info { #define DB_DWORD_DISPLAY 4 #define DB_QWORD_DISPLAY 8 +/* + * utascii - ASCII utilities + */ +u8 acpi_ut_valid_nameseg(char *signature); + +u8 acpi_ut_valid_name_char(char character, u32 position); + +void acpi_ut_check_and_repair_ascii(u8 *name, char *repaired_name, u32 count); + /* * utnonansi - Non-ANSI C library functions */ @@ -579,10 +588,6 @@ void acpi_ut_print_string(char *string, u16 max_length); void ut_convert_backslashes(char *pathname); #endif -u8 acpi_ut_valid_acpi_name(char *name); - -u8 acpi_ut_valid_acpi_char(char character, u32 position); - void acpi_ut_repair_name(char *name); #if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION) diff --git a/drivers/acpi/acpica/dbnames.c b/drivers/acpi/acpica/dbnames.c index 4c9e59a86db1..8667f14d535e 100644 --- a/drivers/acpi/acpica/dbnames.c +++ b/drivers/acpi/acpica/dbnames.c @@ -709,7 +709,7 @@ acpi_db_integrity_walk(acpi_handle obj_handle, return (AE_OK); } - if (!acpi_ut_valid_acpi_name(node->name.ascii)) { + if (!acpi_ut_valid_nameseg(node->name.ascii)) { acpi_os_printf("Invalid AcpiName for Node %p\n", node); return (AE_OK); } diff --git a/drivers/acpi/acpica/exnames.c b/drivers/acpi/acpica/exnames.c index 27c11ab5eb04..3d6af93fe561 100644 --- a/drivers/acpi/acpica/exnames.c +++ b/drivers/acpi/acpica/exnames.c @@ -178,7 +178,7 @@ static acpi_status acpi_ex_name_segment(u8 ** in_aml_address, char *name_string) for (index = 0; (index < ACPI_NAME_SIZE) - && (acpi_ut_valid_acpi_char(*aml_address, 0)); index++) { + && (acpi_ut_valid_name_char(*aml_address, 0)); index++) { char_buf[index] = *aml_address++; ACPI_DEBUG_PRINT((ACPI_DB_LOAD, "%c\n", char_buf[index])); } diff --git a/drivers/acpi/acpica/tbdata.c b/drivers/acpi/acpica/tbdata.c index d471df3988bb..1388a19e5db8 100644 --- a/drivers/acpi/acpica/tbdata.c +++ b/drivers/acpi/acpica/tbdata.c @@ -401,9 +401,9 @@ acpi_tb_verify_temp_table(struct acpi_table_desc *table_desc, char *signature) ACPI_EXCEPTION((AE_INFO, AE_NO_MEMORY, "%4.4s 0x%8.8X%8.8X" " Attempted table install failed", - acpi_ut_valid_acpi_name(table_desc-> - signature. - ascii) ? + acpi_ut_valid_nameseg(table_desc-> + signature. + ascii) ? table_desc->signature.ascii : "????", ACPI_FORMAT_UINT64(table_desc-> address))); diff --git a/drivers/acpi/acpica/tbfind.c b/drivers/acpi/acpica/tbfind.c index f2d08034630e..e348d616e60f 100644 --- a/drivers/acpi/acpica/tbfind.c +++ b/drivers/acpi/acpica/tbfind.c @@ -76,7 +76,7 @@ acpi_tb_find_table(char *signature, /* Validate the input table signature */ - if (!acpi_is_valid_signature(signature)) { + if (!acpi_ut_valid_nameseg(signature)) { return_ACPI_STATUS(AE_BAD_SIGNATURE); } diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c index 4dc6108de4ff..8b13052128fc 100644 --- a/drivers/acpi/acpica/tbinstal.c +++ b/drivers/acpi/acpica/tbinstal.c @@ -299,9 +299,9 @@ acpi_tb_install_standard_table(acpi_physical_address address, ACPI_BIOS_ERROR((AE_INFO, "Table has invalid signature [%4.4s] (0x%8.8X), " "must be SSDT or OEMx", - acpi_ut_valid_acpi_name(new_table_desc. - signature. - ascii) ? + acpi_ut_valid_nameseg(new_table_desc. + signature. + ascii) ? new_table_desc.signature. ascii : "????", new_table_desc.signature.integer)); diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index a962a85b1d02..e28553914bf5 100644 --- a/drivers/acpi/acpica/tbutils.c +++ b/drivers/acpi/acpica/tbutils.c @@ -380,30 +380,3 @@ next_table: acpi_os_unmap_memory(table, length); return_ACPI_STATUS(AE_OK); } - -/******************************************************************************* - * - * FUNCTION: acpi_is_valid_signature - * - * PARAMETERS: signature - Sig string to be validated - * - * RETURN: TRUE if signature is has 4 valid ACPI characters - * - * DESCRIPTION: Validate an ACPI table signature. - * - ******************************************************************************/ - -u8 acpi_is_valid_signature(char *signature) -{ - u32 i; - - /* Validate each character in the signature */ - - for (i = 0; i < ACPI_NAME_SIZE; i++) { - if (!acpi_ut_valid_acpi_char(signature[i], i)) { - return (FALSE); - } - } - - return (TRUE); -} diff --git a/drivers/acpi/acpica/utascii.c b/drivers/acpi/acpica/utascii.c new file mode 100644 index 000000000000..706c1f346490 --- /dev/null +++ b/drivers/acpi/acpica/utascii.c @@ -0,0 +1,140 @@ +/****************************************************************************** + * + * Module Name: utascii - Utility ascii functions + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2016, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +#include +#include "accommon.h" + +/******************************************************************************* + * + * FUNCTION: acpi_ut_valid_nameseg + * + * PARAMETERS: name - The name or table signature to be examined. + * Four characters, does not have to be a + * NULL terminated string. + * + * RETURN: TRUE if signature is has 4 valid ACPI characters + * + * DESCRIPTION: Validate an ACPI table signature. + * + ******************************************************************************/ + +u8 acpi_ut_valid_nameseg(char *name) +{ + u32 i; + + /* Validate each character in the signature */ + + for (i = 0; i < ACPI_NAME_SIZE; i++) { + if (!acpi_ut_valid_name_char(name[i], i)) { + return (FALSE); + } + } + + return (TRUE); +} + +/******************************************************************************* + * + * FUNCTION: acpi_ut_valid_name_char + * + * PARAMETERS: char - The character to be examined + * position - Byte position (0-3) + * + * RETURN: TRUE if the character is valid, FALSE otherwise + * + * DESCRIPTION: Check for a valid ACPI character. Must be one of: + * 1) Upper case alpha + * 2) numeric + * 3) underscore + * + * We allow a '!' as the last character because of the ASF! table + * + ******************************************************************************/ + +u8 acpi_ut_valid_name_char(char character, u32 position) +{ + + if (!((character >= 'A' && character <= 'Z') || + (character >= '0' && character <= '9') || (character == '_'))) { + + /* Allow a '!' in the last position */ + + if (character == '!' && position == 3) { + return (TRUE); + } + + return (FALSE); + } + + return (TRUE); +} + +/******************************************************************************* + * + * FUNCTION: acpi_ut_check_and_repair_ascii + * + * PARAMETERS: name - Ascii string + * count - Number of characters to check + * + * RETURN: None + * + * DESCRIPTION: Ensure that the requested number of characters are printable + * Ascii characters. Sets non-printable and null chars to . + * + ******************************************************************************/ + +void acpi_ut_check_and_repair_ascii(u8 *name, char *repaired_name, u32 count) +{ + u32 i; + + for (i = 0; i < count; i++) { + repaired_name[i] = (char)name[i]; + + if (!name[i]) { + return; + } + if (!isprint(name[i])) { + repaired_name[i] = ' '; + } + } +} diff --git a/drivers/acpi/acpica/utstring.c b/drivers/acpi/acpica/utstring.c index 241259bfed64..288913a0e709 100644 --- a/drivers/acpi/acpica/utstring.c +++ b/drivers/acpi/acpica/utstring.c @@ -143,73 +143,6 @@ void acpi_ut_print_string(char *string, u16 max_length) } } -/******************************************************************************* - * - * FUNCTION: acpi_ut_valid_acpi_char - * - * PARAMETERS: char - The character to be examined - * position - Byte position (0-3) - * - * RETURN: TRUE if the character is valid, FALSE otherwise - * - * DESCRIPTION: Check for a valid ACPI character. Must be one of: - * 1) Upper case alpha - * 2) numeric - * 3) underscore - * - * We allow a '!' as the last character because of the ASF! table - * - ******************************************************************************/ - -u8 acpi_ut_valid_acpi_char(char character, u32 position) -{ - - if (!((character >= 'A' && character <= 'Z') || - (character >= '0' && character <= '9') || (character == '_'))) { - - /* Allow a '!' in the last position */ - - if (character == '!' && position == 3) { - return (TRUE); - } - - return (FALSE); - } - - return (TRUE); -} - -/******************************************************************************* - * - * FUNCTION: acpi_ut_valid_acpi_name - * - * PARAMETERS: name - The name to be examined. Does not have to - * be NULL terminated string. - * - * RETURN: TRUE if the name is valid, FALSE otherwise - * - * DESCRIPTION: Check for a valid ACPI name. Each character must be one of: - * 1) Upper case alpha - * 2) numeric - * 3) underscore - * - ******************************************************************************/ - -u8 acpi_ut_valid_acpi_name(char *name) -{ - u32 i; - - ACPI_FUNCTION_ENTRY(); - - for (i = 0; i < ACPI_NAME_SIZE; i++) { - if (!acpi_ut_valid_acpi_char(name[i], i)) { - return (FALSE); - } - } - - return (TRUE); -} - /******************************************************************************* * * FUNCTION: acpi_ut_repair_name @@ -253,7 +186,7 @@ void acpi_ut_repair_name(char *name) /* Check each character in the name */ for (i = 0; i < ACPI_NAME_SIZE; i++) { - if (acpi_ut_valid_acpi_char(name[i], i)) { + if (acpi_ut_valid_name_char(name[i], i)) { continue; } diff --git a/tools/power/acpi/tools/acpidump/Makefile b/tools/power/acpi/tools/acpidump/Makefile index 8d761576e91b..2942cdced2ad 100644 --- a/tools/power/acpi/tools/acpidump/Makefile +++ b/tools/power/acpi/tools/acpidump/Makefile @@ -31,6 +31,7 @@ TOOL_OBJS = \ osunixxf.o\ tbprint.o\ tbxfroot.o\ + utascii.o\ utbuffer.o\ utdebug.o\ utexcep.o\ diff --git a/tools/power/acpi/tools/acpidump/apdump.c b/tools/power/acpi/tools/acpidump/apdump.c index a39e44533369..fb8f1d9e3b1b 100644 --- a/tools/power/acpi/tools/acpidump/apdump.c +++ b/tools/power/acpi/tools/acpidump/apdump.c @@ -68,7 +68,7 @@ u8 ap_is_valid_header(struct acpi_table_header *table) /* Make sure signature is all ASCII and a valid ACPI name */ - if (!acpi_ut_valid_acpi_name(table->signature)) { + if (!acpi_ut_valid_nameseg(table->signature)) { acpi_log_error("Table signature (0x%8.8X) is invalid\n", *(u32 *)table->signature); return (FALSE); @@ -407,6 +407,12 @@ int ap_dump_table_from_file(char *pathname) return (-1); } + if (!acpi_ut_valid_nameseg(table->signature)) { + acpi_log_error + ("No valid ACPI signature was found in input file %s\n", + pathname); + } + /* File must be at least as long as the table length */ if (table->length > file_size) { -- cgit v1.2.3