Skip to content

Commit a2a58b5

Browse files
rddunlappalmer-dabbelt
authored andcommitted
RISC-V: fix sifive and thead section mismatches in errata
When CONFIG_MODULES is set, __init_or_module becomes <empty>, but when CONFIG_MODULES is not set, __init_or_module becomes __init. In the latter case, it causes section mismatch warnings: WARNING: modpost: vmlinux.o: section mismatch in reference: riscv_fill_cpu_mfr_info (section: .text) -> sifive_errata_patch_func (section: .init.text) WARNING: modpost: vmlinux.o: section mismatch in reference: riscv_fill_cpu_mfr_info (section: .text) -> thead_errata_patch_func (section: .init.text) Fixes: bb3f894 ("RISC-V: hwprobe: Remove __init on probe_vendor_features()") Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Reviewed-by: Evan Green <evan@rivosinc.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20230429155247.12131-1-rdunlap@infradead.org Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 41cad82 commit a2a58b5

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

arch/riscv/errata/sifive/errata.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,9 @@ static void __init_or_module warn_miss_errata(u32 miss_errata)
8282
pr_warn("----------------------------------------------------------------\n");
8383
}
8484

85-
void __init_or_module sifive_errata_patch_func(struct alt_entry *begin,
86-
struct alt_entry *end,
87-
unsigned long archid,
88-
unsigned long impid,
89-
unsigned int stage)
85+
void sifive_errata_patch_func(struct alt_entry *begin, struct alt_entry *end,
86+
unsigned long archid, unsigned long impid,
87+
unsigned int stage)
9088
{
9189
struct alt_entry *alt;
9290
u32 cpu_req_errata;

arch/riscv/errata/thead/errata.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ static u32 thead_errata_probe(unsigned int stage,
8383
return cpu_req_errata;
8484
}
8585

86-
void __init_or_module thead_errata_patch_func(struct alt_entry *begin, struct alt_entry *end,
87-
unsigned long archid, unsigned long impid,
88-
unsigned int stage)
86+
void thead_errata_patch_func(struct alt_entry *begin, struct alt_entry *end,
87+
unsigned long archid, unsigned long impid,
88+
unsigned int stage)
8989
{
9090
struct alt_entry *alt;
9191
u32 cpu_req_errata = thead_errata_probe(stage, archid, impid);

0 commit comments

Comments
 (0)