Skip to content

Commit fa4d566

Browse files
pierregondoissudeep-holla
authored andcommitted
ACPI: PPTT: Remove acpi_find_cache_levels()
acpi_find_cache_levels() is used at a single place and is short enough to be merged into the calling function. The removal allows an easier renaming of the calling function in the next patch. Also reorder the local variables in the 'reversed Christmas tree' order. Signed-off-by: Pierre Gondois <[email protected]> Reviewed-by: Jeremy Linton <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Acked-by: Palmer Dabbelt <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sudeep Holla <[email protected]>
1 parent de0df44 commit fa4d566

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

drivers/acpi/pptt.c

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -281,19 +281,6 @@ static struct acpi_pptt_processor *acpi_find_processor_node(struct acpi_table_he
281281
return NULL;
282282
}
283283

284-
static int acpi_find_cache_levels(struct acpi_table_header *table_hdr,
285-
u32 acpi_cpu_id)
286-
{
287-
int number_of_levels = 0;
288-
struct acpi_pptt_processor *cpu;
289-
290-
cpu = acpi_find_processor_node(table_hdr, acpi_cpu_id);
291-
if (cpu)
292-
number_of_levels = acpi_count_levels(table_hdr, cpu);
293-
294-
return number_of_levels;
295-
}
296-
297284
static u8 acpi_cache_type(enum cache_type type)
298285
{
299286
switch (type) {
@@ -613,9 +600,10 @@ static int check_acpi_cpu_flag(unsigned int cpu, int rev, u32 flag)
613600
*/
614601
int acpi_find_last_cache_level(unsigned int cpu)
615602
{
616-
u32 acpi_cpu_id;
603+
struct acpi_pptt_processor *cpu_node;
617604
struct acpi_table_header *table;
618605
int number_of_levels = 0;
606+
u32 acpi_cpu_id;
619607

620608
table = acpi_get_pptt();
621609
if (!table)
@@ -624,7 +612,10 @@ int acpi_find_last_cache_level(unsigned int cpu)
624612
pr_debug("Cache Setup find last level CPU=%d\n", cpu);
625613

626614
acpi_cpu_id = get_acpi_id_for_cpu(cpu);
627-
number_of_levels = acpi_find_cache_levels(table, acpi_cpu_id);
615+
cpu_node = acpi_find_processor_node(table, acpi_cpu_id);
616+
if (cpu_node)
617+
number_of_levels = acpi_count_levels(table, cpu_node);
618+
628619
pr_debug("Cache Setup find last level level=%d\n", number_of_levels);
629620

630621
return number_of_levels;

0 commit comments

Comments
 (0)