Skip to contentSkip to conversation

intel_idle: Add __init annotation to matchup_vm_state_with_baremetal()

PATCH In review Rafael J. Wysocki 2 participants 2 messages Jun 27, 2023 Intel idle driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 intel_idle: Add __init annotation to matchup_vm_state_with_baremetal()

From: Rafael J. Wysocki <[email protected]>

The caller of (recently added) matchup_vm_state_with_baremetal() is an __init function and it uses some __initdata data structures, so add the __init annotation to it for consistency.

This addresses the following build warnings:

WARNING: modpost: vmlinux: section mismatch in reference: matchup_vm_state_with_baremetal+0x51 (section: .text) -> intel_idle_max_cstate_reached (section: .init.text)
WARNING: modpost: vmlinux: section mismatch in reference: matchup_vm_state_with_baremetal+0x62 (section: .text) -> cpuidle_state_table (section: .init.data)
WARNING: modpost: vmlinux: section mismatch in reference: matchup_vm_state_with_baremetal+0x79 (section: .text) -> icpu (section: .init.data)

Fixes 0fac214bb75e ("intel_idle: Add a "Long HLT" C1 state for the VM guest mode")
---
 drivers/idle/intel_idle.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/idle/intel_idle.c +1 -1
Index: linux-pm/drivers/idle/intel_idle.c
===================================================================
@@ -2147,7 +2147,7 @@ static void __init intel_idle_cpuidle_de
  * All our short idle states are dominated by vmexit/vmenter latencies,
  * not the underlying hardware latencies so we keep our values for these.
  */
-static void matchup_vm_state_with_baremetal(void)
+static void __init matchup_vm_state_with_baremetal(void)
 {
 	int cstate;
 
Tested-by Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

The caller of (recently added) matchup_vm_state_with_baremetal() is an __init function and it uses some __initdata data structures, so add the __init annotation to it for consistency.

This addresses the following build warnings:

Quoted 7 lines

WARNING: modpost: vmlinux: section mismatch in reference: matchup_vm_state_with_baremetal+0x51 (section: .text) -> intel_idle_max_cstate_reached (section: .init.text)
WARNING: modpost: vmlinux: section mismatch in reference: matchup_vm_state_with_baremetal+0x62 (section: .text) -> cpuidle_state_table (section: .init.data)
WARNING: modpost: vmlinux: section mismatch in reference: matchup_vm_state_with_baremetal+0x79 (section: .text) -> icpu (section: .init.data)

Fixes 0fac214bb75e ("intel_idle: Add a "Long HLT" C1 state for the VM guest mode")

Thanks.

Quoted 20 lines
---
 drivers/idle/intel_idle.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-pm/drivers/idle/intel_idle.c
===================================================================

drivers/idle/intel_idle.c +1 -1
@@ -2147,7 +2147,7 @@ static void __init intel_idle_cpuidle_de
  * All our short idle states are dominated by vmexit/vmenter latencies,
  * not the underlying hardware latencies so we keep our values for these.
  */
-static void matchup_vm_state_with_baremetal(void)
+static void __init matchup_vm_state_with_baremetal(void)
 {
 	int cstate;
 
Signature · 1 line
~Randy