Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

LoongArch: Add acpi_get_cpu_uid() for unified ACPI CPU UID retrieval

As a step towards unifying the interface for retrieving ACPI CPU UID
across architectures, introduce a new function acpi_get_cpu_uid() for
loongarch. While at it, add input validation to make the code more
robust.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Link: https://patch.msgid.link/20260401081640.26875-3-fengchengwen@huawei.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Chengwen Feng and committed by
Rafael J. Wysocki
d78ef9d2 7cd5f565

+10
+1
arch/loongarch/include/asm/acpi.h
··· 44 44 { 45 45 return acpi_core_pic[cpu_logical_map(cpu)].processor_id; 46 46 } 47 + int acpi_get_cpu_uid(unsigned int cpu, u32 *uid); 47 48 48 49 #endif /* !CONFIG_ACPI */ 49 50
+9
arch/loongarch/kernel/acpi.c
··· 385 385 EXPORT_SYMBOL(acpi_unmap_cpu); 386 386 387 387 #endif /* CONFIG_ACPI_HOTPLUG_CPU */ 388 + 389 + int acpi_get_cpu_uid(unsigned int cpu, u32 *uid) 390 + { 391 + if (cpu >= nr_cpu_ids) 392 + return -EINVAL; 393 + *uid = acpi_core_pic[cpu_logical_map(cpu)].processor_id; 394 + return 0; 395 + } 396 + EXPORT_SYMBOL_GPL(acpi_get_cpu_uid);