From patchwork Fri Dec 2 01:56:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 28659 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp598977wrr; Thu, 1 Dec 2022 18:08:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf620MtVbHzDsIiG+E4Uw82v1Len5EF4ft2t1AoRPJCHS80Weat2YSbhLXpuR1EB7tywXIUI X-Received: by 2002:a62:e218:0:b0:572:30f2:af50 with SMTP id a24-20020a62e218000000b0057230f2af50mr51077656pfi.24.1669946906071; Thu, 01 Dec 2022 18:08:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669946906; cv=none; d=google.com; s=arc-20160816; b=VezdbBKzkqJq5yHN6b0MT+wNeZpH0QH0b2SHTb5LyhpgXnss6FetYt/udPD/2wTsMT dV9bVPkfi92bAR5RsScW3NTwzrkbHbYzEG8p4iF5e3CNGqjQvqBfaymZa3bFrpaETa1N 9qvIoH0+oT3yKBeTzePOsXDJSlARiAbrXpAum+86AMIYc8fu8ScYsbhVtdUity8CzChn 8rVkl7OrinDxotuMYPY9l4OniY3JHA9hP02VBZYCWWP3uikalRWAIlLFUoN4EHmwyycp vXqzg0Y3xVeDEspogGGC8WpM7eDO92P8MRUJw7zbPwThLkfSMAvuE7ZgpctMpOAAWdtY rGRQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g17-20020a63fa51000000b00457dc916cd8si5680644pgk.152.2022.12.01.18.08.12; Thu, 01 Dec 2022 18:08:26 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751066246641210749?= X-GMAIL-MSGID: =?utf-8?q?1751066246641210749?= __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); }