@@ -103,7 +103,7 @@ static const struct acpi_port_info acpi_protected_ports[] = {
{"PCI", 0x0CF8, 0x0CFF, ACPI_OSI_WIN_XP}
};
-#define ACPI_PORT_INFO_ENTRIES ACPI_ARRAY_LENGTH (acpi_protected_ports)
+#define ACPI_PORT_INFO_ENTRIES ARRAY_SIZE(acpi_protected_ports)
/******************************************************************************
*
@@ -126,7 +126,7 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state)
/* Compare input string to static table of supported interfaces */
- for (i = 0; i < ACPI_ARRAY_LENGTH(acpi_interfaces_supported); i++) {
+ for (i = 0; i < ARRAY_SIZE(acpi_interfaces_supported); i++) {
if (!ACPI_STRCMP(string_desc->string.pointer,
acpi_interfaces_supported[i].name)) {
/*
@@ -186,7 +186,7 @@ acpi_status acpi_osi_invalidate(char *interface)
{
int i;
- for (i = 0; i < ACPI_ARRAY_LENGTH(acpi_interfaces_supported); i++) {
+ for (i = 0; i < ARRAY_SIZE(acpi_interfaces_supported); i++) {
if (!ACPI_STRCMP(interface, acpi_interfaces_supported[i].name)) {
*acpi_interfaces_supported[i].name = '\0';
return AE_OK;
@@ -441,10 +441,6 @@ typedef unsigned long long acpi_integer;
#define ACPI_MIN(a,b) (((a)<(b))?(a):(b))
#define ACPI_MAX(a,b) (((a)>(b))?(a):(b))
-/* Size calculation */
-
-#define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0]))
-
/* Pointer manipulation */
#define ACPI_CAST_PTR(t, p) ((t *) (acpi_uintptr_t) (p))