Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4fa4616e authored by Bob Moore's avatar Bob Moore Committed by Rafael J. Wysocki
Browse files

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: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarJung-uk Kim <jkim@FreeBSD.org>
Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 63c43812
Loading
Loading
Loading
Loading
+22 −24
Original line number Diff line number Diff line
@@ -210,37 +210,35 @@ void acpi_ut_subsystem_shutdown(void);
 */
#ifndef ACPI_USE_SYSTEM_CLIBRARY

acpi_size acpi_ut_strlen(const char *string);
acpi_size strlen(const char *string);

char *acpi_ut_strchr(const char *string, int ch);
char *strchr(const char *string, int ch);

char *acpi_ut_strcpy(char *dst_string, const char *src_string);
char *strcpy(char *dst_string, const char *src_string);

char *acpi_ut_strncpy(char *dst_string,
		      const char *src_string, acpi_size count);
char *strncpy(char *dst_string, const char *src_string, acpi_size count);

int acpi_ut_memcmp(const char *buffer1, const char *buffer2, acpi_size count);
int strncmp(const char *string1, const char *string2, acpi_size count);

int acpi_ut_strncmp(const char *string1, const char *string2, acpi_size count);
int strcmp(const char *string1, const char *string2);

int acpi_ut_strcmp(const char *string1, const char *string2);
char *strcat(char *dst_string, const char *src_string);

char *acpi_ut_strcat(char *dst_string, const char *src_string);
char *strncat(char *dst_string, const char *src_string, acpi_size count);

char *acpi_ut_strncat(char *dst_string,
		      const char *src_string, acpi_size count);
u32 strtoul(const char *string, char **terminator, u32 base);

u32 acpi_ut_strtoul(const char *string, char **terminator, u32 base);
char *strstr(char *string1, char *string2);

char *acpi_ut_strstr(char *string1, char *string2);
int memcmp(void *buffer1, void *buffer2, acpi_size count);

void *acpi_ut_memcpy(void *dest, const void *src, acpi_size count);
void *memcpy(void *dest, const void *src, acpi_size count);

void *acpi_ut_memset(void *dest, u8 value, acpi_size count);
void *memset(void *dest, int value, acpi_size count);

int acpi_ut_to_upper(int c);
int toupper(int c);

int acpi_ut_to_lower(int c);
int tolower(int c);

extern const u8 _acpi_ctype[];

@@ -255,13 +253,13 @@ extern const u8 _acpi_ctype[];
#define _ACPI_UP     0x01	/* 'A'-'Z' */
#define _ACPI_XD     0x80	/* '0'-'9', 'A'-'F', 'a'-'f' */

#define ACPI_IS_DIGIT(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI))
#define ACPI_IS_SPACE(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP))
#define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD))
#define ACPI_IS_UPPER(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP))
#define ACPI_IS_LOWER(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO))
#define ACPI_IS_PRINT(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU))
#define ACPI_IS_ALPHA(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
#define isdigit(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI))
#define isspace(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP))
#define isxdigit(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD))
#define isupper(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP))
#define islower(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO))
#define isprint(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU))
#define isalpha(c)  (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))

#endif				/* !ACPI_USE_SYSTEM_CLIBRARY */

+1 −1
Original line number Diff line number Diff line
@@ -502,7 +502,7 @@ acpi_ds_create_field(union acpi_parse_object *op,
		}
	}

	ACPI_MEMSET(&info, 0, sizeof(struct acpi_create_field_info));
	memset(&info, 0, sizeof(struct acpi_create_field_info));

	/* Second arg is the field flags */

+1 −1
Original line number Diff line number Diff line
@@ -207,7 +207,7 @@ acpi_ds_initialize_objects(u32 table_index,

	/* Set all init info to zero */

	ACPI_MEMSET(&info, 0, sizeof(struct acpi_init_walk_info));
	memset(&info, 0, sizeof(struct acpi_init_walk_info));

	info.owner_id = owner_id;
	info.table_index = table_index;
+3 −4
Original line number Diff line number Diff line
@@ -339,8 +339,8 @@ acpi_ds_build_internal_buffer_obj(struct acpi_walk_state *walk_state,
		/* Initialize buffer from the byte_list (if present) */

		if (byte_list) {
			ACPI_MEMCPY(obj_desc->buffer.pointer,
				    byte_list->named.data, byte_list_length);
			memcpy(obj_desc->buffer.pointer, byte_list->named.data,
			       byte_list_length);
		}
	}

@@ -750,8 +750,7 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
	case ACPI_TYPE_STRING:

		obj_desc->string.pointer = op->common.value.string;
		obj_desc->string.length =
		    (u32)ACPI_STRLEN(op->common.value.string);
		obj_desc->string.length = (u32)strlen(op->common.value.string);

		/*
		 * The string is contained in the ACPI table, don't ever try
+2 −2
Original line number Diff line number Diff line
@@ -572,7 +572,7 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
					obj_desc =
					    acpi_ut_create_string_object((acpi_size) name_length);

					ACPI_STRNCPY(obj_desc->string.pointer,
					strncpy(obj_desc->string.pointer,
						name_string, name_length);
					status = AE_OK;
				} else {
Loading