Skip to contentSkip to conversation

arch_topology: Fix section miss match warning due to free_raw_capacity()

PATCH In review Prasad Sodagudi 2 participants 4 messages Sep 25, 2017 – Oct 10, 2017

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

PATCH 1/1 arch_topology: Fix section miss match warning due to free_raw_capacity()

Remove the __init annotation from free_raw_capacity() to avoid the following warning.

The function init_cpu_capacity_callback() references the function __init free_raw_capacity().
WARNING: vmlinux.o(.text+0x425cc0): Section mismatch in reference from the function init_cpu_capacity_callback() to the function .init.text:free_raw_capacity().

---
 drivers/base/arch_topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/arch_topology.c +1 -1
index 41be9ff..3da53cc 100644
@@ -96,7 +96,7 @@ static int register_cpu_capacity_sysctl(void)
 static u32 capacity_scale;
 static u32 *raw_capacity;
 
-static int __init free_raw_capacity(void)
+static int free_raw_capacity(void)
 {
 	kfree(raw_capacity);
 	raw_capacity = NULL;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Acked-by on v1 1/1
#1 lore raw
Quoted 19 lines · Prasad Sodagudi

Remove the __init annotation from free_raw_capacity() to avoid the following warning.

The function init_cpu_capacity_callback() references the function __init free_raw_capacity().
WARNING: vmlinux.o(.text+0x425cc0): Section mismatch in reference from the function init_cpu_capacity_callback() to the function .init.text:free_raw_capacity().

---
 drivers/base/arch_topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/arch_topology.c +0 -0
index 41be9ff..3da53cc 100644

drivers/base/arch_topology.c static int register_cpu_capacity_sysctl(void) · line 102

Quoted 8 lines
drivers/base/arch_topology.c +1 -1
@@ -96,7 +96,7 @@ static int register_cpu_capacity_sysctl(void)
 static u32 capacity_scale;
 static u32 *raw_capacity;
 
-static int __init free_raw_capacity(void)
+static int free_raw_capacity(void)
 {
 	kfree(raw_capacity);
 	raw_capacity = NULL;

So we need the __init thing only when cpufreq support isn't there in the kernel and I am not sure if we want to add more ifdef hackery in the declaration of free_raw_capacity().

Signature · 1 line
viresh
#2 lore raw
Quoted 33 lines · Viresh Kumar
Quoted 19 lines · Prasad Sodagudi

Remove the __init annotation from free_raw_capacity() to avoid the following warning.

The function init_cpu_capacity_callback() references the function __init free_raw_capacity().
WARNING: vmlinux.o(.text+0x425cc0): Section mismatch in reference from the function init_cpu_capacity_callback() to the function .init.text:free_raw_capacity().

---
 drivers/base/arch_topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/arch_topology.c +0 -0
index 41be9ff..3da53cc 100644

drivers/base/arch_topology.c static int register_cpu_capacity_sysctl(void) · line 102

Quoted 8 lines
drivers/base/arch_topology.c +1 -1
@@ -96,7 +96,7 @@ static int register_cpu_capacity_sysctl(void)
 static u32 capacity_scale;
 static u32 *raw_capacity;
 
-static int __init free_raw_capacity(void)
+static int free_raw_capacity(void)
 {
 	kfree(raw_capacity);
 	raw_capacity = NULL;

So we need the __init thing only when cpufreq support isn't there in the kernel and I am not sure if we want to add more ifdef hackery in the declaration of free_raw_capacity().

Quoted 1 line

Hi Greg,

Can you please consider this patch ?

-Thanks, Prasad

Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
Linux Foundation Collaborative Project
#3 lore raw

PATCH 1/1 arch_topology: Fix section miss match warning due to free_raw_capacity()

In reply to Viresh Kumar

Remove the __init annotation from free_raw_capacity() to avoid the following warning.

The function init_cpu_capacity_callback() references the function __init free_raw_capacity().
WARNING: vmlinux.o(.text+0x425cc0): Section mismatch in reference from the function init_cpu_capacity_callback() to the function .init.text:free_raw_capacity().

---
 drivers/base/arch_topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/arch_topology.c +1 -1
index 6df7d66..0ca4468 100644
@@ -96,7 +96,7 @@ static int register_cpu_capacity_sysctl(void)
 static u32 capacity_scale;
 static u32 *raw_capacity;
 
-static int __init free_raw_capacity(void)
+static int free_raw_capacity(void)
 {
 	kfree(raw_capacity);
 	raw_capacity = NULL;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project