diff options
Diffstat (limited to 'drivers/acpi/utilities/utmisc.c')
-rw-r--r-- | drivers/acpi/utilities/utmisc.c | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c index 7364f5f8c9cd..60f36130663c 100644 --- a/drivers/acpi/utilities/utmisc.c +++ b/drivers/acpi/utilities/utmisc.c | |||
@@ -97,6 +97,7 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) | |||
97 | 97 | ||
98 | for (k = acpi_gbl_next_owner_id_offset; k < 32; k++) { | 98 | for (k = acpi_gbl_next_owner_id_offset; k < 32; k++) { |
99 | if (acpi_gbl_owner_id_mask[j] == ACPI_UINT32_MAX) { | 99 | if (acpi_gbl_owner_id_mask[j] == ACPI_UINT32_MAX) { |
100 | |||
100 | /* There are no free IDs in this mask */ | 101 | /* There are no free IDs in this mask */ |
101 | 102 | ||
102 | break; | 103 | break; |
@@ -273,6 +274,7 @@ void acpi_ut_print_string(char *string, u8 max_length) | |||
273 | 274 | ||
274 | acpi_os_printf("\""); | 275 | acpi_os_printf("\""); |
275 | for (i = 0; string[i] && (i < max_length); i++) { | 276 | for (i = 0; string[i] && (i < max_length); i++) { |
277 | |||
276 | /* Escape sequences */ | 278 | /* Escape sequences */ |
277 | 279 | ||
278 | switch (string[i]) { | 280 | switch (string[i]) { |
@@ -601,11 +603,13 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer) | |||
601 | 603 | ||
602 | while (*string) { | 604 | while (*string) { |
603 | if (ACPI_IS_DIGIT(*string)) { | 605 | if (ACPI_IS_DIGIT(*string)) { |
606 | |||
604 | /* Convert ASCII 0-9 to Decimal value */ | 607 | /* Convert ASCII 0-9 to Decimal value */ |
605 | 608 | ||
606 | this_digit = ((u8) * string) - '0'; | 609 | this_digit = ((u8) * string) - '0'; |
607 | } else { | 610 | } else { |
608 | if (base == 10) { | 611 | if (base == 10) { |
612 | |||
609 | /* Digit is out of range */ | 613 | /* Digit is out of range */ |
610 | 614 | ||
611 | goto error_exit; | 615 | goto error_exit; |
@@ -613,6 +617,7 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer) | |||
613 | 617 | ||
614 | this_digit = (u8) ACPI_TOUPPER(*string); | 618 | this_digit = (u8) ACPI_TOUPPER(*string); |
615 | if (ACPI_IS_XDIGIT((char)this_digit)) { | 619 | if (ACPI_IS_XDIGIT((char)this_digit)) { |
620 | |||
616 | /* Convert ASCII Hex char to value */ | 621 | /* Convert ASCII Hex char to value */ |
617 | 622 | ||
618 | this_digit = this_digit - 'A' + 10; | 623 | this_digit = this_digit - 'A' + 10; |
@@ -727,6 +732,7 @@ acpi_ut_walk_package_tree(union acpi_operand_object * source_object, | |||
727 | } | 732 | } |
728 | 733 | ||
729 | while (state) { | 734 | while (state) { |
735 | |||
730 | /* Get one element of the package */ | 736 | /* Get one element of the package */ |
731 | 737 | ||
732 | this_index = state->pkg.index; | 738 | this_index = state->pkg.index; |
@@ -814,31 +820,6 @@ acpi_ut_walk_package_tree(union acpi_operand_object * source_object, | |||
814 | 820 | ||
815 | /******************************************************************************* | 821 | /******************************************************************************* |
816 | * | 822 | * |
817 | * FUNCTION: acpi_ut_generate_checksum | ||
818 | * | ||
819 | * PARAMETERS: Buffer - Buffer to be scanned | ||
820 | * Length - number of bytes to examine | ||
821 | * | ||
822 | * RETURN: The generated checksum | ||
823 | * | ||
824 | * DESCRIPTION: Generate a checksum on a raw buffer | ||
825 | * | ||
826 | ******************************************************************************/ | ||
827 | |||
828 | u8 acpi_ut_generate_checksum(u8 * buffer, u32 length) | ||
829 | { | ||
830 | u32 i; | ||
831 | signed char sum = 0; | ||
832 | |||
833 | for (i = 0; i < length; i++) { | ||
834 | sum = (signed char)(sum + buffer[i]); | ||
835 | } | ||
836 | |||
837 | return ((u8) (0 - sum)); | ||
838 | } | ||
839 | |||
840 | /******************************************************************************* | ||
841 | * | ||
842 | * FUNCTION: acpi_ut_error, acpi_ut_warning, acpi_ut_info | 823 | * FUNCTION: acpi_ut_error, acpi_ut_warning, acpi_ut_info |
843 | * | 824 | * |
844 | * PARAMETERS: module_name - Caller's module name (for error output) | 825 | * PARAMETERS: module_name - Caller's module name (for error output) |