diff options
author | Hendrik Brueckner | 2015-02-19 14:44:24 +0100 |
---|---|---|
committer | Martin Schwidefsky | 2015-07-22 09:58:02 +0200 |
commit | 7d0c502040a23a5924d3021651cf5326c8694a77 (patch) | |
tree | 3d4980cc3ebecd3f6281ece015ea427073641c7d /include/linux/cpufeature.h | |
parent | 9977e886cbbc758b4b601a160b5825ba573b5ca8 (diff) |
cpufeature: correctly annotate the module init function
A section mismatch warning is reported if an __init annotated function is
specified for module_cpu_feature_match().
Change the module_cpu_feature_match() function and annotate the generated
cpu_feature_match_* function as __init.
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'include/linux/cpufeature.h')
-rw-r--r-- | include/linux/cpufeature.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/cpufeature.h b/include/linux/cpufeature.h index c4d4eb8ac9fe..986c06c88d81 100644 --- a/include/linux/cpufeature.h +++ b/include/linux/cpufeature.h @@ -11,6 +11,7 @@ #ifdef CONFIG_GENERIC_CPU_AUTOPROBE +#include <linux/init.h> #include <linux/mod_devicetable.h> #include <asm/cpufeature.h> @@ -43,16 +44,16 @@ * For a list of legal values for 'feature', please consult the file * 'asm/cpufeature.h' of your favorite architecture. */ -#define module_cpu_feature_match(x, __init) \ +#define module_cpu_feature_match(x, __initfunc) \ static struct cpu_feature const cpu_feature_match_ ## x[] = \ { { .feature = cpu_feature(x) }, { } }; \ MODULE_DEVICE_TABLE(cpu, cpu_feature_match_ ## x); \ \ -static int cpu_feature_match_ ## x ## _init(void) \ +static int __init cpu_feature_match_ ## x ## _init(void) \ { \ if (!cpu_have_feature(cpu_feature(x))) \ return -ENODEV; \ - return __init(); \ + return __initfunc(); \ } \ module_init(cpu_feature_match_ ## x ## _init) |