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] [day] [month] [year] [list]
Message-ID: <20250708093851.000030e3@huawei.com>
Date: Tue, 8 Jul 2025 09:38:51 +0100
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: Alireza Sanaee <alireza.sanaee@...wei.com>
CC: <mark.rutland@....com>, <robh@...nel.org>, <coresight@...ts.linaro.org>,
	<devicetree@...r.kernel.org>, <dianders@...omium.org>,
	<james.clark@...aro.org>, <krzk@...nel.org>,
	<linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
	<linux-perf-users@...r.kernel.org>, <linuxarm@...wei.com>,
	<mike.leach@...aro.org>, <ruanjinjie@...wei.com>, <saravanak@...gle.com>,
	<shameerali.kolothum.thodi@...wei.com>, <suzuki.poulose@....com>
Subject: Re: [PATCH 5/5] perf/arm-dsu: refactor cpu id retrieval via new API
 of_cpu_phandle_to_id

On Mon, 7 Jul 2025 16:04:14 +0100
Alireza Sanaee <alireza.sanaee@...wei.com> wrote:

> Update arm-dsu to use the new API, where both "cpus" and "cpu"
> properties are supported.
> 
> Signed-off-by: Alireza Sanaee <alireza.sanaee@...wei.com>
> ---
>  drivers/perf/arm_dsu_pmu.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/perf/arm_dsu_pmu.c b/drivers/perf/arm_dsu_pmu.c
> index cb4fb59fe04b..7ef204d39173 100644
> --- a/drivers/perf/arm_dsu_pmu.c
> +++ b/drivers/perf/arm_dsu_pmu.c
> @@ -596,11 +596,9 @@ static int dsu_pmu_dt_get_cpus(struct device *dev, cpumask_t *mask)
>  	n = of_count_phandle_with_args(dev->of_node, "cpus", NULL);
>  	if (n <= 0)
>  		return -ENODEV;
> +
>  	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);
> +		cpu = of_cpu_phandle_to_id(dev->of_node, &cpu_node, i);
Same again. 
Does any code actually use the cpu_node?

If not you need a strong justification for ever letting it out of the new
helper.
>  		of_node_put(cpu_node);
>  		/*
>  		 * We have to ignore the failures here and continue scanning


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ