ACPICA: Use uintptr_t and offsetof() in Linux kernel builds
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 11 Jan 2022 15:55:25 +0000 (16:55 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 25 Jan 2022 17:41:23 +0000 (18:41 +0100)
commitae57857b9b6341096ddfd9c0cf26fb640c561160
tree91295591eaeefcd5a5fa0c0198a859fa87c3e3e2
parente783362eb54cd99b2cac8b3a9aeac942e6f6ac07
ACPICA: Use uintptr_t and offsetof() in Linux kernel builds

To avoid "performing pointer subtraction with a null pointer has
undefined behavior" compiler warnings, use uintptr_t and offsetof()
that are always available during Linux kernel builds to define
acpi_uintptr_t and the ACPI_TO_INTEGER() and ACPI_OFFSET() macros.

Based on earlier proposal from Arnd Bergmann.

Link: https://lore.kernel.org/linux-acpi/20210927121338.938994-1-arnd@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
include/acpi/actypes.h
include/acpi/platform/aclinux.h