From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0F456C3DA64 for ; Thu, 1 Aug 2024 11:12:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=P5GNe7CjWyY4tOQZXxJWlo91PAVuxcEpkB79Sl5pz8M=; b=Ly2HJQPyrOpmryX7JElbn0w8BR XptBT5VNWVaiqwTPY2FDOuJGJMzFuBKWuNKV1osV8MR49tiWzJmPO+xZ9K8mVBWiQAmoO7JdlyTbB 7y+yNzznLmgGGmh1CNe+O4OUoISyxA5TxK6U80Zvv55COgxYUiXsVqdVRSHIhxkrb8WreBXyH7cCD iMpeiYDXRdsOTKPGiE6hF38uxVPVmipzf7kBG+IT+0h+44xYfwn8CCqRikJRVkeTinzQkP35eO2nK kFgahawAz/bSG4E6Ag/G1bLlg+J4bvvViP/cTzQ5ZzDrTxJq6FnDO4DNLKsMaCsISCINoVbMFbYPq atPXK3Dg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZTio-00000004sJd-1BxG; Thu, 01 Aug 2024 11:11:50 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZTiK-00000004sCO-2ZX9 for linux-arm-kernel@lists.infradead.org; Thu, 01 Aug 2024 11:11:21 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240801_041120_726035_E6847AA4 X-CRM114-Status: GOOD ( 15.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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) > --- > 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