Skip to content

Commit

Permalink
base: arch_topology: fix section mismatch build warnings
Browse files Browse the repository at this point in the history
commit 452562a upstream.

Commit 2ef7a29 ("arm, arm64: factorize common cpu capacity default code")
introduced init_cpu_capacity_callback and init_cpu_capacity_notifier
which are referenced from initcall and are missing __init{,data}
annotations resulting the below section mismatch build warnings.

"WARNING: vmlinux.o(.text+0xbab790): Section mismatch in reference from
the function init_cpu_capacity_callback() to the variable .init.text:$x
The function init_cpu_capacity_callback() references the variable
__init $x. This is often because init_cpu_capacity_callback lacks a
__init annotation or the annotation of $x is wrong."

This patch fixes the above build warnings by adding the required annotations.

Fixes: 2ef7a29 ("arm, arm64: factorize common cpu capacity default code")
Cc: Juri Lelli <juri.lelli@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Sudeep Holla authored and Greg Kroah-Hartman committed Oct 12, 2017
1 parent 0d3476c commit 7fb25f6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/base/arch_topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ int __init topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu)
}

#ifdef CONFIG_CPU_FREQ
static cpumask_var_t cpus_to_visit;
static bool cap_parsing_done;
static void parsing_done_workfn(struct work_struct *work);
static DECLARE_WORK(parsing_done_work, parsing_done_workfn);
static bool cap_parsing_done __initdata;
static cpumask_var_t cpus_to_visit __initdata;
static void __init parsing_done_workfn(struct work_struct *work);
static __initdata DECLARE_WORK(parsing_done_work, parsing_done_workfn);

static int
static int __init
init_cpu_capacity_callback(struct notifier_block *nb,
unsigned long val,
void *data)
Expand Down Expand Up @@ -200,7 +200,7 @@ init_cpu_capacity_callback(struct notifier_block *nb,
return 0;
}

static struct notifier_block init_cpu_capacity_notifier = {
static struct notifier_block init_cpu_capacity_notifier __initdata = {
.notifier_call = init_cpu_capacity_callback,
};

Expand All @@ -226,7 +226,7 @@ static int __init register_cpufreq_notifier(void)
}
core_initcall(register_cpufreq_notifier);

static void parsing_done_workfn(struct work_struct *work)
static void __init parsing_done_workfn(struct work_struct *work)
{
cpufreq_unregister_notifier(&init_cpu_capacity_notifier,
CPUFREQ_POLICY_NOTIFIER);
Expand Down

0 comments on commit 7fb25f6

Please sign in to comment.