perf: arm_pmu: Use of_property_present()
PATCH 1/1 perf: arm_pmu: Use of_property_present()
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.
--- drivers/perf/arm_pmu_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/perf/arm_pmu_platform.c +1 -1
@@ -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)
Signature · 1 line
2.43.0
Quoted 16 lines · Rob Herring (Arm)
Use
of_property_present()to test for property presence rather thanof_find_property(). This is part of a larger effort to remove callers ofof_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) <[email protected]>--- drivers/perf/arm_pmu_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/perf/arm_pmu_platform.c +0
-0
drivers/perf/arm_pmu_platform.c static int pmu_parse_percpu_irq(struct arm_pmu *pmu, int irq) · line 65
Quoted 8 lines
drivers/perf/arm_pmu_platform.c +1
-1@@ -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.
Quoted 7 lines · Rob Herring (Arm)
Use
of_property_present()to test for property presence rather thanof_find_property(). This is part of a larger effort to remove callers ofof_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) <[email protected]>
I assume Will will pick this up.
Mark.
Quoted 20 lines
--- drivers/perf/arm_pmu_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/perf/arm_pmu_platform.c +1
-1@@ -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)Signature · 1 line
2.43.0
Quoted 8 lines · Rob Herring (Arm)
Use
of_property_present()to test for property presence rather thanof_find_property(). This is part of a larger effort to remove callers ofof_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.[...]
Applied to will (for-next/perf), thanks!
[1/1] perf: arm_pmu: Use of_property_present()
https://git.kernel.org/will/c/48b035121a56
Cheers,
Signature · 5 lines
Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev