Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1488512rwb; Thu, 1 Dec 2022 18:51:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf5thVCBhy9Fz3h4W8r9A9Z5dIVpnzCZQ0P6eQHiXZolg4DgTbnFdRyfrOkdDzWHz5/REeDF X-Received: by 2002:a17:906:544b:b0:7c0:7e90:ec98 with SMTP id d11-20020a170906544b00b007c07e90ec98mr15676586ejp.537.1669949503230; Thu, 01 Dec 2022 18:51:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669949503; cv=none; d=google.com; s=arc-20160816; b=drhX9WNJp5VyYaTM0/4+XYYF3hiUPtMqHL/6jOT4U3qhYrtC1lM63JRFittH1VwVrl HCzwOFHYEAm2spYar+nVGsSbAwQiwnz/bve/aw3mBsgOhe8Jz6jB/kwW5jH68eAgidBr 32ET59xVnh0Do5mGxXxB4nh5hf0aqq+TLVzMaQqr6sqUHncfvZnKtdI9BmCT+nTNEii/ 2BuH4DT3cICSfKCPcZnAsiMXC43wUO0E6GDGR06ibGuEftwW6rHLFF1TtHDgLrOFuMLC qTeh3OHAHq2P1uHLkrrooFJa8Fg0KYIuS+BW7nm7swaDev2k+92UP/Jnmh9xK5o1tdgj P9Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=JPz9jSXyjEpB1xGRIXio2Mk46IjgvkhPyS7E33CrcUc=; b=UdXBp39xz/LGXKEvtglNGNGdyuZd8SFnDtU4HN1VAYhH8/el93trmN2Vxu3a5WOaks LAxRRmxqK0wBLfpGKYJVnbUmyJjI87KKXjVzmMxd7pl1dBKzkrj3qmc08jr8m5VON/Zj COBY/2VC9aYG33T2+U2V6cY3extTDPY+ViMv4zpOxe4RPhoDxjW6q5aFNJsnuWufAQxG IBhTYkZlDpaj224i5+Q9l0Kzio1Of7+eZh6sThBeKLsSGuCytxlz5XCt2+CB8RpTJoT7 EBHgE7ESsCnvJIUw0VxAUzM33fiUGDpoEqpRec/VD8A3Cmv3b5Km1ib5EK7/Fm1c26dM ZYQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa9-20020a170907868900b007c08a2c2400si5680556ejc.83.2022.12.01.18.51.23; Thu, 01 Dec 2022 18:51:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231634AbiLBB4Z (ORCPT + 81 others); Thu, 1 Dec 2022 20:56:25 -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: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org __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.com/ 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; - if (armpmu->map_event(event) == -ENOENT) - return -ENOENT; - return __hw_perf_event_init(event); } -- 2.25.1