Skip to content

Commit b684001

Browse files
mmindpalmer-dabbelt
authored andcommitted
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: Christoph Hellwig <[email protected]> Signed-off-by: Heiko Stuebner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 924cbb8 commit b684001

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

arch/riscv/kernel/alternative.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct cpu_manufacturer_info_t {
2020
unsigned long vendor_id;
2121
unsigned long arch_id;
2222
unsigned long imp_id;
23-
void (*vendor_patch_func)(struct alt_entry *begin, struct alt_entry *end,
23+
void (*patch_func)(struct alt_entry *begin, struct alt_entry *end,
2424
unsigned long archid, unsigned long impid,
2525
unsigned int stage);
2626
};
@@ -40,16 +40,16 @@ static void __init_or_module riscv_fill_cpu_mfr_info(struct cpu_manufacturer_inf
4040
switch (cpu_mfr_info->vendor_id) {
4141
#ifdef CONFIG_ERRATA_SIFIVE
4242
case SIFIVE_VENDOR_ID:
43-
cpu_mfr_info->vendor_patch_func = sifive_errata_patch_func;
43+
cpu_mfr_info->patch_func = sifive_errata_patch_func;
4444
break;
4545
#endif
4646
#ifdef CONFIG_ERRATA_THEAD
4747
case THEAD_VENDOR_ID:
48-
cpu_mfr_info->vendor_patch_func = thead_errata_patch_func;
48+
cpu_mfr_info->patch_func = thead_errata_patch_func;
4949
break;
5050
#endif
5151
default:
52-
cpu_mfr_info->vendor_patch_func = NULL;
52+
cpu_mfr_info->patch_func = NULL;
5353
}
5454
}
5555

@@ -68,13 +68,13 @@ static void __init_or_module _apply_alternatives(struct alt_entry *begin,
6868

6969
riscv_cpufeature_patch_func(begin, end, stage);
7070

71-
if (!cpu_mfr_info.vendor_patch_func)
71+
if (!cpu_mfr_info.patch_func)
7272
return;
7373

74-
cpu_mfr_info.vendor_patch_func(begin, end,
75-
cpu_mfr_info.arch_id,
76-
cpu_mfr_info.imp_id,
77-
stage);
74+
cpu_mfr_info.patch_func(begin, end,
75+
cpu_mfr_info.arch_id,
76+
cpu_mfr_info.imp_id,
77+
stage);
7878
}
7979

8080
void __init apply_boot_alternatives(void)

0 commit comments

Comments
 (0)