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: <20250711103044.000024f0@huawei.com>
Date: Fri, 11 Jul 2025 10:30:44 +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 4/5] coresight: Use of_cpu_phandle_to_id for grabbing
 CPU id

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

> Use the newly created API to grab CPU id.
> 
> Signed-off-by: Alireza Sanaee <alireza.sanaee@...wei.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@...wei.com>

We could just squash this to the call site, however it is in
an if / else if with the much larger acpi equivalent call so
probably worth keeping this trivial helper.
> ---
>  drivers/hwtracing/coresight/coresight-platform.c | 15 +--------------
>  1 file changed, 1 insertion(+), 14 deletions(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c
> index 0db64c5f4995..95d46ea08936 100644
> --- a/drivers/hwtracing/coresight/coresight-platform.c
> +++ b/drivers/hwtracing/coresight/coresight-platform.c
> @@ -167,20 +167,7 @@ of_coresight_get_output_ports_node(const struct device_node *node)
>  
>  static int of_coresight_get_cpu(struct device *dev)
>  {
> -	int cpu;
> -	struct device_node *dn;
> -
> -	if (!dev->of_node)
> -		return -ENODEV;
> -
> -	dn = of_parse_phandle(dev->of_node, "cpu", 0);
> -	if (!dn)
> -		return -ENODEV;
> -
> -	cpu = of_cpu_node_to_id(dn);
> -	of_node_put(dn);
> -
> -	return cpu;
> +	return of_cpu_phandle_to_id(dev->of_node, NULL, 0);
>  }
>  
>  /*


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ