Skip to content

Commit aff7795

Browse files
nefigtutmpe
authored andcommitted
powerpc: fix function annotations to avoid section mismatch warnings with gcc-10
Certain warnings are emitted for powerpc code when building with a gcc-10 toolset: WARNING: modpost: vmlinux.o(.text.unlikely+0x377c): Section mismatch in reference from the function remove_pmd_table() to the function .meminit.text:split_kernel_mapping() The function remove_pmd_table() references the function __meminit split_kernel_mapping(). This is often because remove_pmd_table lacks a __meminit annotation or the annotation of split_kernel_mapping is wrong. Add the appropriate __init and __meminit annotations to make modpost not complain. In all the cases there are just a single callsite from another __init or __meminit function: __meminit remove_pagetable() -> remove_pud_table() -> remove_pmd_table() __init prom_init() -> setup_secure_guest() __init xive_spapr_init() -> xive_spapr_disabled() Signed-off-by: Vladis Dronov <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 2e6bd22 commit aff7795

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

arch/powerpc/kernel/prom_init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3270,7 +3270,7 @@ static int enter_secure_mode(unsigned long kbase, unsigned long fdt)
32703270
/*
32713271
* Call the Ultravisor to transfer us to secure memory if we have an ESM blob.
32723272
*/
3273-
static void setup_secure_guest(unsigned long kbase, unsigned long fdt)
3273+
static void __init setup_secure_guest(unsigned long kbase, unsigned long fdt)
32743274
{
32753275
int ret;
32763276

@@ -3300,7 +3300,7 @@ static void setup_secure_guest(unsigned long kbase, unsigned long fdt)
33003300
}
33013301
}
33023302
#else
3303-
static void setup_secure_guest(unsigned long kbase, unsigned long fdt)
3303+
static void __init setup_secure_guest(unsigned long kbase, unsigned long fdt)
33043304
{
33053305
}
33063306
#endif /* CONFIG_PPC_SVM */

arch/powerpc/mm/book3s64/radix_pgtable.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ static void remove_pte_table(pte_t *pte_start, unsigned long addr,
823823
}
824824
}
825825

826-
static void remove_pmd_table(pmd_t *pmd_start, unsigned long addr,
826+
static void __meminit remove_pmd_table(pmd_t *pmd_start, unsigned long addr,
827827
unsigned long end)
828828
{
829829
unsigned long next;
@@ -853,7 +853,7 @@ static void remove_pmd_table(pmd_t *pmd_start, unsigned long addr,
853853
}
854854
}
855855

856-
static void remove_pud_table(pud_t *pud_start, unsigned long addr,
856+
static void __meminit remove_pud_table(pud_t *pud_start, unsigned long addr,
857857
unsigned long end)
858858
{
859859
unsigned long next;

arch/powerpc/sysdev/xive/spapr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ static const u8 *get_vec5_feature(unsigned int index)
768768
return vec5 + index;
769769
}
770770

771-
static bool xive_spapr_disabled(void)
771+
static bool __init xive_spapr_disabled(void)
772772
{
773773
const u8 *vec5_xive;
774774

0 commit comments

Comments
 (0)