Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPICA: De-macroize calls to standard C library functions

ACPICA commit 3b1026e0bdd3c32eb6d5d313f3ba0b1fee7597b4
ACPICA commit 00f0dc83f5cfca53b27a3213ae0d7719b88c2d6b
ACPICA commit 47d22a738d0e19fd241ffe4e3e9d4e198e4afc69

Across all of ACPICA. Replace C library macros such as ACPI_STRLEN with the
standard names such as strlen. The original purpose for these macros is
long since obsolete.
Also cast various invocations as necessary. Bob Moore, Jung-uk Kim, Lv Zheng.

Link: https://github.com/acpica/acpica/commit/3b1026e0
Link: https://github.com/acpica/acpica/commit/00f0dc83
Link: https://github.com/acpica/acpica/commit/47d22a73
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Jung-uk Kim <jkim@FreeBSD.org>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Bob Moore and committed by
Rafael J. Wysocki
4fa4616e 63c43812

+260 -312
+22 -24
drivers/acpi/acpica/acutils.h
··· 210 210 */ 211 211 #ifndef ACPI_USE_SYSTEM_CLIBRARY 212 212 213 - acpi_size acpi_ut_strlen(const char *string); 213 + acpi_size strlen(const char *string); 214 214 215 - char *acpi_ut_strchr(const char *string, int ch); 215 + char *strchr(const char *string, int ch); 216 216 217 - char *acpi_ut_strcpy(char *dst_string, const char *src_string); 217 + char *strcpy(char *dst_string, const char *src_string); 218 218 219 - char *acpi_ut_strncpy(char *dst_string, 220 - const char *src_string, acpi_size count); 219 + char *strncpy(char *dst_string, const char *src_string, acpi_size count); 221 220 222 - int acpi_ut_memcmp(const char *buffer1, const char *buffer2, acpi_size count); 221 + int strncmp(const char *string1, const char *string2, acpi_size count); 223 222 224 - int acpi_ut_strncmp(const char *string1, const char *string2, acpi_size count); 223 + int strcmp(const char *string1, const char *string2); 225 224 226 - int acpi_ut_strcmp(const char *string1, const char *string2); 225 + char *strcat(char *dst_string, const char *src_string); 227 226 228 - char *acpi_ut_strcat(char *dst_string, const char *src_string); 227 + char *strncat(char *dst_string, const char *src_string, acpi_size count); 229 228 230 - char *acpi_ut_strncat(char *dst_string, 231 - const char *src_string, acpi_size count); 229 + u32 strtoul(const char *string, char **terminator, u32 base); 232 230 233 - u32 acpi_ut_strtoul(const char *string, char **terminator, u32 base); 231 + char *strstr(char *string1, char *string2); 234 232 235 - char *acpi_ut_strstr(char *string1, char *string2); 233 + int memcmp(void *buffer1, void *buffer2, acpi_size count); 236 234 237 - void *acpi_ut_memcpy(void *dest, const void *src, acpi_size count); 235 + void *memcpy(void *dest, const void *src, acpi_size count); 238 236 239 - void *acpi_ut_memset(void *dest, u8 value, acpi_size count); 237 + void *memset(void *dest, int value, acpi_size count); 240 238 241 - int acpi_ut_to_upper(int c); 239 + int toupper(int c); 242 240 243 - int acpi_ut_to_lower(int c); 241 + int tolower(int c); 244 242 245 243 extern const u8 _acpi_ctype[]; 246 244 ··· 253 255 #define _ACPI_UP 0x01 /* 'A'-'Z' */ 254 256 #define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ 255 257 256 - #define ACPI_IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) 257 - #define ACPI_IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) 258 - #define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD)) 259 - #define ACPI_IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP)) 260 - #define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) 261 - #define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU)) 262 - #define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) 258 + #define isdigit(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) 259 + #define isspace(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) 260 + #define isxdigit(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD)) 261 + #define isupper(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP)) 262 + #define islower(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) 263 + #define isprint(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU)) 264 + #define isalpha(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) 263 265 264 266 #endif /* !ACPI_USE_SYSTEM_CLIBRARY */ 265 267
+1 -1
drivers/acpi/acpica/dsfield.c
··· 502 502 } 503 503 } 504 504 505 - ACPI_MEMSET(&info, 0, sizeof(struct acpi_create_field_info)); 505 + memset(&info, 0, sizeof(struct acpi_create_field_info)); 506 506 507 507 /* Second arg is the field flags */ 508 508
+1 -1
drivers/acpi/acpica/dsinit.c
··· 207 207 208 208 /* Set all init info to zero */ 209 209 210 - ACPI_MEMSET(&info, 0, sizeof(struct acpi_init_walk_info)); 210 + memset(&info, 0, sizeof(struct acpi_init_walk_info)); 211 211 212 212 info.owner_id = owner_id; 213 213 info.table_index = table_index;
+3 -4
drivers/acpi/acpica/dsobject.c
··· 339 339 /* Initialize buffer from the byte_list (if present) */ 340 340 341 341 if (byte_list) { 342 - ACPI_MEMCPY(obj_desc->buffer.pointer, 343 - byte_list->named.data, byte_list_length); 342 + memcpy(obj_desc->buffer.pointer, byte_list->named.data, 343 + byte_list_length); 344 344 } 345 345 } 346 346 ··· 750 750 case ACPI_TYPE_STRING: 751 751 752 752 obj_desc->string.pointer = op->common.value.string; 753 - obj_desc->string.length = 754 - (u32)ACPI_STRLEN(op->common.value.string); 753 + obj_desc->string.length = (u32)strlen(op->common.value.string); 755 754 756 755 /* 757 756 * The string is contained in the ACPI table, don't ever try
+2 -2
drivers/acpi/acpica/dsutils.c
··· 572 572 obj_desc = 573 573 acpi_ut_create_string_object((acpi_size) name_length); 574 574 575 - ACPI_STRNCPY(obj_desc->string.pointer, 576 - name_string, name_length); 575 + strncpy(obj_desc->string.pointer, 576 + name_string, name_length); 577 577 status = AE_OK; 578 578 } else { 579 579 /*
+1 -1
drivers/acpi/acpica/evgpeinit.c
··· 377 377 378 378 /* 4) The last two characters of the name are the hex GPE Number */ 379 379 380 - gpe_number = ACPI_STRTOUL(&name[2], NULL, 16); 380 + gpe_number = strtoul(&name[2], NULL, 16); 381 381 if (gpe_number == ACPI_UINT32_MAX) { 382 382 383 383 /* Conversion failed; invalid method, just ignore it */
+1 -1
drivers/acpi/acpica/exconfig.c
··· 470 470 return_ACPI_STATUS(AE_NO_MEMORY); 471 471 } 472 472 473 - ACPI_MEMCPY(table, table_header, length); 473 + memcpy(table, table_header, length); 474 474 break; 475 475 476 476 default:
+4 -5
drivers/acpi/acpica/exconvrt.c
··· 227 227 /* Copy the integer to the buffer, LSB first */ 228 228 229 229 new_buf = return_desc->buffer.pointer; 230 - ACPI_MEMCPY(new_buf, 231 - &obj_desc->integer.value, 232 - acpi_gbl_integer_byte_width); 230 + memcpy(new_buf, 231 + &obj_desc->integer.value, acpi_gbl_integer_byte_width); 233 232 break; 234 233 235 234 case ACPI_TYPE_STRING: ··· 251 252 /* Copy the string to the buffer */ 252 253 253 254 new_buf = return_desc->buffer.pointer; 254 - ACPI_STRNCPY((char *)new_buf, (char *)obj_desc->string.pointer, 255 - obj_desc->string.length); 255 + strncpy((char *)new_buf, (char *)obj_desc->string.pointer, 256 + obj_desc->string.length); 256 257 break; 257 258 258 259 default:
+1 -1
drivers/acpi/acpica/exfield.c
··· 428 428 } 429 429 430 430 buffer = buffer_desc->buffer.pointer; 431 - ACPI_MEMCPY(buffer, source_desc->buffer.pointer, length); 431 + memcpy(buffer, source_desc->buffer.pointer, length); 432 432 433 433 /* Lock entire transaction if requested */ 434 434
+26 -26
drivers/acpi/acpica/exfldio.c
··· 416 416 * Copy the data from the source buffer. 417 417 * Length is the field width in bytes. 418 418 */ 419 - ACPI_MEMCPY(value, 420 - (obj_desc->buffer_field.buffer_obj)->buffer. 421 - pointer + 422 - obj_desc->buffer_field.base_byte_offset + 423 - field_datum_byte_offset, 424 - obj_desc->common_field.access_byte_width); 419 + memcpy(value, 420 + (obj_desc->buffer_field.buffer_obj)->buffer. 421 + pointer + 422 + obj_desc->buffer_field.base_byte_offset + 423 + field_datum_byte_offset, 424 + obj_desc->common_field.access_byte_width); 425 425 } else { 426 426 /* 427 427 * Copy the data to the target buffer. 428 428 * Length is the field width in bytes. 429 429 */ 430 - ACPI_MEMCPY((obj_desc->buffer_field.buffer_obj)->buffer. 431 - pointer + 432 - obj_desc->buffer_field.base_byte_offset + 433 - field_datum_byte_offset, value, 434 - obj_desc->common_field.access_byte_width); 430 + memcpy((obj_desc->buffer_field.buffer_obj)->buffer. 431 + pointer + 432 + obj_desc->buffer_field.base_byte_offset + 433 + field_datum_byte_offset, value, 434 + obj_desc->common_field.access_byte_width); 435 435 } 436 436 437 437 status = AE_OK; ··· 703 703 return_ACPI_STATUS(AE_BUFFER_OVERFLOW); 704 704 } 705 705 706 - ACPI_MEMSET(buffer, 0, buffer_length); 706 + memset(buffer, 0, buffer_length); 707 707 access_bit_width = ACPI_MUL_8(obj_desc->common_field.access_byte_width); 708 708 709 709 /* Handle the simple case here */ ··· 720 720 status = 721 721 acpi_ex_field_datum_io(obj_desc, 0, &raw_datum, 722 722 ACPI_READ); 723 - ACPI_MEMCPY(buffer, &raw_datum, buffer_length); 723 + memcpy(buffer, &raw_datum, buffer_length); 724 724 } 725 725 726 726 return_ACPI_STATUS(status); ··· 793 793 794 794 /* Write merged datum to target buffer */ 795 795 796 - ACPI_MEMCPY(((char *)buffer) + buffer_offset, &merged_datum, 797 - ACPI_MIN(obj_desc->common_field.access_byte_width, 798 - buffer_length - buffer_offset)); 796 + memcpy(((char *)buffer) + buffer_offset, &merged_datum, 797 + ACPI_MIN(obj_desc->common_field.access_byte_width, 798 + buffer_length - buffer_offset)); 799 799 800 800 buffer_offset += obj_desc->common_field.access_byte_width; 801 801 merged_datum = ··· 811 811 812 812 /* Write the last datum to the buffer */ 813 813 814 - ACPI_MEMCPY(((char *)buffer) + buffer_offset, &merged_datum, 815 - ACPI_MIN(obj_desc->common_field.access_byte_width, 816 - buffer_length - buffer_offset)); 814 + memcpy(((char *)buffer) + buffer_offset, &merged_datum, 815 + ACPI_MIN(obj_desc->common_field.access_byte_width, 816 + buffer_length - buffer_offset)); 817 817 818 818 return_ACPI_STATUS(AE_OK); 819 819 } ··· 878 878 * at Byte zero. All unused (upper) bytes of the 879 879 * buffer will be 0. 880 880 */ 881 - ACPI_MEMCPY((char *)new_buffer, (char *)buffer, buffer_length); 881 + memcpy((char *)new_buffer, (char *)buffer, buffer_length); 882 882 buffer = new_buffer; 883 883 buffer_length = required_length; 884 884 } ··· 918 918 919 919 /* Get initial Datum from the input buffer */ 920 920 921 - ACPI_MEMCPY(&raw_datum, buffer, 922 - ACPI_MIN(obj_desc->common_field.access_byte_width, 923 - buffer_length - buffer_offset)); 921 + memcpy(&raw_datum, buffer, 922 + ACPI_MIN(obj_desc->common_field.access_byte_width, 923 + buffer_length - buffer_offset)); 924 924 925 925 merged_datum = 926 926 raw_datum << obj_desc->common_field.start_field_bit_offset; ··· 970 970 /* Get the next input datum from the buffer */ 971 971 972 972 buffer_offset += obj_desc->common_field.access_byte_width; 973 - ACPI_MEMCPY(&raw_datum, ((char *)buffer) + buffer_offset, 974 - ACPI_MIN(obj_desc->common_field.access_byte_width, 975 - buffer_length - buffer_offset)); 973 + memcpy(&raw_datum, ((char *)buffer) + buffer_offset, 974 + ACPI_MIN(obj_desc->common_field.access_byte_width, 975 + buffer_length - buffer_offset)); 976 976 977 977 merged_datum |= 978 978 raw_datum << obj_desc->common_field.start_field_bit_offset;
+18 -18
drivers/acpi/acpica/exmisc.c
··· 209 209 * end_tag descriptor is copied from Operand1. 210 210 */ 211 211 new_buf = return_desc->buffer.pointer; 212 - ACPI_MEMCPY(new_buf, operand0->buffer.pointer, length0); 213 - ACPI_MEMCPY(new_buf + length0, operand1->buffer.pointer, length1); 212 + memcpy(new_buf, operand0->buffer.pointer, length0); 213 + memcpy(new_buf + length0, operand1->buffer.pointer, length1); 214 214 215 215 /* Insert end_tag and set the checksum to zero, means "ignore checksum" */ 216 216 ··· 318 318 319 319 /* Copy the first integer, LSB first */ 320 320 321 - ACPI_MEMCPY(new_buf, &operand0->integer.value, 322 - acpi_gbl_integer_byte_width); 321 + memcpy(new_buf, &operand0->integer.value, 322 + acpi_gbl_integer_byte_width); 323 323 324 324 /* Copy the second integer (LSB first) after the first */ 325 325 326 - ACPI_MEMCPY(new_buf + acpi_gbl_integer_byte_width, 327 - &local_operand1->integer.value, 328 - acpi_gbl_integer_byte_width); 326 + memcpy(new_buf + acpi_gbl_integer_byte_width, 327 + &local_operand1->integer.value, 328 + acpi_gbl_integer_byte_width); 329 329 break; 330 330 331 331 case ACPI_TYPE_STRING: ··· 346 346 347 347 /* Concatenate the strings */ 348 348 349 - ACPI_STRCPY(new_buf, operand0->string.pointer); 350 - ACPI_STRCPY(new_buf + operand0->string.length, 351 - local_operand1->string.pointer); 349 + strcpy(new_buf, operand0->string.pointer); 350 + strcpy(new_buf + operand0->string.length, 351 + local_operand1->string.pointer); 352 352 break; 353 353 354 354 case ACPI_TYPE_BUFFER: ··· 369 369 370 370 /* Concatenate the buffers */ 371 371 372 - ACPI_MEMCPY(new_buf, operand0->buffer.pointer, 373 - operand0->buffer.length); 374 - ACPI_MEMCPY(new_buf + operand0->buffer.length, 375 - local_operand1->buffer.pointer, 376 - local_operand1->buffer.length); 372 + memcpy(new_buf, operand0->buffer.pointer, 373 + operand0->buffer.length); 374 + memcpy(new_buf + operand0->buffer.length, 375 + local_operand1->buffer.pointer, 376 + local_operand1->buffer.length); 377 377 break; 378 378 379 379 default: ··· 660 660 661 661 /* Lexicographic compare: compare the data bytes */ 662 662 663 - compare = ACPI_MEMCMP(operand0->buffer.pointer, 664 - local_operand1->buffer.pointer, 665 - (length0 > length1) ? length1 : length0); 663 + compare = memcmp(operand0->buffer.pointer, 664 + local_operand1->buffer.pointer, 665 + (length0 > length1) ? length1 : length0); 666 666 667 667 switch (opcode) { 668 668 case AML_LEQUAL_OP: /* LEqual (Operand0, Operand1) */
+1 -1
drivers/acpi/acpica/exnames.c
··· 192 192 char_buf[4] = '\0'; 193 193 194 194 if (name_string) { 195 - ACPI_STRCAT(name_string, char_buf); 195 + strcat(name_string, char_buf); 196 196 ACPI_DEBUG_PRINT((ACPI_DB_NAMES, 197 197 "Appended to - %s\n", name_string)); 198 198 } else {
+2 -2
drivers/acpi/acpica/exoparg2.c
··· 337 337 * Copy the raw buffer data with no transform. 338 338 * (NULL terminated already) 339 339 */ 340 - ACPI_MEMCPY(return_desc->string.pointer, 341 - operand[0]->buffer.pointer, length); 340 + memcpy(return_desc->string.pointer, 341 + operand[0]->buffer.pointer, length); 342 342 break; 343 343 344 344 case AML_CONCAT_RES_OP:
+2 -2
drivers/acpi/acpica/exoparg3.c
··· 237 237 238 238 /* We have a buffer, copy the portion requested */ 239 239 240 - ACPI_MEMCPY(buffer, operand[0]->string.pointer + index, 241 - length); 240 + memcpy(buffer, operand[0]->string.pointer + index, 241 + length); 242 242 } 243 243 244 244 /* Set the length of the new String/Buffer */
+4 -5
drivers/acpi/acpica/exregion.c
··· 517 517 switch (function) { 518 518 case ACPI_READ: 519 519 520 - ACPI_MEMCPY(ACPI_CAST_PTR(char, value), 521 - ACPI_PHYSADDR_TO_PTR(address), 522 - ACPI_DIV_8(bit_width)); 520 + memcpy(ACPI_CAST_PTR(char, value), 521 + ACPI_PHYSADDR_TO_PTR(address), ACPI_DIV_8(bit_width)); 523 522 break; 524 523 525 524 case ACPI_WRITE: 526 525 527 - ACPI_MEMCPY(ACPI_PHYSADDR_TO_PTR(address), 528 - ACPI_CAST_PTR(char, value), ACPI_DIV_8(bit_width)); 526 + memcpy(ACPI_PHYSADDR_TO_PTR(address), 527 + ACPI_CAST_PTR(char, value), ACPI_DIV_8(bit_width)); 529 528 break; 530 529 531 530 default:
+9 -9
drivers/acpi/acpica/exstorob.c
··· 100 100 101 101 /* Clear existing buffer and copy in the new one */ 102 102 103 - ACPI_MEMSET(target_desc->buffer.pointer, 0, 104 - target_desc->buffer.length); 105 - ACPI_MEMCPY(target_desc->buffer.pointer, buffer, length); 103 + memset(target_desc->buffer.pointer, 0, 104 + target_desc->buffer.length); 105 + memcpy(target_desc->buffer.pointer, buffer, length); 106 106 107 107 #ifdef ACPI_OBSOLETE_BEHAVIOR 108 108 /* ··· 129 129 } else { 130 130 /* Truncate the source, copy only what will fit */ 131 131 132 - ACPI_MEMCPY(target_desc->buffer.pointer, buffer, 133 - target_desc->buffer.length); 132 + memcpy(target_desc->buffer.pointer, buffer, 133 + target_desc->buffer.length); 134 134 135 135 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 136 136 "Truncating source buffer from %X to %X\n", ··· 187 187 * String will fit in existing non-static buffer. 188 188 * Clear old string and copy in the new one 189 189 */ 190 - ACPI_MEMSET(target_desc->string.pointer, 0, 191 - (acpi_size) target_desc->string.length + 1); 192 - ACPI_MEMCPY(target_desc->string.pointer, buffer, length); 190 + memset(target_desc->string.pointer, 0, 191 + (acpi_size) target_desc->string.length + 1); 192 + memcpy(target_desc->string.pointer, buffer, length); 193 193 } else { 194 194 /* 195 195 * Free the current buffer, then allocate a new buffer ··· 210 210 } 211 211 212 212 target_desc->common.flags &= ~AOPOBJ_STATIC_POINTER; 213 - ACPI_MEMCPY(target_desc->string.pointer, buffer, length); 213 + memcpy(target_desc->string.pointer, buffer, length); 214 214 } 215 215 216 216 /* Set the new target length */
+3 -3
drivers/acpi/acpica/nsaccess.c
··· 102 102 103 103 /* _OSI is optional for now, will be permanent later */ 104 104 105 - if (!ACPI_STRCMP(init_val->name, "_OSI") 105 + if (!strcmp(init_val->name, "_OSI") 106 106 && !acpi_gbl_create_osi_method) { 107 107 continue; 108 108 } ··· 180 180 181 181 /* Build an object around the static string */ 182 182 183 - obj_desc->string.length = (u32)ACPI_STRLEN(val); 183 + obj_desc->string.length = (u32)strlen(val); 184 184 obj_desc->string.pointer = val; 185 185 obj_desc->common.flags |= AOPOBJ_STATIC_POINTER; 186 186 break; ··· 203 203 204 204 /* Special case for ACPI Global Lock */ 205 205 206 - if (ACPI_STRCMP(init_val->name, "_GL_") == 0) { 206 + if (strcmp(init_val->name, "_GL_") == 0) { 207 207 acpi_gbl_global_lock_mutex = obj_desc; 208 208 209 209 /* Create additional counting semaphore for global lock */
+5 -5
drivers/acpi/acpica/nsconvert.c
··· 187 187 * Copy the raw buffer data with no transform. String is already NULL 188 188 * terminated at Length+1. 189 189 */ 190 - ACPI_MEMCPY(new_object->string.pointer, 191 - original_object->buffer.pointer, length); 190 + memcpy(new_object->string.pointer, 191 + original_object->buffer.pointer, length); 192 192 break; 193 193 194 194 default: ··· 251 251 return (AE_NO_MEMORY); 252 252 } 253 253 254 - ACPI_MEMCPY(new_object->buffer.pointer, 255 - original_object->string.pointer, 256 - original_object->string.length); 254 + memcpy(new_object->buffer.pointer, 255 + original_object->string.pointer, 256 + original_object->string.length); 257 257 break; 258 258 259 259 case ACPI_TYPE_PACKAGE:
+1 -1
drivers/acpi/acpica/nsdump.c
··· 101 101 102 102 while (num_segments) { 103 103 for (i = 0; i < 4; i++) { 104 - ACPI_IS_PRINT(pathname[i]) ? 104 + isprint((int)pathname[i]) ? 105 105 acpi_os_printf("%c", pathname[i]) : 106 106 acpi_os_printf("?"); 107 107 }
+1 -1
drivers/acpi/acpica/nseval.c
··· 440 440 441 441 /* Initialize the evaluation information block */ 442 442 443 - ACPI_MEMSET(info, 0, sizeof(struct acpi_evaluate_info)); 443 + memset(info, 0, sizeof(struct acpi_evaluate_info)); 444 444 info->prefix_node = parent_node; 445 445 446 446 /*
+2 -2
drivers/acpi/acpica/nsinit.c
··· 90 90 91 91 /* Set all init info to zero */ 92 92 93 - ACPI_MEMSET(&info, 0, sizeof(struct acpi_init_walk_info)); 93 + memset(&info, 0, sizeof(struct acpi_init_walk_info)); 94 94 95 95 /* Walk entire namespace from the supplied root */ 96 96 ··· 566 566 ACPI_DEBUG_EXEC(acpi_ut_display_init_pathname 567 567 (ACPI_TYPE_METHOD, device_node, METHOD_NAME__INI)); 568 568 569 - ACPI_MEMSET(info, 0, sizeof(struct acpi_evaluate_info)); 569 + memset(info, 0, sizeof(struct acpi_evaluate_info)); 570 570 info->prefix_node = device_node; 571 571 info->relative_pathname = METHOD_NAME__INI; 572 572 info->parameters = NULL;
+1 -1
drivers/acpi/acpica/nsrepair2.c
··· 580 580 * # is a hex digit. 581 581 */ 582 582 for (dest = new_string->string.pointer; *source; dest++, source++) { 583 - *dest = (char)ACPI_TOUPPER(*source); 583 + *dest = (char)toupper((int)*source); 584 584 } 585 585 586 586 acpi_ut_remove_reference(return_object);
+1 -2
drivers/acpi/acpica/nsutils.c
··· 292 292 } else { 293 293 /* Convert the character to uppercase and save it */ 294 294 295 - result[i] = 296 - (char)ACPI_TOUPPER((int)*external_name); 295 + result[i] = (char)toupper((int)*external_name); 297 296 external_name++; 298 297 } 299 298 }
+2 -3
drivers/acpi/acpica/nsxfeval.c
··· 696 696 return (AE_CTRL_DEPTH); 697 697 } 698 698 699 - no_match = ACPI_STRCMP(hid->string, info->hid); 699 + no_match = strcmp(hid->string, info->hid); 700 700 ACPI_FREE(hid); 701 701 702 702 if (no_match) { ··· 715 715 716 716 found = FALSE; 717 717 for (i = 0; i < cid->count; i++) { 718 - if (ACPI_STRCMP(cid->ids[i].string, info->hid) 719 - == 0) { 718 + if (strcmp(cid->ids[i].string, info->hid) == 0) { 720 719 721 720 /* Found a matching CID */ 722 721
+3 -3
drivers/acpi/acpica/nsxfname.c
··· 114 114 115 115 /* Special case for root-only, since we can't search for it */ 116 116 117 - if (!ACPI_STRCMP(pathname, ACPI_NS_ROOT_PATH)) { 117 + if (!strcmp(pathname, ACPI_NS_ROOT_PATH)) { 118 118 *ret_handle = 119 119 ACPI_CAST_PTR(acpi_handle, acpi_gbl_root_node); 120 120 return (AE_OK); ··· 242 242 243 243 /* Copy actual string and return a pointer to the next string area */ 244 244 245 - ACPI_MEMCPY(string_area, source->string, source->length); 245 + memcpy(string_area, source->string, source->length); 246 246 return (string_area + source->length); 247 247 } 248 248 ··· 637 637 638 638 /* Copy the method AML to the local buffer */ 639 639 640 - ACPI_MEMCPY(aml_buffer, aml_start, aml_length); 640 + memcpy(aml_buffer, aml_start, aml_length); 641 641 642 642 /* Initialize the method object with the new method's information */ 643 643
+3 -4
drivers/acpi/acpica/psutils.c
··· 93 93 op->common.descriptor_type = ACPI_DESC_TYPE_PARSER; 94 94 op->common.aml_opcode = opcode; 95 95 96 - ACPI_DISASM_ONLY_MEMBERS(ACPI_STRNCPY(op->common.aml_op_name, 97 - (acpi_ps_get_opcode_info 98 - (opcode))->name, 99 - sizeof(op->common.aml_op_name))); 96 + ACPI_DISASM_ONLY_MEMBERS(strncpy(op->common.aml_op_name, 97 + (acpi_ps_get_opcode_info(opcode))-> 98 + name, sizeof(op->common.aml_op_name))); 100 99 } 101 100 102 101 /*******************************************************************************
+3 -3
drivers/acpi/acpica/rscreate.c
··· 353 353 /* +1 to include null terminator */ 354 354 355 355 user_prt->length += 356 - (u32)ACPI_STRLEN(user_prt->source) + 1; 356 + (u32)strlen(user_prt->source) + 1; 357 357 break; 358 358 359 359 case ACPI_TYPE_STRING: 360 360 361 - ACPI_STRCPY(user_prt->source, 362 - obj_desc->string.pointer); 361 + strcpy(user_prt->source, 362 + obj_desc->string.pointer); 363 363 364 364 /* 365 365 * Add to the Length field the length of the string
+4 -4
drivers/acpi/acpica/rsmisc.c
··· 119 119 /* 120 120 * Get the resource type and the initial (minimum) length 121 121 */ 122 - ACPI_MEMSET(resource, 0, INIT_RESOURCE_LENGTH(info)); 122 + memset(resource, 0, INIT_RESOURCE_LENGTH(info)); 123 123 resource->type = INIT_RESOURCE_TYPE(info); 124 124 resource->length = INIT_RESOURCE_LENGTH(info); 125 125 break; ··· 324 324 325 325 case ACPI_RSC_SET8: 326 326 327 - ACPI_MEMSET(destination, info->aml_offset, info->value); 327 + memset(destination, info->aml_offset, info->value); 328 328 break; 329 329 330 330 case ACPI_RSC_DATA8: 331 331 332 332 target = ACPI_ADD_PTR(char, resource, info->value); 333 - ACPI_MEMCPY(destination, source, ACPI_GET16(target)); 333 + memcpy(destination, source, ACPI_GET16(target)); 334 334 break; 335 335 336 336 case ACPI_RSC_ADDRESS: ··· 502 502 switch (info->opcode) { 503 503 case ACPI_RSC_INITSET: 504 504 505 - ACPI_MEMSET(aml, 0, INIT_RESOURCE_LENGTH(info)); 505 + memset(aml, 0, INIT_RESOURCE_LENGTH(info)); 506 506 aml_length = INIT_RESOURCE_LENGTH(info); 507 507 acpi_rs_set_resource_header(INIT_RESOURCE_TYPE(info), 508 508 aml_length, aml);
+5 -6
drivers/acpi/acpica/rsutils.c
··· 148 148 case ACPI_RSC_MOVE_SERIAL_VEN: 149 149 case ACPI_RSC_MOVE_SERIAL_RES: 150 150 151 - ACPI_MEMCPY(destination, source, item_count); 151 + memcpy(destination, source, item_count); 152 152 return; 153 153 154 154 /* ··· 364 364 * Zero the entire area of the buffer. 365 365 */ 366 366 total_length = 367 - (u32) 368 - ACPI_STRLEN(ACPI_CAST_PTR(char, &aml_resource_source[1])) + 367 + (u32)strlen(ACPI_CAST_PTR(char, &aml_resource_source[1])) + 369 368 1; 370 369 total_length = (u32)ACPI_ROUND_UP_TO_NATIVE_WORD(total_length); 371 370 372 - ACPI_MEMSET(resource_source->string_ptr, 0, total_length); 371 + memset(resource_source->string_ptr, 0, total_length); 373 372 374 373 /* Copy the resource_source string to the destination */ 375 374 ··· 431 432 432 433 /* Copy the resource_source string */ 433 434 434 - ACPI_STRCPY(ACPI_CAST_PTR(char, &aml_resource_source[1]), 435 - resource_source->string_ptr); 435 + strcpy(ACPI_CAST_PTR(char, &aml_resource_source[1]), 436 + resource_source->string_ptr); 436 437 437 438 /* 438 439 * Add the length of the string (+ 1 for null terminator) to the
+4 -4
drivers/acpi/acpica/rsxface.c
··· 398 398 399 399 /* Simple copy for 64 bit source */ 400 400 401 - ACPI_MEMCPY(out, &resource->data, 402 - sizeof(struct acpi_resource_address64)); 401 + memcpy(out, &resource->data, 402 + sizeof(struct acpi_resource_address64)); 403 403 break; 404 404 405 405 default: ··· 499 499 */ 500 500 if ((vendor->byte_length < (ACPI_UUID_LENGTH + 1)) || 501 501 (vendor->uuid_subtype != info->uuid->subtype) || 502 - (ACPI_MEMCMP(vendor->uuid, info->uuid->data, ACPI_UUID_LENGTH))) { 502 + (memcmp(vendor->uuid, info->uuid->data, ACPI_UUID_LENGTH))) { 503 503 return (AE_OK); 504 504 } 505 505 ··· 513 513 514 514 /* Found the correct resource, copy and return it */ 515 515 516 - ACPI_MEMCPY(buffer->pointer, resource, resource->length); 516 + memcpy(buffer->pointer, resource, resource->length); 517 517 buffer->length = resource->length; 518 518 519 519 /* Found the desired descriptor, terminate resource walk */
+4 -4
drivers/acpi/acpica/tbdata.c
··· 73 73 * Initialize the table descriptor. Set the pointer to NULL, since the 74 74 * table is not fully mapped at this time. 75 75 */ 76 - ACPI_MEMSET(table_desc, 0, sizeof(struct acpi_table_desc)); 76 + memset(table_desc, 0, sizeof(struct acpi_table_desc)); 77 77 table_desc->address = address; 78 78 table_desc->length = table->length; 79 79 table_desc->flags = flags; ··· 465 465 /* Copy and free the previous table array */ 466 466 467 467 if (acpi_gbl_root_table_list.tables) { 468 - ACPI_MEMCPY(tables, acpi_gbl_root_table_list.tables, 469 - (acpi_size) table_count * 470 - sizeof(struct acpi_table_desc)); 468 + memcpy(tables, acpi_gbl_root_table_list.tables, 469 + (acpi_size) table_count * 470 + sizeof(struct acpi_table_desc)); 471 471 472 472 if (acpi_gbl_root_table_list.flags & ACPI_ROOT_ORIGIN_ALLOCATED) { 473 473 ACPI_FREE(acpi_gbl_root_table_list.tables);
+3 -3
drivers/acpi/acpica/tbfadt.c
··· 398 398 399 399 /* Clear the entire local FADT */ 400 400 401 - ACPI_MEMSET(&acpi_gbl_FADT, 0, sizeof(struct acpi_table_fadt)); 401 + memset(&acpi_gbl_FADT, 0, sizeof(struct acpi_table_fadt)); 402 402 403 403 /* Copy the original FADT, up to sizeof (struct acpi_table_fadt) */ 404 404 405 - ACPI_MEMCPY(&acpi_gbl_FADT, table, 406 - ACPI_MIN(length, sizeof(struct acpi_table_fadt))); 405 + memcpy(&acpi_gbl_FADT, table, 406 + ACPI_MIN(length, sizeof(struct acpi_table_fadt))); 407 407 408 408 /* Take a copy of the Hardware Reduced flag */ 409 409
+10 -11
drivers/acpi/acpica/tbfind.c
··· 76 76 77 77 /* Normalize the input strings */ 78 78 79 - ACPI_MEMSET(&header, 0, sizeof(struct acpi_table_header)); 79 + memset(&header, 0, sizeof(struct acpi_table_header)); 80 80 ACPI_MOVE_NAME(header.signature, signature); 81 - ACPI_STRNCPY(header.oem_id, oem_id, ACPI_OEM_ID_SIZE); 82 - ACPI_STRNCPY(header.oem_table_id, oem_table_id, ACPI_OEM_TABLE_ID_SIZE); 81 + strncpy(header.oem_id, oem_id, ACPI_OEM_ID_SIZE); 82 + strncpy(header.oem_table_id, oem_table_id, ACPI_OEM_TABLE_ID_SIZE); 83 83 84 84 /* Search for the table */ 85 85 86 86 for (i = 0; i < acpi_gbl_root_table_list.current_table_count; ++i) { 87 - if (ACPI_MEMCMP(&(acpi_gbl_root_table_list.tables[i].signature), 88 - header.signature, ACPI_NAME_SIZE)) { 87 + if (memcmp(&(acpi_gbl_root_table_list.tables[i].signature), 88 + header.signature, ACPI_NAME_SIZE)) { 89 89 90 90 /* Not the requested table */ 91 91 ··· 112 112 113 113 /* Check for table match on all IDs */ 114 114 115 - if (!ACPI_MEMCMP 115 + if (!memcmp 116 116 (acpi_gbl_root_table_list.tables[i].pointer->signature, 117 117 header.signature, ACPI_NAME_SIZE) && (!oem_id[0] 118 118 || 119 - !ACPI_MEMCMP 119 + !memcmp 120 120 (acpi_gbl_root_table_list. 121 121 tables[i].pointer-> 122 122 oem_id, 123 123 header.oem_id, 124 124 ACPI_OEM_ID_SIZE)) 125 125 && (!oem_table_id[0] 126 - || !ACPI_MEMCMP(acpi_gbl_root_table_list.tables[i]. 127 - pointer->oem_table_id, 128 - header.oem_table_id, 129 - ACPI_OEM_TABLE_ID_SIZE))) { 126 + || !memcmp(acpi_gbl_root_table_list.tables[i].pointer-> 127 + oem_table_id, header.oem_table_id, 128 + ACPI_OEM_TABLE_ID_SIZE))) { 130 129 *table_index = i; 131 130 132 131 ACPI_DEBUG_PRINT((ACPI_DB_TABLES,
+3 -4
drivers/acpi/acpica/tbinstal.c
··· 87 87 * not just the header. 88 88 */ 89 89 is_identical = (u8)((table_desc->length != table_length || 90 - ACPI_MEMCMP(table_desc->pointer, table, 91 - table_length)) ? FALSE : TRUE); 90 + memcmp(table_desc->pointer, table, table_length)) ? 91 + FALSE : TRUE); 92 92 93 93 /* Release the acquired table */ 94 94 ··· 289 289 if ((new_table_desc.signature.ascii[0] != 0x00) && 290 290 (!ACPI_COMPARE_NAME 291 291 (&new_table_desc.signature, ACPI_SIG_SSDT)) 292 - && (ACPI_STRNCMP(new_table_desc.signature.ascii, "OEM", 3))) 293 - { 292 + && (strncmp(new_table_desc.signature.ascii, "OEM", 3))) { 294 293 ACPI_BIOS_ERROR((AE_INFO, 295 294 "Table has invalid signature [%4.4s] (0x%8.8X), " 296 295 "must be SSDT or OEMx",
+5 -5
drivers/acpi/acpica/tbprint.c
··· 73 73 { 74 74 75 75 while (length && *string) { 76 - if (!ACPI_IS_PRINT(*string)) { 76 + if (!isprint((int)*string)) { 77 77 *string = '?'; 78 78 } 79 79 string++; ··· 100 100 struct acpi_table_header *header) 101 101 { 102 102 103 - ACPI_MEMCPY(out_header, header, sizeof(struct acpi_table_header)); 103 + memcpy(out_header, header, sizeof(struct acpi_table_header)); 104 104 105 105 acpi_tb_fix_string(out_header->signature, ACPI_NAME_SIZE); 106 106 acpi_tb_fix_string(out_header->oem_id, ACPI_OEM_ID_SIZE); ··· 138 138 139 139 /* RSDP has no common fields */ 140 140 141 - ACPI_MEMCPY(local_header.oem_id, 142 - ACPI_CAST_PTR(struct acpi_table_rsdp, 143 - header)->oem_id, ACPI_OEM_ID_SIZE); 141 + memcpy(local_header.oem_id, 142 + ACPI_CAST_PTR(struct acpi_table_rsdp, header)->oem_id, 143 + ACPI_OEM_ID_SIZE); 144 144 acpi_tb_fix_string(local_header.oem_id, ACPI_OEM_ID_SIZE); 145 145 146 146 ACPI_INFO((AE_INFO, "RSDP 0x%8.8X%8.8X %06X (v%.2d %-6.6s)",
+1 -1
drivers/acpi/acpica/tbutils.c
··· 188 188 return (NULL); 189 189 } 190 190 191 - ACPI_MEMCPY(new_table, table_desc->pointer, table_desc->length); 191 + memcpy(new_table, table_desc->pointer, table_desc->length); 192 192 acpi_tb_uninstall_table(table_desc); 193 193 194 194 acpi_tb_init_table_descriptor(&acpi_gbl_root_table_list.
+8 -8
drivers/acpi/acpica/tbxface.c
··· 119 119 } else { 120 120 /* Root Table Array has been statically allocated by the host */ 121 121 122 - ACPI_MEMSET(initial_table_array, 0, 123 - (acpi_size) initial_table_count * 124 - sizeof(struct acpi_table_desc)); 122 + memset(initial_table_array, 0, 123 + (acpi_size) initial_table_count * 124 + sizeof(struct acpi_table_desc)); 125 125 126 126 acpi_gbl_root_table_list.tables = initial_table_array; 127 127 acpi_gbl_root_table_list.max_table_count = initial_table_count; ··· 243 243 return (AE_NO_MEMORY); 244 244 } 245 245 246 - ACPI_MEMCPY(out_table_header, header, 247 - sizeof(struct acpi_table_header)); 246 + memcpy(out_table_header, header, 247 + sizeof(struct acpi_table_header)); 248 248 acpi_os_unmap_memory(header, 249 249 sizeof(struct 250 250 acpi_table_header)); ··· 252 252 return (AE_NOT_FOUND); 253 253 } 254 254 } else { 255 - ACPI_MEMCPY(out_table_header, 256 - acpi_gbl_root_table_list.tables[i].pointer, 257 - sizeof(struct acpi_table_header)); 255 + memcpy(out_table_header, 256 + acpi_gbl_root_table_list.tables[i].pointer, 257 + sizeof(struct acpi_table_header)); 258 258 } 259 259 return (AE_OK); 260 260 }
+2 -2
drivers/acpi/acpica/tbxfload.c
··· 150 150 * Save the original DSDT header for detection of table corruption 151 151 * and/or replacement of the DSDT from outside the OS. 152 152 */ 153 - ACPI_MEMCPY(&acpi_gbl_original_dsdt_header, acpi_gbl_DSDT, 154 - sizeof(struct acpi_table_header)); 153 + memcpy(&acpi_gbl_original_dsdt_header, acpi_gbl_DSDT, 154 + sizeof(struct acpi_table_header)); 155 155 156 156 (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); 157 157
+3 -3
drivers/acpi/acpica/utalloc.c
··· 73 73 74 74 /* Clear the memory block */ 75 75 76 - ACPI_MEMSET(allocation, 0, size); 76 + memset(allocation, 0, size); 77 77 } 78 78 79 79 return (allocation); ··· 181 181 char buffer[7]; 182 182 183 183 if (acpi_gbl_display_final_mem_stats) { 184 - ACPI_STRCPY(buffer, "MEMORY"); 184 + strcpy(buffer, "MEMORY"); 185 185 (void)acpi_db_display_statistics(buffer); 186 186 } 187 187 #endif ··· 337 337 338 338 /* Have a valid buffer, clear it */ 339 339 340 - ACPI_MEMSET(buffer->pointer, 0, required_length); 340 + memset(buffer->pointer, 0, required_length); 341 341 return (AE_OK); 342 342 }
+2 -2
drivers/acpi/acpica/utbuffer.c
··· 159 159 } 160 160 161 161 buf_char = buffer[(acpi_size) i + j]; 162 - if (ACPI_IS_PRINT(buf_char)) { 162 + if (isprint(buf_char)) { 163 163 acpi_os_printf("%c", buf_char); 164 164 } else { 165 165 acpi_os_printf("."); ··· 319 319 } 320 320 321 321 buf_char = buffer[(acpi_size) i + j]; 322 - if (ACPI_IS_PRINT(buf_char)) { 322 + if (isprint(buf_char)) { 323 323 acpi_ut_file_printf(file, "%c", buf_char); 324 324 } else { 325 325 acpi_ut_file_printf(file, ".");
+3 -3
drivers/acpi/acpica/utcache.c
··· 84 84 85 85 /* Populate the cache object and return it */ 86 86 87 - ACPI_MEMSET(cache, 0, sizeof(struct acpi_memory_list)); 87 + memset(cache, 0, sizeof(struct acpi_memory_list)); 88 88 cache->list_name = cache_name; 89 89 cache->object_size = object_size; 90 90 cache->max_depth = max_depth; ··· 212 212 213 213 /* Mark the object as cached */ 214 214 215 - ACPI_MEMSET(object, 0xCA, cache->object_size); 215 + memset(object, 0xCA, cache->object_size); 216 216 ACPI_SET_DESCRIPTOR_TYPE(object, ACPI_DESC_TYPE_CACHED); 217 217 218 218 /* Put the object at the head of the cache list */ ··· 281 281 282 282 /* Clear (zero) the previously used Object */ 283 283 284 - ACPI_MEMSET(object, 0, cache->object_size); 284 + memset(object, 0, cache->object_size); 285 285 } else { 286 286 /* The cache is empty, create a new object */ 287 287
+21 -21
drivers/acpi/acpica/utcopy.c
··· 129 129 130 130 /* Always clear the external object */ 131 131 132 - ACPI_MEMSET(external_object, 0, sizeof(union acpi_object)); 132 + memset(external_object, 0, sizeof(union acpi_object)); 133 133 134 134 /* 135 135 * In general, the external object will be the same type as ··· 149 149 string. 150 150 length + 1); 151 151 152 - ACPI_MEMCPY((void *)data_space, 153 - (void *)internal_object->string.pointer, 154 - (acpi_size) internal_object->string.length + 1); 152 + memcpy((void *)data_space, 153 + (void *)internal_object->string.pointer, 154 + (acpi_size) internal_object->string.length + 1); 155 155 break; 156 156 157 157 case ACPI_TYPE_BUFFER: ··· 162 162 ACPI_ROUND_UP_TO_NATIVE_WORD(internal_object->string. 163 163 length); 164 164 165 - ACPI_MEMCPY((void *)data_space, 166 - (void *)internal_object->buffer.pointer, 167 - internal_object->buffer.length); 165 + memcpy((void *)data_space, 166 + (void *)internal_object->buffer.pointer, 167 + internal_object->buffer.length); 168 168 break; 169 169 170 170 case ACPI_TYPE_INTEGER: ··· 502 502 goto error_exit; 503 503 } 504 504 505 - ACPI_MEMCPY(internal_object->string.pointer, 506 - external_object->string.pointer, 507 - external_object->string.length); 505 + memcpy(internal_object->string.pointer, 506 + external_object->string.pointer, 507 + external_object->string.length); 508 508 509 509 internal_object->string.length = external_object->string.length; 510 510 break; ··· 517 517 goto error_exit; 518 518 } 519 519 520 - ACPI_MEMCPY(internal_object->buffer.pointer, 521 - external_object->buffer.pointer, 522 - external_object->buffer.length); 520 + memcpy(internal_object->buffer.pointer, 521 + external_object->buffer.pointer, 522 + external_object->buffer.length); 523 523 524 524 internal_object->buffer.length = external_object->buffer.length; 525 525 ··· 694 694 copy_size = sizeof(struct acpi_namespace_node); 695 695 } 696 696 697 - ACPI_MEMCPY(ACPI_CAST_PTR(char, dest_desc), 698 - ACPI_CAST_PTR(char, source_desc), copy_size); 697 + memcpy(ACPI_CAST_PTR(char, dest_desc), 698 + ACPI_CAST_PTR(char, source_desc), copy_size); 699 699 700 700 /* Restore the saved fields */ 701 701 ··· 725 725 726 726 /* Copy the actual buffer data */ 727 727 728 - ACPI_MEMCPY(dest_desc->buffer.pointer, 729 - source_desc->buffer.pointer, 730 - source_desc->buffer.length); 728 + memcpy(dest_desc->buffer.pointer, 729 + source_desc->buffer.pointer, 730 + source_desc->buffer.length); 731 731 } 732 732 break; 733 733 ··· 747 747 748 748 /* Copy the actual string data */ 749 749 750 - ACPI_MEMCPY(dest_desc->string.pointer, 751 - source_desc->string.pointer, 752 - (acpi_size) source_desc->string.length + 1); 750 + memcpy(dest_desc->string.pointer, 751 + source_desc->string.pointer, 752 + (acpi_size) source_desc->string.length + 1); 753 753 } 754 754 break; 755 755
+4 -5
drivers/acpi/acpica/utids.c
··· 111 111 if (obj_desc->common.type == ACPI_TYPE_INTEGER) { 112 112 acpi_ex_eisa_id_to_string(hid->string, obj_desc->integer.value); 113 113 } else { 114 - ACPI_STRCPY(hid->string, obj_desc->string.pointer); 114 + strcpy(hid->string, obj_desc->string.pointer); 115 115 } 116 116 117 117 hid->length = length; ··· 180 180 181 181 /* Simply copy existing string */ 182 182 183 - ACPI_STRCPY(sub->string, obj_desc->string.pointer); 183 + strcpy(sub->string, obj_desc->string.pointer); 184 184 sub->length = length; 185 185 *return_id = sub; 186 186 ··· 256 256 if (obj_desc->common.type == ACPI_TYPE_INTEGER) { 257 257 acpi_ex_integer_to_string(uid->string, obj_desc->integer.value); 258 258 } else { 259 - ACPI_STRCPY(uid->string, obj_desc->string.pointer); 259 + strcpy(uid->string, obj_desc->string.pointer); 260 260 } 261 261 262 262 uid->length = length; ··· 393 393 394 394 /* Copy the String CID from the returned object */ 395 395 396 - ACPI_STRCPY(next_id_string, 397 - cid_objects[i]->string.pointer); 396 + strcpy(next_id_string, cid_objects[i]->string.pointer); 398 397 length = cid_objects[i]->string.length + 1; 399 398 } 400 399
+3 -3
drivers/acpi/acpica/utmisc.c
··· 66 66 * Check if this is a PCI root bridge. 67 67 * ACPI 3.0+: check for a PCI Express root also. 68 68 */ 69 - if (!(ACPI_STRCMP(id, 70 - PCI_ROOT_HID_STRING)) || 71 - !(ACPI_STRCMP(id, PCI_EXPRESS_ROOT_HID_STRING))) { 69 + if (!(strcmp(id, 70 + PCI_ROOT_HID_STRING)) || 71 + !(strcmp(id, PCI_EXPRESS_ROOT_HID_STRING))) { 72 72 return (TRUE); 73 73 } 74 74
+4 -5
drivers/acpi/acpica/utosi.c
··· 232 232 return (AE_NO_MEMORY); 233 233 } 234 234 235 - interface_info->name = 236 - ACPI_ALLOCATE_ZEROED(ACPI_STRLEN(interface_name) + 1); 235 + interface_info->name = ACPI_ALLOCATE_ZEROED(strlen(interface_name) + 1); 237 236 if (!interface_info->name) { 238 237 ACPI_FREE(interface_info); 239 238 return (AE_NO_MEMORY); ··· 240 241 241 242 /* Initialize new info and insert at the head of the global list */ 242 243 243 - ACPI_STRCPY(interface_info->name, interface_name); 244 + strcpy(interface_info->name, interface_name); 244 245 interface_info->flags = ACPI_OSI_DYNAMIC; 245 246 interface_info->next = acpi_gbl_supported_interfaces; 246 247 ··· 268 269 269 270 previous_interface = next_interface = acpi_gbl_supported_interfaces; 270 271 while (next_interface) { 271 - if (!ACPI_STRCMP(interface_name, next_interface->name)) { 272 + if (!strcmp(interface_name, next_interface->name)) { 272 273 273 274 /* Found: name is in either the static list or was added at runtime */ 274 275 ··· 372 373 373 374 next_interface = acpi_gbl_supported_interfaces; 374 375 while (next_interface) { 375 - if (!ACPI_STRCMP(interface_name, next_interface->name)) { 376 + if (!strcmp(interface_name, next_interface->name)) { 376 377 return (next_interface); 377 378 } 378 379
+2 -2
drivers/acpi/acpica/utpredef.c
··· 148 148 u32 j; 149 149 150 150 if (!expected_btypes) { 151 - ACPI_STRCPY(buffer, "NONE"); 151 + strcpy(buffer, "NONE"); 152 152 return; 153 153 } 154 154 ··· 161 161 /* If one of the expected types, concatenate the name of this type */ 162 162 163 163 if (expected_btypes & this_rtype) { 164 - ACPI_STRCAT(buffer, &ut_rtype_names[i][j]); 164 + strcat(buffer, &ut_rtype_names[i][j]); 165 165 j = 0; /* Use name separator from now on */ 166 166 } 167 167
+3 -3
drivers/acpi/acpica/utprint.c
··· 180 180 { 181 181 u64 number = 0; 182 182 183 - while (ACPI_IS_DIGIT(*string)) { 183 + while (isdigit((int)*string)) { 184 184 number *= 10; 185 185 number += *(string++) - '0'; 186 186 } ··· 405 405 /* Process width */ 406 406 407 407 width = -1; 408 - if (ACPI_IS_DIGIT(*format)) { 408 + if (isdigit((int)*format)) { 409 409 format = acpi_ut_scan_number(format, &number); 410 410 width = (s32) number; 411 411 } else if (*format == '*') { ··· 422 422 precision = -1; 423 423 if (*format == '.') { 424 424 ++format; 425 - if (ACPI_IS_DIGIT(*format)) { 425 + if (isdigit((int)*format)) { 426 426 format = acpi_ut_scan_number(format, &number); 427 427 precision = (s32) number; 428 428 } else if (*format == '*') {
+16 -17
drivers/acpi/acpica/utstring.c
··· 79 79 /* Walk entire string, lowercasing the letters */ 80 80 81 81 for (string = src_string; *string; string++) { 82 - *string = (char)ACPI_TOLOWER(*string); 82 + *string = (char)tolower((int)*string); 83 83 } 84 84 85 85 return; ··· 145 145 /* Walk entire string, uppercasing the letters */ 146 146 147 147 for (string = src_string; *string; string++) { 148 - *string = (char)ACPI_TOUPPER(*string); 148 + *string = (char)toupper((int)*string); 149 149 } 150 150 151 151 return; ··· 202 202 203 203 /* Skip over any white space in the buffer */ 204 204 205 - while ((*string) && (ACPI_IS_SPACE(*string) || *string == '\t')) { 205 + while ((*string) && (isspace((int)*string) || *string == '\t')) { 206 206 string++; 207 207 } 208 208 ··· 211 211 * Base equal to ACPI_ANY_BASE means 'ToInteger operation case'. 212 212 * We need to determine if it is decimal or hexadecimal. 213 213 */ 214 - if ((*string == '0') && (ACPI_TOLOWER(*(string + 1)) == 'x')) { 214 + if ((*string == '0') && (tolower((int)*(string + 1)) == 'x')) { 215 215 sign_of0x = 1; 216 216 base = 16; 217 217 ··· 224 224 225 225 /* Any string left? Check that '0x' is not followed by white space. */ 226 226 227 - if (!(*string) || ACPI_IS_SPACE(*string) || *string == '\t') { 227 + if (!(*string) || isspace((int)*string) || *string == '\t') { 228 228 if (to_integer_op) { 229 229 goto error_exit; 230 230 } else { ··· 241 241 /* Main loop: convert the string to a 32- or 64-bit integer */ 242 242 243 243 while (*string) { 244 - if (ACPI_IS_DIGIT(*string)) { 244 + if (isdigit((int)*string)) { 245 245 246 246 /* Convert ASCII 0-9 to Decimal value */ 247 247 ··· 252 252 253 253 term = 1; 254 254 } else { 255 - this_digit = (u8)ACPI_TOUPPER(*string); 256 - if (ACPI_IS_XDIGIT((char)this_digit)) { 255 + this_digit = (u8)toupper((int)*string); 256 + if (isxdigit((int)this_digit)) { 257 257 258 258 /* Convert ASCII Hex char to value */ 259 259 ··· 404 404 405 405 /* Check for printable character or hex escape */ 406 406 407 - if (ACPI_IS_PRINT(string[i])) { 407 + if (isprint((int)string[i])) { 408 408 /* This is a normal character */ 409 409 410 410 acpi_os_printf("%c", (int)string[i]); ··· 609 609 u8 acpi_ut_safe_strcpy(char *dest, acpi_size dest_size, char *source) 610 610 { 611 611 612 - if (ACPI_STRLEN(source) >= dest_size) { 612 + if (strlen(source) >= dest_size) { 613 613 return (TRUE); 614 614 } 615 615 616 - ACPI_STRCPY(dest, source); 616 + strcpy(dest, source); 617 617 return (FALSE); 618 618 } 619 619 620 620 u8 acpi_ut_safe_strcat(char *dest, acpi_size dest_size, char *source) 621 621 { 622 622 623 - if ((ACPI_STRLEN(dest) + ACPI_STRLEN(source)) >= dest_size) { 623 + if ((strlen(dest) + strlen(source)) >= dest_size) { 624 624 return (TRUE); 625 625 } 626 626 627 - ACPI_STRCAT(dest, source); 627 + strcat(dest, source); 628 628 return (FALSE); 629 629 } 630 630 ··· 635 635 { 636 636 acpi_size actual_transfer_length; 637 637 638 - actual_transfer_length = 639 - ACPI_MIN(max_transfer_length, ACPI_STRLEN(source)); 638 + actual_transfer_length = ACPI_MIN(max_transfer_length, strlen(source)); 640 639 641 - if ((ACPI_STRLEN(dest) + actual_transfer_length) >= dest_size) { 640 + if ((strlen(dest) + actual_transfer_length) >= dest_size) { 642 641 return (TRUE); 643 642 } 644 643 645 - ACPI_STRNCAT(dest, source, max_transfer_length); 644 + strncat(dest, source, max_transfer_length); 646 645 return (FALSE); 647 646 } 648 647 #endif
+4 -4
drivers/acpi/acpica/uttrack.c
··· 100 100 return (AE_NO_MEMORY); 101 101 } 102 102 103 - ACPI_MEMSET(cache, 0, sizeof(struct acpi_memory_list)); 103 + memset(cache, 0, sizeof(struct acpi_memory_list)); 104 104 105 105 cache->list_name = list_name; 106 106 cache->object_size = object_size; ··· 402 402 allocation->component = component; 403 403 allocation->line = line; 404 404 405 - ACPI_STRNCPY(allocation->module, module, ACPI_MAX_MODULE_NAME); 405 + strncpy(allocation->module, module, ACPI_MAX_MODULE_NAME); 406 406 allocation->module[ACPI_MAX_MODULE_NAME - 1] = 0; 407 407 408 408 if (!element) { ··· 497 497 498 498 /* Mark the segment as deleted */ 499 499 500 - ACPI_MEMSET(&allocation->user_space, 0xEA, allocation->size); 500 + memset(&allocation->user_space, 0xEA, allocation->size); 501 501 502 502 status = acpi_ut_release_mutex(ACPI_MTX_MEMORY); 503 503 return (status); ··· 595 595 while (element) { 596 596 if ((element->component & component) && 597 597 ((module == NULL) 598 - || (0 == ACPI_STRCMP(module, element->module)))) { 598 + || (0 == strcmp(module, element->module)))) { 599 599 descriptor = 600 600 ACPI_CAST_PTR(union acpi_descriptor, 601 601 &element->user_space);
+4 -4
drivers/acpi/acpica/utxface.c
··· 234 234 stats->sci_count = acpi_sci_count; 235 235 stats->gpe_count = acpi_gpe_count; 236 236 237 - ACPI_MEMCPY(stats->fixed_event_count, acpi_fixed_event_count, 238 - sizeof(acpi_fixed_event_count)); 237 + memcpy(stats->fixed_event_count, acpi_fixed_event_count, 238 + sizeof(acpi_fixed_event_count)); 239 239 240 240 /* Other counters */ 241 241 ··· 322 322 323 323 /* Parameter validation */ 324 324 325 - if (!interface_name || (ACPI_STRLEN(interface_name) == 0)) { 325 + if (!interface_name || (strlen(interface_name) == 0)) { 326 326 return (AE_BAD_PARAMETER); 327 327 } 328 328 ··· 374 374 375 375 /* Parameter validation */ 376 376 377 - if (!interface_name || (ACPI_STRLEN(interface_name) == 0)) { 377 + if (!interface_name || (strlen(interface_name) == 0)) { 378 378 return (AE_BAD_PARAMETER); 379 379 } 380 380
+4 -4
include/acpi/actypes.h
··· 542 542 #define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b))) 543 543 #define ACPI_MOVE_NAME(dest,src) (*ACPI_CAST_PTR (u32, (dest)) = *ACPI_CAST_PTR (u32, (src))) 544 544 #else 545 - #define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) 546 - #define ACPI_MOVE_NAME(dest,src) (ACPI_STRNCPY (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE)) 545 + #define ACPI_COMPARE_NAME(a,b) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) 546 + #define ACPI_MOVE_NAME(dest,src) (strncpy (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE)) 547 547 #endif 548 548 549 549 /* Support for the special RSDP signature (8 characters) */ 550 550 551 - #define ACPI_VALIDATE_RSDP_SIG(a) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8)) 552 - #define ACPI_MAKE_RSDP_SIG(dest) (ACPI_MEMCPY (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8)) 551 + #define ACPI_VALIDATE_RSDP_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8)) 552 + #define ACPI_MAKE_RSDP_SIG(dest) (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8)) 553 553 554 554 /******************************************************************************* 555 555 *
-38
include/acpi/platform/acenv.h
··· 346 346 347 347 /* We will be linking to the standard Clib functions */ 348 348 349 - #define ACPI_STRSTR(s1,s2) strstr((s1), (s2)) 350 - #define ACPI_STRCHR(s1,c) strchr((s1), (c)) 351 - #define ACPI_STRLEN(s) (acpi_size) strlen((s)) 352 - #define ACPI_STRCPY(d,s) (void) strcpy((d), (s)) 353 - #define ACPI_STRNCPY(d,s,n) (void) strncpy((d), (s), (acpi_size)(n)) 354 - #define ACPI_STRNCMP(d,s,n) strncmp((d), (s), (acpi_size)(n)) 355 - #define ACPI_STRCMP(d,s) strcmp((d), (s)) 356 - #define ACPI_STRCAT(d,s) (void) strcat((d), (s)) 357 - #define ACPI_STRNCAT(d,s,n) strncat((d), (s), (acpi_size)(n)) 358 - #define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (acpi_size)(n)) 359 - #define ACPI_MEMCMP(s1,s2,n) memcmp((const char *)(s1), (const char *)(s2), (acpi_size)(n)) 360 - #define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (acpi_size)(n)) 361 - #define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (acpi_size)(n)) 362 - #define ACPI_TOUPPER(i) toupper((int) (i)) 363 - #define ACPI_TOLOWER(i) tolower((int) (i)) 364 - #define ACPI_IS_XDIGIT(i) isxdigit((int) (i)) 365 - #define ACPI_IS_DIGIT(i) isdigit((int) (i)) 366 - #define ACPI_IS_SPACE(i) isspace((int) (i)) 367 - #define ACPI_IS_UPPER(i) isupper((int) (i)) 368 - #define ACPI_IS_PRINT(i) isprint((int) (i)) 369 - #define ACPI_IS_ALPHA(i) isalpha((int) (i)) 370 - 371 349 #else 372 350 373 351 /****************************************************************************** ··· 382 404 #endif /* va_arg */ 383 405 384 406 /* Use the local (ACPICA) definitions of the clib functions */ 385 - 386 - #define ACPI_STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2)) 387 - #define ACPI_STRCHR(s1,c) acpi_ut_strchr ((s1), (c)) 388 - #define ACPI_STRLEN(s) (acpi_size) acpi_ut_strlen ((s)) 389 - #define ACPI_STRCPY(d,s) (void) acpi_ut_strcpy ((d), (s)) 390 - #define ACPI_STRNCPY(d,s,n) (void) acpi_ut_strncpy ((d), (s), (acpi_size)(n)) 391 - #define ACPI_STRNCMP(d,s,n) acpi_ut_strncmp ((d), (s), (acpi_size)(n)) 392 - #define ACPI_STRCMP(d,s) acpi_ut_strcmp ((d), (s)) 393 - #define ACPI_STRCAT(d,s) (void) acpi_ut_strcat ((d), (s)) 394 - #define ACPI_STRNCAT(d,s,n) acpi_ut_strncat ((d), (s), (acpi_size)(n)) 395 - #define ACPI_STRTOUL(d,s,n) acpi_ut_strtoul ((d), (s), (acpi_size)(n)) 396 - #define ACPI_MEMCMP(s1,s2,n) acpi_ut_memcmp((const char *)(s1), (const char *)(s2), (acpi_size)(n)) 397 - #define ACPI_MEMCPY(d,s,n) (void) acpi_ut_memcpy ((d), (s), (acpi_size)(n)) 398 - #define ACPI_MEMSET(d,v,n) (void) acpi_ut_memset ((d), (v), (acpi_size)(n)) 399 - #define ACPI_TOUPPER(c) acpi_ut_to_upper ((int) (c)) 400 - #define ACPI_TOLOWER(c) acpi_ut_to_lower ((int) (c)) 401 407 402 408 #endif /* ACPI_USE_SYSTEM_CLIBRARY */ 403 409
+2 -2
tools/power/acpi/common/getopt.c
··· 127 127 argv[acpi_gbl_optind][0] != '-' || 128 128 argv[acpi_gbl_optind][1] == '\0') { 129 129 return (ACPI_OPT_END); 130 - } else if (ACPI_STRCMP(argv[acpi_gbl_optind], "--") == 0) { 130 + } else if (strcmp(argv[acpi_gbl_optind], "--") == 0) { 131 131 acpi_gbl_optind++; 132 132 return (ACPI_OPT_END); 133 133 } ··· 140 140 /* Make sure that the option is legal */ 141 141 142 142 if (current_char == ':' || 143 - (opts_ptr = ACPI_STRCHR(opts, current_char)) == NULL) { 143 + (opts_ptr = strchr(opts, current_char)) == NULL) { 144 144 ACPI_OPTION_ERROR("Illegal option: -", current_char); 145 145 146 146 if (argv[acpi_gbl_optind][++current_char_ptr] == '\0') {
+3 -3
tools/power/acpi/os_specific/service_layers/oslinuxtbl.c
··· 222 222 goto exit; 223 223 } 224 224 225 - ACPI_MEMCPY(local_table, mapped_table, table_length); 225 + memcpy(local_table, mapped_table, table_length); 226 226 227 227 exit: 228 228 osl_unmap_table(mapped_table); ··· 531 531 gbl_rsdp_address = 532 532 rsdp_base + (ACPI_CAST8(mapped_table) - rsdp_address); 533 533 534 - ACPI_MEMCPY(&gbl_rsdp, mapped_table, sizeof(struct acpi_table_rsdp)); 534 + memcpy(&gbl_rsdp, mapped_table, sizeof(struct acpi_table_rsdp)); 535 535 acpi_os_unmap_memory(rsdp_address, rsdp_size); 536 536 537 537 return (AE_OK); ··· 964 964 goto exit; 965 965 } 966 966 967 - ACPI_MEMCPY(local_table, mapped_table, table_length); 967 + memcpy(local_table, mapped_table, table_length); 968 968 *address = table_address; 969 969 *table = local_table; 970 970
+4 -4
tools/power/acpi/tools/acpidump/apdump.c
··· 329 329 acpi_status status; 330 330 int table_status; 331 331 332 - if (ACPI_STRLEN(signature) != ACPI_NAME_SIZE) { 332 + if (strlen(signature) != ACPI_NAME_SIZE) { 333 333 acpi_log_error 334 334 ("Invalid table signature [%s]: must be exactly 4 characters\n", 335 335 signature); ··· 338 338 339 339 /* Table signatures are expected to be uppercase */ 340 340 341 - ACPI_STRCPY(local_signature, signature); 341 + strcpy(local_signature, signature); 342 342 acpi_ut_strupr(local_signature); 343 343 344 344 /* To be friendly, handle tables whose signatures do not match the name */ 345 345 346 346 if (ACPI_COMPARE_NAME(local_signature, "FADT")) { 347 - ACPI_STRCPY(local_signature, ACPI_SIG_FADT); 347 + strcpy(local_signature, ACPI_SIG_FADT); 348 348 } else if (ACPI_COMPARE_NAME(local_signature, "MADT")) { 349 - ACPI_STRCPY(local_signature, ACPI_SIG_MADT); 349 + strcpy(local_signature, ACPI_SIG_MADT); 350 350 } 351 351 352 352 /* Dump all instances of this signature (to handle multiple SSDTs) */
+6 -6
tools/power/acpi/tools/acpidump/apfiles.c
··· 136 136 } else { 137 137 ACPI_MOVE_NAME(filename, table->signature); 138 138 } 139 - filename[0] = (char)ACPI_TOLOWER(filename[0]); 140 - filename[1] = (char)ACPI_TOLOWER(filename[1]); 141 - filename[2] = (char)ACPI_TOLOWER(filename[2]); 142 - filename[3] = (char)ACPI_TOLOWER(filename[3]); 139 + filename[0] = (char)tolower((int)filename[0]); 140 + filename[1] = (char)tolower((int)filename[1]); 141 + filename[2] = (char)tolower((int)filename[2]); 142 + filename[3] = (char)tolower((int)filename[3]); 143 143 filename[ACPI_NAME_SIZE] = 0; 144 144 145 145 /* Handle multiple SSDts - create different filenames for each */ ··· 147 147 if (instance > 0) { 148 148 acpi_ut_snprintf(instance_str, sizeof(instance_str), "%u", 149 149 instance); 150 - ACPI_STRCAT(filename, instance_str); 150 + strcat(filename, instance_str); 151 151 } 152 152 153 - ACPI_STRCAT(filename, ACPI_TABLE_FILE_SUFFIX); 153 + strcat(filename, ACPI_TABLE_FILE_SUFFIX); 154 154 155 155 if (gbl_verbose_mode) { 156 156 acpi_log_error