[PATCH 3/4] arm64: pmu: Add support for probing with ACPI

Timur Tabi timur at codeaurora.org
Sun Mar 13 16:28:38 PDT 2016


Jeremy Linton wrote:
> +	int i, count, irq;
> +
> +	if (acpi_disabled)
> +		return 0;
> +
> +	acpi_parse_boot_cpu();
> +
> +	/* Must have irq for boot boot cpu, at least */
> +	if (pirq->gsi == 0)
> +		return -EINVAL;
> +
> +	irq = acpi_register_gsi(NULL, pirq->gsi, pirq->trigger,
> +				ACPI_ACTIVE_HIGH);
> +
> +	if (irq_is_percpu(irq))
> +		count = 1;
> +	else
> +		for (i = 1, count = 1; i < NR_CPUS; i++)
> +			if (pmu_irqs[i].gsi)
> +				++count;

You could more simply with:

	int count = 1
	...
	if (!irq_is_percpu(irq))
		for (i = 1; i < NR_CPUS; i++)
			if (pmu_irqs[i].gsi)
				++count;



-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the
Code Aurora Forum, hosted by The Linux Foundation.



More information about the linux-arm-kernel mailing list