From f6734e24075724961ca99f24270f5e07d6264ebf Mon Sep 17 00:00:00 2001 From: Robert Moore Date: Tue, 7 Feb 2023 10:35:35 -0800 Subject: Revert "Fix dangling pointer warning for AcpiUtInitStackPtrTrace" --- source/components/debugger/dbstats.c | 4 ++-- source/components/utilities/utdebug.c | 6 +++--- source/components/utilities/utinit.c | 2 +- source/include/acglobal.h | 4 ++-- source/include/actypes.h | 2 +- source/include/platform/aclinux.h | 5 ++--- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/source/components/debugger/dbstats.c b/source/components/debugger/dbstats.c index b5f31948b..a30d9948d 100644 --- a/source/components/debugger/dbstats.c +++ b/source/components/debugger/dbstats.c @@ -647,8 +647,8 @@ AcpiDbDisplayStatistics ( AcpiGbl_EntryStackPointer, AcpiGbl_LowestStackPointer); AcpiOsPrintf ("\nSubsystem Stack Usage:\n\n"); - AcpiOsPrintf ("Entry Stack Pointer %p\n", ACPI_TO_POINTER(AcpiGbl_EntryStackPointer)); - AcpiOsPrintf ("Lowest Stack Pointer %p\n", ACPI_TO_POINTER(AcpiGbl_LowestStackPointer)); + AcpiOsPrintf ("Entry Stack Pointer %p\n", AcpiGbl_EntryStackPointer); + AcpiOsPrintf ("Lowest Stack Pointer %p\n", AcpiGbl_LowestStackPointer); AcpiOsPrintf ("Stack Use %X (%u)\n", Temp, Temp); AcpiOsPrintf ("Deepest Procedure Nesting %u\n", AcpiGbl_DeepestNesting); #endif diff --git a/source/components/utilities/utdebug.c b/source/components/utilities/utdebug.c index b6e914592..b0c3640f2 100644 --- a/source/components/utilities/utdebug.c +++ b/source/components/utilities/utdebug.c @@ -185,7 +185,7 @@ AcpiUtInitStackPtrTrace ( ACPI_SIZE CurrentSp; - AcpiGbl_EntryStackPointer = ACPI_TO_INTEGER(&CurrentSp); + AcpiGbl_EntryStackPointer = &CurrentSp; } @@ -208,9 +208,9 @@ AcpiUtTrackStackPtr ( ACPI_SIZE CurrentSp; - if (ACPI_TO_INTEGER(&CurrentSp) < AcpiGbl_LowestStackPointer) + if (&CurrentSp < AcpiGbl_LowestStackPointer) { - AcpiGbl_LowestStackPointer = ACPI_TO_INTEGER(&CurrentSp); + AcpiGbl_LowestStackPointer = &CurrentSp; } if (AcpiGbl_NestingLevel > AcpiGbl_DeepestNesting) diff --git a/source/components/utilities/utinit.c b/source/components/utilities/utinit.c index 1e21ebdc3..37ec63bc6 100644 --- a/source/components/utilities/utinit.c +++ b/source/components/utilities/utinit.c @@ -359,7 +359,7 @@ AcpiUtInitGlobals ( #endif #ifdef ACPI_DEBUG_OUTPUT - AcpiGbl_LowestStackPointer = ACPI_SIZE_MAX; + AcpiGbl_LowestStackPointer = ACPI_CAST_PTR (ACPI_SIZE, ACPI_SIZE_MAX); #endif #ifdef ACPI_DBG_TRACK_ALLOCATIONS diff --git a/source/include/acglobal.h b/source/include/acglobal.h index 1010f768a..28fc6514b 100644 --- a/source/include/acglobal.h +++ b/source/include/acglobal.h @@ -332,8 +332,8 @@ extern const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames [NUM_PREDEFINED_ ACPI_GLOBAL (UINT32, AcpiGbl_CurrentNodeCount); ACPI_GLOBAL (UINT32, AcpiGbl_CurrentNodeSize); ACPI_GLOBAL (UINT32, AcpiGbl_MaxConcurrentNodeCount); -ACPI_GLOBAL (ACPI_UINTPTR_T, AcpiGbl_EntryStackPointer); -ACPI_GLOBAL (ACPI_UINTPTR_T, AcpiGbl_LowestStackPointer); +ACPI_GLOBAL (ACPI_SIZE *, AcpiGbl_EntryStackPointer); +ACPI_GLOBAL (ACPI_SIZE *, AcpiGbl_LowestStackPointer); ACPI_GLOBAL (UINT32, AcpiGbl_DeepestNesting); ACPI_INIT_GLOBAL (UINT32, AcpiGbl_NestingLevel, 0); #endif diff --git a/source/include/actypes.h b/source/include/actypes.h index 8486d2b98..77fa92123 100644 --- a/source/include/actypes.h +++ b/source/include/actypes.h @@ -649,7 +649,7 @@ typedef UINT64 ACPI_INTEGER; /* Pointer manipulation */ -#define ACPI_CAST_PTR(t, p) ((t *) (ACPI_UINTPTR_T) (void *) (p)) +#define ACPI_CAST_PTR(t, p) ((t *) (ACPI_UINTPTR_T) (p)) #define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (ACPI_UINTPTR_T) (p)) #define ACPI_ADD_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) + (ACPI_SIZE)(b))) #define ACPI_SUB_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) - (ACPI_SIZE)(b))) diff --git a/source/include/platform/aclinux.h b/source/include/platform/aclinux.h index 025fc8007..9035389d2 100644 --- a/source/include/platform/aclinux.h +++ b/source/include/platform/aclinux.h @@ -168,8 +168,6 @@ #define ACPI_USE_DO_WHILE_0 #define ACPI_IGNORE_PACKAGE_RESOLUTION_ERRORS -#define ACPI_UINTPTR_T uintptr_t - #ifdef __KERNEL__ @@ -254,6 +252,8 @@ #define ACPI_SPINLOCK spinlock_t * #define ACPI_CPU_FLAGS unsigned long +#define ACPI_UINTPTR_T uintptr_t + #define ACPI_TO_INTEGER(p) ((uintptr_t)(p)) #define ACPI_OFFSET(d, f) offsetof(d, f) @@ -311,7 +311,6 @@ #ifdef ACPI_USE_STANDARD_HEADERS #include -#include #endif /* Define/disable kernel-specific declarators */ -- cgit v1.2.1