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 4051E189536 for ; Thu, 1 Aug 2024 11:11:20 +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=1722510681; cv=none; b=VwNW+vqVR8VWmWlV15fqAITEMecqgfCPcorMXZLWJYLxCxyRZNw9klNpyrhs68Tsfy435FJ7ZyVftpym+iVK6kgKvYvpZo67DTuG651F0AwSu6s4b4YFvHiKGvWAQzfwCguEvMju27qSBT2J9/tbJHKdsVfs7Yv7VertmSSUYJU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722510681; c=relaxed/simple; bh=EZ9EsVhvdR0LXKDsUdxVje+GuBZs2xzlNDYWIEaTzys=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=A1YMlCfIAhtfjBh4luC6zwm9F0gJ6RULFJ1jn8qmKbPremL/Ta75ocynet9cJjkAbBScin7UAcXqdkUGG4wCSTO8rz8lBCZXBx4+zLuxefYmvRct8Ws4UpsoyIzscqDLCt315rmsVShPoyrpica1cNMeyj2lAGPXT7BjXibquz0= 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 5770915A1; Thu, 1 Aug 2024 04:11:45 -0700 (PDT) Received: from [10.163.56.112] (unknown [10.163.56.112]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CCD8F3F5A1; Thu, 1 Aug 2024 04:11:17 -0700 (PDT) Message-ID: Date: Thu, 1 Aug 2024 16:41:15 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] perf: arm_pmu: Use of_property_present() To: "Rob Herring (Arm)" , Will Deacon , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20240731191312.1710417-15-robh@kernel.org> Content-Language: en-US From: Anshuman Khandual In-Reply-To: <20240731191312.1710417-15-robh@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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) > --- > 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