mm: fix section mismatch warnings

modpost had two cases hardcoded for mm/
Shift over to __init_refok and kill the
hardcoded function names in modpost.

This has the drawback that the functions
will always be kept no matter configuration.
With previous code the function were placed in
init section if configuration allowed it.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

+3 -22
+2 -2
mm/page_alloc.c
··· 2165 2166 #endif 2167 2168 - static __meminit noinline 2169 int zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages) 2170 { 2171 int i; ··· 2678 } 2679 } 2680 2681 - static void __meminit alloc_node_mem_map(struct pglist_data *pgdat) 2682 { 2683 /* Skip empty nodes */ 2684 if (!pgdat->node_spanned_pages)
··· 2165 2166 #endif 2167 2168 + static noinline __init_refok 2169 int zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages) 2170 { 2171 int i; ··· 2678 } 2679 } 2680 2681 + static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat) 2682 { 2683 /* Skip empty nodes */ 2684 if (!pgdat->node_spanned_pages)
+1 -1
mm/sparse.c
··· 44 #endif 45 46 #ifdef CONFIG_SPARSEMEM_EXTREME 47 - static struct mem_section noinline *sparse_index_alloc(int nid) 48 { 49 struct mem_section *section = NULL; 50 unsigned long array_size = SECTIONS_PER_ROOT *
··· 44 #endif 45 46 #ifdef CONFIG_SPARSEMEM_EXTREME 47 + static struct mem_section noinline __init_refok *sparse_index_alloc(int nid) 48 { 49 struct mem_section *section = NULL; 50 unsigned long array_size = SECTIONS_PER_ROOT *
-19
scripts/mod/modpost.c
··· 641 * tosec = .init.text 642 * fromsec = .paravirtprobe 643 * 644 - * Pattern 9: 645 - * Some of functions are common code between boot time and hotplug 646 - * time. The bootmem allocater is called only boot time in its 647 - * functions. So it's ok to reference. 648 - * tosec = .init.text 649 - * 650 * Pattern 10: 651 * ia64 has machvec table for each platform and 652 * powerpc has a machine desc table for each platform. ··· 669 "__init_begin", 670 "_sinittext", 671 "_einittext", 672 - NULL 673 - }; 674 - 675 - const char *pat4sym[] = { 676 - "sparse_index_alloc", 677 - "zone_wait_table_init", 678 NULL 679 }; 680 ··· 728 if ((strcmp(tosec, ".init.text") == 0) && 729 (strcmp(fromsec, ".paravirtprobe") == 0)) 730 return 1; 731 - 732 - /* Check for pattern 9 */ 733 - if ((strcmp(tosec, ".init.text") == 0) && 734 - (strcmp(fromsec, ".text") == 0)) 735 - for (s = pat4sym; *s; s++) 736 - if (strcmp(atsym, *s) == 0) 737 - return 1; 738 739 /* Check for pattern 10 */ 740 if ((strcmp(fromsec, ".machvec") == 0) ||
··· 641 * tosec = .init.text 642 * fromsec = .paravirtprobe 643 * 644 * Pattern 10: 645 * ia64 has machvec table for each platform and 646 * powerpc has a machine desc table for each platform. ··· 675 "__init_begin", 676 "_sinittext", 677 "_einittext", 678 NULL 679 }; 680 ··· 740 if ((strcmp(tosec, ".init.text") == 0) && 741 (strcmp(fromsec, ".paravirtprobe") == 0)) 742 return 1; 743 744 /* Check for pattern 10 */ 745 if ((strcmp(fromsec, ".machvec") == 0) ||