diff options
Diffstat (limited to 'arch/arm64/kernel/cpu_ops.c')
-rw-r--r-- | arch/arm64/kernel/cpu_ops.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/arch/arm64/kernel/cpu_ops.c b/arch/arm64/kernel/cpu_ops.c index b6bd7d447768..3c63506b6437 100644 --- a/arch/arm64/kernel/cpu_ops.c +++ b/arch/arm64/kernel/cpu_ops.c @@ -35,16 +35,18 @@ static const struct cpu_operations *supported_cpu_ops[] __initconst = { NULL, }; +extern struct cpu_operations __cpu_method_of_table[]; +static const struct cpu_operations *__cpu_method_of_table_sentinel + __used __section(__cpu_method_of_table_end); + static const struct cpu_operations * __init cpu_get_ops(const char *name) { - const struct cpu_operations **ops = supported_cpu_ops; - - while (*ops) { - if (!strcmp(name, (*ops)->name)) - return *ops; + const struct cpu_operations **start = (void *)__cpu_method_of_table; - ops++; - } + for (; *start; start++) { + if (!strcmp((*start)->name, name)) + return *start; + }; return NULL; } |