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]
Date:   Tue, 17 Oct 2017 16:26:18 +0100
From:   Mark Rutland <mark.rutland@....com>
To:     Suzuki K Poulose <suzuki.poulose@....com>
Cc:     linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        robh@...nel.org, will.deacon@....com, sudeep.holla@....com,
        frowand.list@...il.com, devicetree@...r.kernel.org,
        Jonathan.Cameron@...wei.com, marc.zyngier@....com,
        peterz@...radead.org, mathieu.poirier@...aro.org,
        leo.yan@...aro.org
Subject: Re: [PATCH v8 6/8] arm_pmu: Use of_cpu_node_to_id helper

On Tue, Oct 10, 2017 at 11:33:01AM +0100, Suzuki K Poulose wrote:
> Use the new generic helper, of_cpu_node_to_id(), to map a
> a phandle to the logical CPU number while parsing the
> PMU irq affinity.
> 
> Cc: Mark Rutland <mark.rutland@....com>
> Cc: Will Deacon <will.deacon@....com>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@....com>

Acked-by: Mark Rutland <mark.rutland@....com>

Thanks,
Mark.

> ---
>  drivers/perf/arm_pmu_platform.c | 15 +++------------
>  1 file changed, 3 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/perf/arm_pmu_platform.c b/drivers/perf/arm_pmu_platform.c
> index 4eafa7a42e52..a96884e37eaf 100644
> --- a/drivers/perf/arm_pmu_platform.c
> +++ b/drivers/perf/arm_pmu_platform.c
> @@ -81,19 +81,10 @@ static int pmu_parse_irq_affinity(struct device_node *node, int i)
>  		return -EINVAL;
>  	}
>  
> -	/* Now look up the logical CPU number */
> -	for_each_possible_cpu(cpu) {
> -		struct device_node *cpu_dn;
> -
> -		cpu_dn = of_cpu_device_node_get(cpu);
> -		of_node_put(cpu_dn);
> -
> -		if (dn == cpu_dn)
> -			break;
> -	}
> -
> -	if (cpu >= nr_cpu_ids) {
> +	cpu = of_cpu_node_to_id(dn);
> +	if (cpu < 0) {
>  		pr_warn("failed to find logical CPU for %s\n", dn->name);
> +		cpu = nr_cpu_ids;
>  	}
>  
>  	of_node_put(dn);
> -- 
> 2.13.6
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ