From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2611374BE1 for ; Sat, 3 Aug 2024 11:02:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722682933; cv=none; b=YSkuSZ78DBZ0oKLdg6ToXOphUNYRmihNeRzmLaWDosXKhbcFZOS+LJuHDiizXqagRF/H5lhTZDeMj7SXm4PIA7G752IiGfaq/EzGN416KC3j5t3n+ZVdQdiqclwoMmTaP2htfROeeM8hhVDWYxiCmJNjmcfq46z4jwkYdYG4/Eo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722682933; c=relaxed/simple; bh=qUAnIDK0vvNtqR7K5jLSS3OTyJbDV0O0ZeKSxcxXnfk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dcfKzb/ktY/Wzw4Nn6fij6lTaCfApzdQe0SBDKcmj5sDGpT5nVKZEMfJQODTgop7HaXngDFknswfkyXScxPrvwuXhBNP7LWZ7YmbjI1Jx6RmSPGKvUUSsh7IbMq965uww1LCQJqu5aw72yMm6XZfI2BiwBwEncNd2w+tOA3eNCM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 582E2DA7; Sat, 3 Aug 2024 04:02:37 -0700 (PDT) Received: from J2N7QTR9R3 (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D6A993F64C; Sat, 3 Aug 2024 04:02:10 -0700 (PDT) Date: Sat, 3 Aug 2024 12:02:08 +0100 From: Mark Rutland To: "Rob Herring (Arm)" Cc: Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf: arm_pmu: Use of_property_present() Message-ID: References: <20240731191312.1710417-15-robh@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240731191312.1710417-15-robh@kernel.org> On Wed, Jul 31, 2024 at 01:12:53PM -0600, 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) Acked-by: Mark Rutland I assume Will will pick this up. Mark. > --- > 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) > -- > 2.43.0 >