Skip to content

Commit

Permalink
perf: arm_cspmu: use acpi_dev_hid_uid_match() for matching _HID and _UID
Browse files Browse the repository at this point in the history
Convert manual _UID references to use the standard ACPI helpers.

Signed-off-by: Raag Jadav <[email protected]>
Reviewed-by: Mika Westerberg <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
raagjadav authored and rafaeljw committed Oct 25, 2023
1 parent 45f5671 commit 6fdba3d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/perf/arm_cspmu/arm_cspmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ static int arm_cspmu_request_irq(struct arm_cspmu *cspmu)

static inline int arm_cspmu_find_cpu_container(int cpu, u32 container_uid)
{
u32 acpi_uid;
u64 acpi_uid;
struct device *cpu_dev;
struct acpi_device *acpi_dev;

Expand All @@ -1071,10 +1071,8 @@ static inline int arm_cspmu_find_cpu_container(int cpu, u32 container_uid)

acpi_dev = ACPI_COMPANION(cpu_dev);
while (acpi_dev) {
if (!strcmp(acpi_device_hid(acpi_dev),
ACPI_PROCESSOR_CONTAINER_HID) &&
!kstrtouint(acpi_device_uid(acpi_dev), 0, &acpi_uid) &&
acpi_uid == container_uid)
if (acpi_dev_hid_uid_match(acpi_dev, ACPI_PROCESSOR_CONTAINER_HID, NULL) &&
!acpi_dev_uid_to_integer(acpi_dev, &acpi_uid) && acpi_uid == container_uid)
return 0;

acpi_dev = acpi_dev_parent(acpi_dev);
Expand Down

0 comments on commit 6fdba3d

Please sign in to comment.