lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250711103657.0000059c@huawei.com>
Date: Fri, 11 Jul 2025 10:36:57 +0100
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: Alireza Sanaee <alireza.sanaee@...wei.com>
CC: <krzk@...nel.org>, <robh@...nel.org>, <coresight@...ts.linaro.org>,
	<devicetree@...r.kernel.org>, <dianders@...omium.org>,
	<james.clark@...aro.org>, <linux-arm-kernel@...ts.infradead.org>,
	<linux-kernel@...r.kernel.org>, <linux-perf-users@...r.kernel.org>,
	<linuxarm@...wei.com>, <mark.rutland@....com>, <mike.leach@...aro.org>,
	<ruanjinjie@...wei.com>, <saravanak@...gle.com>,
	<shameerali.kolothum.thodi@...wei.com>
Subject: Re: [PATCH v2 5/5] perf/arm-dsu: refactor cpu id retrieval via new
 API of_cpu_phandle_to_id

On Tue, 8 Jul 2025 16:15:02 +0100
Alireza Sanaee <alireza.sanaee@...wei.com> wrote:

> Update arm-dsu to use the new API, where both "cpus" and "cpu"
> properties are supported.

I'd gloss over that and just not mention support of "cpu" as
it never applies here and we just queried the number of phandles
for cpus a few lines up.

> 
> Signed-off-by: Alireza Sanaee <alireza.sanaee@...wei.com>
> ---
>  drivers/perf/arm_dsu_pmu.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/perf/arm_dsu_pmu.c b/drivers/perf/arm_dsu_pmu.c
> index cb4fb59fe04b..1014b92c0fd2 100644
> --- a/drivers/perf/arm_dsu_pmu.c
> +++ b/drivers/perf/arm_dsu_pmu.c
> @@ -591,17 +591,13 @@ 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 = 0, n, cpu;
> -	struct device_node *cpu_node;
>  
>  	n = of_count_phandle_with_args(dev->of_node, "cpus", NULL);
>  	if (n <= 0)
>  		return -ENODEV;
> +
Stray change - it's a valid one for readability but not in this patch.

>  	for (; i < n; i++) {
> -		cpu_node = of_parse_phandle(dev->of_node, "cpus", i);
> -		if (!cpu_node)
> -			break;
> -		cpu = of_cpu_node_to_id(cpu_node);
> -		of_node_put(cpu_node);
> +		cpu = 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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ