From patchwork Wed Jul 31 19:12:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring (Arm)" X-Patchwork-Id: 13749096 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 C0D8EC3DA64 for ; Wed, 31 Jul 2024 19:17:33 +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: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=cSV+7fQhttWwzd6/2gahCd3CW526ZECHJoO6z92E60I=; b=CAjZEHMeXNqniybMJx2g9plD6t i0syyfJvRkbXeOEtgpWZ02xjGYf65XMtc9kTdZdj4KxZ5YheTTqtY8fjut1eRqgwoDPozRNukucmy XqLnX3eVuVSqcHClyY+OQxtwnKY5D4vY7s58OOO2RzWGLapOW8MgoJRI1dKiYv4OUvSM5VKMN1jwr hV8qwZkLnNsgRyZS0kVR65NrUZjZQ0x16gMxObsgARh9+QMiniX2iAKOVxal9XqEupCiRwnDUgQ8j +UCi039OY4Z1/fOf2Znq8+d7YwHFtMVVF6j/TCxv73dv1bOUrvVk7V7ix5C5zzG4YOyatTgav4RUq g9HmXXdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZEp9-00000002FDi-0AWm; Wed, 31 Jul 2024 19:17:23 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZElw-00000002E1T-0qDn for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2024 19:14:05 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 8937DCE17D5; Wed, 31 Jul 2024 19:14:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9AFFC4AF0C; Wed, 31 Jul 2024 19:14:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722453241; bh=MzhjOtidPvD9tmAq1Vmzm3l/VuTAOlQGU77txvIYT6A=; h=From:To:Cc:Subject:Date:From; b=GOj1uF0wynjsywFdPZtSMK2/6bzSgUiDSmG9GYsoGHYIrRbmXlCK+G05kJBl2msjC Y3hb/W5/EwR4/pwexDz+0i0SocbatP/F3rr49P3d6xVrYtfWkHZAI0QadhWA13Rheh 4VAmLG8HSTylbToAr5HeaMt0UcS7g3UEvMLQ7CAPoXXcLvj9EJI0xl8FalBPCSMMx9 xWntUaFnVHbCYIhbNqLL/bOSdQQAuF5Bob0cAiYmSXqurw2EOzPsVzBqWY+ZoQrTHZ X8K6z6JK4UbIyzhTcWECkvKOUoElLexOhnjuRjJkf3QdtZ495WHjtf2Lm/Zi/jxuU0 TdFj4OL719d6g== From: "Rob Herring (Arm)" To: Will Deacon , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] perf: arm_pmu: Use of_property_present() Date: Wed, 31 Jul 2024 13:12:53 -0600 Message-ID: <20240731191312.1710417-15-robh@kernel.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240731_121404_439725_B2C34639 X-CRM114-Status: GOOD ( 10.52 ) 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 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) Reviewed-by: Anshuman Khandual Acked-by: Mark Rutland --- 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)