Skip to content
Permalink
Browse files

Macros: remove pointer math on a null pointer

Causes warnings on some compilers and/or tools.
Changed ACPI_TO_POINTER to use ACPI_CAST_PTR instead of using
arithmetic.

Reported by: Qian Cai (cai@lca.pw).
  • Loading branch information...
acpibob committed Jul 26, 2019
1 parent 2667516 commit 02bbca5070e42d298c9b824300aa0eb8a082d797
Showing with 1 addition and 1 deletion.
  1. +1 −1 source/include/actypes.h
@@ -657,7 +657,7 @@ typedef UINT64 ACPI_INTEGER;

/* Pointer/Integer type conversions */

#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) 0, (ACPI_SIZE) (i))
#define ACPI_TO_POINTER(i) ACPI_CAST_PTR (void, (ACPI_SIZE) (i))
#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) 0)
#define ACPI_OFFSET(d, f) ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) 0)
#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)

0 comments on commit 02bbca5

Please sign in to comment.
You can’t perform that action at this time.