openwrt-packages/utils/acpica-unix/patches/0001-ACPI_CAST_PTR-cast-thr...

23 lines
977 B
Diff

From 0f814783ef9ed3a50e15cab08579218ec45b4640 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= <thomas@t-8ch.de>
Date: Sat, 21 May 2022 12:15:16 +0200
Subject: [PATCH 1/3] ACPI_CAST_PTR: cast through "void *"
Not all pointer are castable to integers directly and ACPI_UINTPTR_T is
not guaranteed to be "void *".
---
source/include/actypes.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/source/include/actypes.h
+++ b/source/include/actypes.h
@@ -649,7 +649,7 @@ typedef UINT64
/* Pointer manipulation */
-#define ACPI_CAST_PTR(t, p) ((t *) (ACPI_UINTPTR_T) (p))
+#define ACPI_CAST_PTR(t, p) ((t *) (ACPI_UINTPTR_T) (void *) (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)))