Skip to contentSkip to conversation

ACPI: APEI: EINJ: make read-only array non_mmio_desc static const

PATCH Applied Colin Ian King 2 participants 2 messages Dec 19, 2025 – Jan 7

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI: APEI: EINJ: make read-only array non_mmio_desc static const

Don't populate the read-only array non_mmio_desc on the stack at run time, instead make it static const.

---
 drivers/acpi/apei/einj-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/apei/einj-core.c +1 -1
index 305c240a303f..f5bfdffe1e43 100644
@@ -679,7 +679,7 @@ static bool is_allowed_range(u64 base_addr, u64 size)
 	 * region intersects with known resource. So do an allow list check for
 	 * IORES_DESCs that definitely or most likely not MMIO.
 	 */
-	int non_mmio_desc[] = {
+	static const int non_mmio_desc[] = {
 		IORES_DESC_CRASH_KERNEL,
 		IORES_DESC_ACPI_TABLES,
 		IORES_DESC_ACPI_NV_STORAGE,
Signature · 1 line
2.51.0
maintainer Applied
#1 lore raw
Quoted 14 lines · Colin Ian King

Don't populate the read-only array non_mmio_desc on the stack at run time, instead make it static const.

---
 drivers/acpi/apei/einj-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/apei/einj-core.c +0 -0
index 305c240a303f..f5bfdffe1e43 100644

drivers/acpi/apei/einj-core.c static bool is_allowed_range(u64 base_addr, u64 size)

Quoted 9 lines
drivers/acpi/apei/einj-core.c +1 -2
@@ -679,7 +679,7 @@ static bool is_allowed_range(u64 base_addr, u64 size)
         * region intersects with known resource. So do an allow list check for
         * IORES_DESCs that definitely or most likely not MMIO.
         */
-       int non_mmio_desc[] = {
+       static const int non_mmio_desc[] = {
                IORES_DESC_CRASH_KERNEL,
                IORES_DESC_ACPI_TABLES,
                IORES_DESC_ACPI_NV_STORAGE,
--

Applied as 6.20 material, thanks!