From nobody Wed Sep 10 11:02:36 2025 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6E2B30B536; Fri, 5 Sep 2025 16:21:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757089321; cv=none; b=OSZdbkAMolI+9hfxOa2GCR01uppxF3d4LK1YHU3lL1Bf80ISPaaE7tsI2o16Nd7kye/SYR+8gG5VmQb2soLvjpSsXGzOcoDmszE+gL1AqTRxDMHycxA92Kdmy1AD9D4EQV0kAQuaaszRwqQ2D2goY5xav1nNEU2wZ+v+YfsJm8A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757089321; c=relaxed/simple; bh=/d9BRwNVCUpXdCDeP2my7gaYCf/Bu+JCn8u7cOrc+Sk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mHxC5W7E/UIfJjY0WU79AwVjlzVq0gxbmJ6O+zmYe3uXTi0Fkq4JrC+5FFmK8rj/mR2KA55sy/Qvieet2xQ2ytj4zMpf4+ICemEbzNTSG8jGXzWSacksqqgVguLbRCz9MRlOJ/dkRRG7ZPeZSvZPxW6BgctikGZM9Pc/R8XS2tI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4cJM4G4DCGz6M54Q; Sat, 6 Sep 2025 00:19:26 +0800 (CST) Received: from frapeml500003.china.huawei.com (unknown [7.182.85.28]) by mail.maildlp.com (Postfix) with ESMTPS id 08DC8140114; Sat, 6 Sep 2025 00:21:58 +0800 (CST) Received: from a2303103017.china.huawei.com (10.202.66.105) by frapeml500003.china.huawei.com (7.182.85.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Fri, 5 Sep 2025 18:21:55 +0200 From: Alireza Sanaee To: , CC: , , , , , , , , , , , , , Subject: [PATCH v4 6/6] perf/arm-dsu: refactor cpu id retrieval via new API of_cpu_phandle_to_id Date: Fri, 5 Sep 2025 17:18:29 +0100 Message-ID: <20250905161830.37-7-alireza.sanaee@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250905161830.37-1-alireza.sanaee@huawei.com> References: <20250905161830.37-1-alireza.sanaee@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: lhrpeml100005.china.huawei.com (7.191.160.25) To frapeml500003.china.huawei.com (7.182.85.28) Content-Type: text/plain; charset="utf-8" Update arm-dsu to use the new API (of_cpu_phandle_to_id). Reviewed-by: Jonathan Cameron Signed-off-by: Alireza Sanaee --- drivers/perf/arm_dsu_pmu.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/perf/arm_dsu_pmu.c b/drivers/perf/arm_dsu_pmu.c index cb4fb59fe04b..8f76bd94349c 100644 --- a/drivers/perf/arm_dsu_pmu.c +++ b/drivers/perf/arm_dsu_pmu.c @@ -591,17 +591,12 @@ static struct dsu_pmu *dsu_pmu_alloc(struct platform_= device *pdev) static int dsu_pmu_dt_get_cpus(struct device *dev, cpumask_t *mask) { int i =3D 0, n, cpu; - struct device_node *cpu_node; =20 n =3D of_count_phandle_with_args(dev->of_node, "cpus", NULL); if (n <=3D 0) return -ENODEV; for (; i < n; i++) { - cpu_node =3D of_parse_phandle(dev->of_node, "cpus", i); - if (!cpu_node) - break; - cpu =3D of_cpu_node_to_id(cpu_node); - of_node_put(cpu_node); + cpu =3D of_cpu_phandle_to_id(dev->of_node, NULL, i); /* * We have to ignore the failures here and continue scanning * the list to handle cases where the nr_cpus could be capped --=20 2.43.0