From nobody Thu Sep 18 20:22:25 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29357C4332F for ; Fri, 2 Dec 2022 01:56:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231308AbiLBB40 (ORCPT ); Thu, 1 Dec 2022 20:56:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230193AbiLBB4Y (ORCPT ); Thu, 1 Dec 2022 20:56:24 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4FC38D3DF1 for ; Thu, 1 Dec 2022 17:56:23 -0800 (PST) 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 30F322B; Thu, 1 Dec 2022 17:56:29 -0800 (PST) Received: from a077893.arm.com (unknown [10.163.43.56]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D848E3F73B; Thu, 1 Dec 2022 17:56:19 -0800 (PST) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com Cc: Anshuman Khandual , Catalin Marinas , Will Deacon , linux-kernel@vger.kernel.org Subject: [PATCH V2] arm_pmu: Drop redundant armpmu->map_event() in armpmu_event_init() Date: Fri, 2 Dec 2022 07:26:11 +0530 Message-Id: <20221202015611.338499-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" __hw_perf_event_init() already calls armpmu->map_event() callback, and also returns its error code including -ENOENT, along with a debug callout. Hence an additional armpmu->map_event() check for -ENOENT is redundant. Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Acked-by: Mark Rutland Signed-off-by: Anshuman Khandual --- Changes in V2: - Rebased on arm64 (for-next/perf) Changes in V1: https://lore.kernel.org/all/20221130083350.264583-1-anshuman.khandual@arm.c= om/ drivers/perf/arm_pmu.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c index 3f07df5a7e95..ed89748b1612 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c @@ -514,9 +514,6 @@ static int armpmu_event_init(struct perf_event *event) if (has_branch_stack(event)) return -EOPNOTSUPP; =20 - if (armpmu->map_event(event) =3D=3D -ENOENT) - return -ENOENT; - return __hw_perf_event_init(event); } =20 --=20 2.25.1