linux/include/acpi
Kees Cook 11132ad017 ACPICA: Introduce ACPI_FLEX_ARRAY
ACPICA commit e73b227e8e475c20cc394f237ea35d592fdf9ec3

In order to enable using -fstrict-flex-arrays with GCC and Clang in the
Linux kernel, each trailing dynamically sized array must be defined as
proper C99 "flexible array members" (FAM). Unfortunately, ACPICA has a
bunch of technical debt, dating back to before even the GNU extension of
0-length arrays, meaning the code base has many 1-element and 0-length
arrays defined at the end of structures that should actually be FAMs.

One limitation of the C99 FAM specification is the accidental requirement
that they cannot be in unions or alone in structs. There is no real-world
reason for this, though, and, actually, the existing GNU extension
permits this for 0-length arrays (which get treated as FAMs).

Add the ACPI_FLEX_ARRAY() helper macro to work around this requirement
so that FAMs can be defined in unions or alone in structs. Since this
behavior still depends on GNU extensions, keep the macro specific to GCC
(and Clang) builds. In this way, MSVC will continue to use 0-length
arrays (since it does not support the union work-around). When MSVC
grows support for this in the future, the macro can be updated.

Link: https://github.com/acpica/acpica/commit/e73b227e
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2023-04-06 20:29:12 +02:00
..
platform ACPICA: Introduce ACPI_FLEX_ARRAY 2023-04-06 20:29:12 +02:00
acbuffer.h ACPICA: Update all copyrights/signons to 2023 2023-04-06 20:29:11 +02:00
acconfig.h ACPICA: Update all copyrights/signons to 2023 2023-04-06 20:29:11 +02:00
acexcep.h ACPICA: Update all copyrights/signons to 2023 2023-04-06 20:29:11 +02:00
acnames.h ACPICA: Update all copyrights/signons to 2023 2023-04-06 20:29:11 +02:00
acoutput.h ACPICA: Update all copyrights/signons to 2023 2023-04-06 20:29:11 +02:00
acpi_bus.h ACPI: x86: Introduce an acpi_quirk_skip_gpio_event_handlers() helper 2023-03-07 14:15:10 +01:00
acpi_drivers.h Merge branches 'acpi-pci' and 'acpi-processor' 2021-04-26 17:03:05 +02:00
acpi_io.h Revert "ACPI: Add memory semantics to acpi_os_map_memory()" 2021-09-23 20:39:36 +02:00
acpi_lpat.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
acpi_numa.h ACPI: processor: Replace kernel.h with the necessary inclusions 2021-11-24 17:44:04 +01:00
acpi.h ACPICA: Update all copyrights/signons to 2023 2023-04-06 20:29:11 +02:00
acpiosxf.h ACPICA: Update all copyrights/signons to 2023 2023-04-06 20:29:11 +02:00
acpixf.h ACPICA: Update all copyrights/signons to 2023 2023-04-06 20:29:11 +02:00
acrestyp.h ACPICA: struct acpi_resource_vendor: Replace 1-element array with flexible array 2023-04-06 20:29:11 +02:00
actbl1.h ACPICA: actbl1: Replace 1-element arrays with flexible arrays 2023-04-06 20:29:11 +02:00
actbl2.h ACPICA: struct acpi_nfit_interleave: Replace 1-element array with flexible array 2023-04-06 20:29:12 +02:00
actbl3.h ACPICA: Update all copyrights/signons to 2023 2023-04-06 20:29:11 +02:00
actbl.h ACPICA: Update all copyrights/signons to 2023 2023-04-06 20:29:11 +02:00
actypes.h ACPICA: Introduce ACPI_FLEX_ARRAY 2023-04-06 20:29:12 +02:00
acuuid.h ACPICA: Update all copyrights/signons to 2023 2023-04-06 20:29:11 +02:00
apei.h ACPI: APEI: Fix missing ERST record id 2022-04-13 20:29:24 +02:00
battery.h ACPI: battery: Pass battery hook pointer to hook callbacks 2022-11-16 08:48:18 +01:00
button.h ACPI: button: move HIDs to acpi/button.h 2020-02-13 23:36:23 +01:00
cppc_acpi.h ACPI: CPPC: Add AMD pstate energy performance preference cppc control 2023-02-03 21:59:41 +01:00
ghes.h - Make ghes_edac a simple module like the rest of the EDAC drivers and 2022-12-12 14:47:31 -08:00
hed.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 428 2019-06-05 17:37:16 +02:00
nfit.h acpi, nfit: Add function to look up nvdimm device and provide SMBIOS handle 2018-03-14 12:43:50 +01:00
pcc.h mailbox: pcc: Use PCC mailbox channel pointer instead of standard 2021-10-29 22:46:38 -05:00
pdc_intel.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
processor.h ACPI: processor: Silence missing prototype warnings 2022-11-23 19:36:46 +01:00
reboot.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
video.h ACPI: video: Allow GPU drivers to report no panels 2022-12-22 17:26:41 +01:00