iucode_tool: move scan_system_processor() one layer down

scan_system_processor() should be able to fill in any filter list,
so give it the filter list it should modify as a parameter, moving
the hardcoding of the use of uc_filter_list to its caller.
parent 75eb1d8e
......@@ -2756,12 +2756,14 @@ static int check_cpuid_devs(uint32_t sig, struct microcode_filter_entry ** const
}
#endif
static int scan_system_processors(void)
static int scan_system_processors(struct microcode_filter_entry ** const filter_list)
{
uint32_t id0, id1, id2, id3, sig, idx;
struct microcode_filter_entry *uc_cpu = NULL;
int rc = 0;
assert(filter_list);
print_msg(3, "trying to get CPUID information directly");
if (!(__get_cpuid(0, &id0, &id1, &id2, &id3) &&
__get_cpuid(1, &sig, &idx, &idx, &idx))) {
......@@ -2797,7 +2799,7 @@ static int scan_system_processors(void)
if (uc_cpu) {
/* tie linked lists */
add_filter_list_to_list(&uc_filter_list, uc_cpu);
add_filter_list_to_list(filter_list, uc_cpu);
uc_cpu = NULL;
}
......@@ -2838,7 +2840,7 @@ static int process_ucode_filter_queue(void)
if (rc == EEXIST)
rc = 0;
} else {
rc = scan_system_processors();
rc = scan_system_processors(&uc_filter_list);
}
p = p->next;
......
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