Skip to content

Commit

Permalink
powerpc: fix function annotations to avoid section mismatch warnings …
Browse files Browse the repository at this point in the history
…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 <vdronov@redhat.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200729133741.62789-1-vdronov@redhat.com
  • Loading branch information
Vladis Dronov authored and Michael Ellerman committed Jul 30, 2020
1 parent 2e6bd22 commit aff7795
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions arch/powerpc/kernel/prom_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -3270,7 +3270,7 @@ static int enter_secure_mode(unsigned long kbase, unsigned long fdt)
/*
* Call the Ultravisor to transfer us to secure memory if we have an ESM blob.
*/
static void setup_secure_guest(unsigned long kbase, unsigned long fdt)
static void __init setup_secure_guest(unsigned long kbase, unsigned long fdt)
{
int ret;

Expand Down Expand Up @@ -3300,7 +3300,7 @@ static void setup_secure_guest(unsigned long kbase, unsigned long fdt)
}
}
#else
static void setup_secure_guest(unsigned long kbase, unsigned long fdt)
static void __init setup_secure_guest(unsigned long kbase, unsigned long fdt)
{
}
#endif /* CONFIG_PPC_SVM */
Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/mm/book3s64/radix_pgtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ static void remove_pte_table(pte_t *pte_start, unsigned long addr,
}
}

static void remove_pmd_table(pmd_t *pmd_start, unsigned long addr,
static void __meminit remove_pmd_table(pmd_t *pmd_start, unsigned long addr,
unsigned long end)
{
unsigned long next;
Expand Down Expand Up @@ -853,7 +853,7 @@ static void remove_pmd_table(pmd_t *pmd_start, unsigned long addr,
}
}

static void remove_pud_table(pud_t *pud_start, unsigned long addr,
static void __meminit remove_pud_table(pud_t *pud_start, unsigned long addr,
unsigned long end)
{
unsigned long next;
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/sysdev/xive/spapr.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ static const u8 *get_vec5_feature(unsigned int index)
return vec5 + index;
}

static bool xive_spapr_disabled(void)
static bool __init xive_spapr_disabled(void)
{
const u8 *vec5_xive;

Expand Down

0 comments on commit aff7795

Please sign in to comment.