Commit b684001a authored by Heiko Stuebner's avatar Heiko Stuebner Committed by Palmer Dabbelt

riscv: make patch-function pointer more generic in cpu_manufacturer_info struct

During review the naming of the function-pointer was called
confusing as the vendor id is just one of three inputs for
the patching and indeed it serves no real purpose, as with
recent changes the function pointer is not a static
global element anymore, so drop the "vendor_" prefix.
Suggested-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20220526205646.258337-4-heiko@sntech.deSigned-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent 924cbb8c
...@@ -20,7 +20,7 @@ struct cpu_manufacturer_info_t { ...@@ -20,7 +20,7 @@ struct cpu_manufacturer_info_t {
unsigned long vendor_id; unsigned long vendor_id;
unsigned long arch_id; unsigned long arch_id;
unsigned long imp_id; unsigned long imp_id;
void (*vendor_patch_func)(struct alt_entry *begin, struct alt_entry *end, void (*patch_func)(struct alt_entry *begin, struct alt_entry *end,
unsigned long archid, unsigned long impid, unsigned long archid, unsigned long impid,
unsigned int stage); unsigned int stage);
}; };
...@@ -40,16 +40,16 @@ static void __init_or_module riscv_fill_cpu_mfr_info(struct cpu_manufacturer_inf ...@@ -40,16 +40,16 @@ static void __init_or_module riscv_fill_cpu_mfr_info(struct cpu_manufacturer_inf
switch (cpu_mfr_info->vendor_id) { switch (cpu_mfr_info->vendor_id) {
#ifdef CONFIG_ERRATA_SIFIVE #ifdef CONFIG_ERRATA_SIFIVE
case SIFIVE_VENDOR_ID: case SIFIVE_VENDOR_ID:
cpu_mfr_info->vendor_patch_func = sifive_errata_patch_func; cpu_mfr_info->patch_func = sifive_errata_patch_func;
break; break;
#endif #endif
#ifdef CONFIG_ERRATA_THEAD #ifdef CONFIG_ERRATA_THEAD
case THEAD_VENDOR_ID: case THEAD_VENDOR_ID:
cpu_mfr_info->vendor_patch_func = thead_errata_patch_func; cpu_mfr_info->patch_func = thead_errata_patch_func;
break; break;
#endif #endif
default: default:
cpu_mfr_info->vendor_patch_func = NULL; cpu_mfr_info->patch_func = NULL;
} }
} }
...@@ -68,10 +68,10 @@ static void __init_or_module _apply_alternatives(struct alt_entry *begin, ...@@ -68,10 +68,10 @@ static void __init_or_module _apply_alternatives(struct alt_entry *begin,
riscv_cpufeature_patch_func(begin, end, stage); riscv_cpufeature_patch_func(begin, end, stage);
if (!cpu_mfr_info.vendor_patch_func) if (!cpu_mfr_info.patch_func)
return; return;
cpu_mfr_info.vendor_patch_func(begin, end, cpu_mfr_info.patch_func(begin, end,
cpu_mfr_info.arch_id, cpu_mfr_info.arch_id,
cpu_mfr_info.imp_id, cpu_mfr_info.imp_id,
stage); stage);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment