aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sfi/sfi_core.c
diff options
context:
space:
mode:
authorRakib Mullick <rakib.mullick@gmail.com>2009-09-30 19:09:55 -0400
committerLen Brown <len.brown@intel.com>2009-10-03 01:03:11 -0400
commit01674da6f587a3f3940eedf2c1e97d51c35b994e (patch)
treee156ae962ad4a42fea016896d77b0af277f51a01 /drivers/sfi/sfi_core.c
parent0efe5e32c8729ef44b00d9a7203e4c99a6378b27 (diff)
SFI: fix section mismatch warnings in sfi_core.c
The function sfi_map_memory/sfi_unmap_memory uses early_ioremap/early_iounmap respectively, which refers to a __init function. And function sfi_check_table also refers to a __init function sfi_verify_table. Since the references are valid, so use __ref to get rid of the warnings. We were warned by the following warnings: LD vmlinux.o MODPOST vmlinux.o WARNING: vmlinux.o(.text+0xb6ba3a): Section mismatch in reference from the function sfi_map_memory() to the function .init.text:early_ioremap() The function sfi_map_memory() references the function __init early_ioremap(). This is often because sfi_map_memory lacks a __init annotation or the annotation of early_ioremap is wrong. WARNING: vmlinux.o(.text+0xb6bab6): Section mismatch in reference from the function sfi_unmap_memory() to the function .init.text:early_iounmap() The function sfi_unmap_memory() references the function __init early_iounmap(). This is often because sfi_unmap_memory lacks a __init annotation or the annotation of early_iounmap is wrong. WARNING: vmlinux.o(.text+0xb6be30): Section mismatch in reference from the function sfi_check_table() to the function .init.text:sfi_verify_table() The function sfi_check_table() references the function __init sfi_verify_table(). This is often because sfi_check_table lacks a __init annotation or the annotation of sfi_verify_table is wrong. Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/sfi/sfi_core.c')
-rw-r--r--drivers/sfi/sfi_core.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/sfi/sfi_core.c b/drivers/sfi/sfi_core.c
index d3b49680047..251da2298b6 100644
--- a/drivers/sfi/sfi_core.c
+++ b/drivers/sfi/sfi_core.c
@@ -90,7 +90,11 @@ static struct sfi_table_simple *syst_va __read_mostly;
90 */ 90 */
91static u32 sfi_use_ioremap __read_mostly; 91static u32 sfi_use_ioremap __read_mostly;
92 92
93static void __iomem *sfi_map_memory(u64 phys, u32 size) 93/*
94 * sfi_un/map_memory calls early_ioremap/iounmap which is a __init function
95 * and introduces section mismatch. So use __ref to make it calm.
96 */
97static void __iomem * __ref sfi_map_memory(u64 phys, u32 size)
94{ 98{
95 if (!phys || !size) 99 if (!phys || !size)
96 return NULL; 100 return NULL;
@@ -101,7 +105,7 @@ static void __iomem *sfi_map_memory(u64 phys, u32 size)
101 return early_ioremap(phys, size); 105 return early_ioremap(phys, size);
102} 106}
103 107
104static void sfi_unmap_memory(void __iomem *virt, u32 size) 108static void __ref sfi_unmap_memory(void __iomem *virt, u32 size)
105{ 109{
106 if (!virt || !size) 110 if (!virt || !size)
107 return; 111 return;
@@ -213,12 +217,17 @@ static int sfi_table_check_key(struct sfi_table_header *th,
213 * the mapped virt address will be returned, and the virt space 217 * the mapped virt address will be returned, and the virt space
214 * will be released by call sfi_put_table() later 218 * will be released by call sfi_put_table() later
215 * 219 *
220 * This two cases are from two different functions with two different
221 * sections and causes section mismatch warning. So use __ref to tell
222 * modpost not to make any noise.
223 *
216 * Return value: 224 * Return value:
217 * NULL: when can't find a table matching the key 225 * NULL: when can't find a table matching the key
218 * ERR_PTR(error): error value 226 * ERR_PTR(error): error value
219 * virt table address: when a matched table is found 227 * virt table address: when a matched table is found
220 */ 228 */
221struct sfi_table_header *sfi_check_table(u64 pa, struct sfi_table_key *key) 229struct sfi_table_header *
230 __ref sfi_check_table(u64 pa, struct sfi_table_key *key)
222{ 231{
223 struct sfi_table_header *th; 232 struct sfi_table_header *th;
224 void *ret = NULL; 233 void *ret = NULL;