Skip to contentSkip to conversation

iommu/amd: Fix section mismatch warning for detect_ivrs()

PATCH In review Joerg Roedel 2 participants 2 messages Jun 8, 2021

Subsystems (2)
lore
Share & tools
lore

Joerg Roedel

author maintainer
#0 lore raw

PATCH 1/1 iommu/amd: Fix section mismatch warning for detect_ivrs()

From: Joerg Roedel <[email protected]>

A recent commit introduced this section mismatch warning:

	WARNING: modpost: vmlinux.o(.text.unlikely+0x22a1f): Section mismatch in reference from the function detect_ivrs() to the variable .init.data:amd_iommu_force_enable

The reason is that detect_ivrs() is not marked __init while it should be, because it is only called from another __init function. Mark detect_ivrs() __init to get rid of the warning.

Fixes b1e650db2cc4 ("iommu/amd: Add amd_iommu=force_enable option")
---
 drivers/iommu/amd/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/amd/init.c +1 -1
index 4e4fb0f4e412..46280e6e1535 100644
@@ -2817,7 +2817,7 @@ static int amd_iommu_enable_interrupts(void)
 	return ret;
 }
 
-static bool detect_ivrs(void)
+static bool __init detect_ivrs(void)
 {
 	struct acpi_table_header *ivrs_base;
 	acpi_status status;
Signature · 1 line
2.31.1
Acked-by on v1 1/1
#1 lore raw

[AMD Public Use]

Quoted 18 lines

-----Original Message-----
From: Joerg Roedel <[email protected]>
Sent: Tuesday, June 8, 2021 8:29 AM
To: Joerg Roedel <[email protected]>; Will Deacon <[email protected]>
Cc: Deucher, Alexander <[email protected]>; [email protected]; [email protected]; Joerg Roedel <[email protected]>
Subject: [PATCH] iommu/amd: Fix section mismatch warning for detect_ivrs()

From: Joerg Roedel <[email protected]>

A recent commit introduced this section mismatch warning:

	WARNING: modpost: vmlinux.o(.text.unlikely+0x22a1f): Section

mismatch in reference from the function detect_ivrs() to the variable .init.data:amd_iommu_force_enable

Quoted 7 lines

The reason is that detect_ivrs() is not marked __init while it should be, because it is only called from another __init function. Mark detect_ivrs() __init to get rid of the warning.

Fixes b1e650db2cc4 ("iommu/amd: Add amd_iommu=force_enable

option")

Quoted 19 lines
---
 drivers/iommu/amd/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/amd/init.c index renamed from drivers/iommu/amd/init.c +0 -0

4e4fb0f4e412..46280e6e1535 100644

drivers/iommu/amd/init.c +1 -2
@@ -2817,7 +2817,7 @@ static int amd_iommu_enable_interrupts(void)
 	return ret;
 }
 
-static bool detect_ivrs(void)
+static bool __init detect_ivrs(void)
 {
 	struct acpi_table_header *ivrs_base;
 	acpi_status status;
--

2.31.1