From: Anshuman Khandual <anshuman.khandual@arm.com>
To: "Rob Herring (Arm)" <robh@kernel.org>,
Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf: arm_pmu: Use of_property_present()
Date: Thu, 1 Aug 2024 16:41:15 +0530 [thread overview]
Message-ID: <efea6d1d-afee-4e80-94d0-1ca99f9dc9c2@arm.com> (raw)
In-Reply-To: <20240731191312.1710417-15-robh@kernel.org>
On 8/1/24 00:42, Rob Herring (Arm) wrote:
> Use of_property_present() to test for property presence rather than
> of_find_property(). This is part of a larger effort to remove callers
> of of_find_property() and similar functions. of_find_property() leaks
> the DT struct property and data pointers which is a problem for
> dynamically allocated nodes which may be freed.
>
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> ---
> drivers/perf/arm_pmu_platform.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/perf/arm_pmu_platform.c b/drivers/perf/arm_pmu_platform.c
> index 4b1a9a92ea11..118170a5cede 100644
> --- a/drivers/perf/arm_pmu_platform.c
> +++ b/drivers/perf/arm_pmu_platform.c
> @@ -59,7 +59,7 @@ static int pmu_parse_percpu_irq(struct arm_pmu *pmu, int irq)
>
> static bool pmu_has_irq_affinity(struct device_node *node)
> {
> - return !!of_find_property(node, "interrupt-affinity", NULL);
> + return of_property_present(node, "interrupt-affinity");
> }
>
> static int pmu_parse_irq_affinity(struct device *dev, int i)
After this change there are no of_find_property() instances left
in the drivers/perf directory.
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
next prev parent reply other threads:[~2024-08-01 11:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-31 19:12 [PATCH] perf: arm_pmu: Use of_property_present() Rob Herring (Arm)
2024-08-01 11:11 ` Anshuman Khandual [this message]
2024-08-03 11:02 ` Mark Rutland
2024-08-16 15:15 ` Will Deacon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=efea6d1d-afee-4e80-94d0-1ca99f9dc9c2@arm.com \
--to=anshuman.khandual@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh@kernel.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox