From patchwork Wed Nov 30 08:33:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 27679 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp804735wrr; Wed, 30 Nov 2022 00:46:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf4eYAtn6qzOFvOrcV2iJ/RdeYamQaKPyH4juxXnJ0/T52CPVVzAmOQ31waVPcH3rAATo2pW X-Received: by 2002:a63:4944:0:b0:44e:466f:4759 with SMTP id y4-20020a634944000000b0044e466f4759mr35747583pgk.194.1669797976086; Wed, 30 Nov 2022 00:46:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669797976; cv=none; d=google.com; s=arc-20160816; b=SHOCGukBw22umFrdtJ8PfN37fU2zIfIjOHEST6AMsxle+7CYa0ZD1wEWagWhS70C+t 7QFYDDBaSvN3gpTBMlPsIpoGbMsSl9Tj+05ACkyB4wrmBBWbaaHWqhmBibwIT8l9OWZD 0BDJEep5MzNsXFVQza3/ZCeYa9fU2h7v6XJXgeLu/E5LpuQXYiTzQ+v7bFySkeyJEEzR 2/zUs49NC/UNwe2a/kJUABHqWc4OnyQw2cCv6Xa7tVe3ou6P+FaYvql5uOJOKz7yQL3p 1Lq7RruTyKXOajtAo2s+nRDxQJffayscV0tVQc5gebzTuV4vulINu+KJN+Ymq9hJZIda VNsw== 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=/JuH+/tJXVJ+zZwKEeRo//FH7T+DCeh38kkw3mfAZjc=; b=EPYH4Vmdk4lgPZiMdIGdeCphQ3aO180bUH07sy0eUZkJMaFxxMQMnxcuJM5QxvVJcv bnNMKqAfHdiCFyciRhn19adjVacwGxsLfWY0ShXY9lX9+Kei7oQM8AzgQbZIKKLWtBKo 3qp1+iMA+/lN8mcbNzElHk8KOLHNbftQrf6OA3XMKOq4pkgnQArrIL+moU8fpbvLFG7H qwGEIUn8T0Uv0qD3hOdoitiF8AFNOsaCrJcW9NaQLar2TBGWKn9k2hnBb554H6yxVeSv GE0gxh/YM9PjUqOSNM8KQKOfb5eH+TCTz5JkUIArfoCYP043RNl3u0Ym80sUNobEq/0d EqMA== 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 v185-20020a6389c2000000b004780d4430f6si768909pgd.10.2022.11.30.00.46.01; Wed, 30 Nov 2022 00:46:16 -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 S235419AbiK3Ifi (ORCPT + 99 others); Wed, 30 Nov 2022 03:35:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235335AbiK3IfG (ORCPT ); Wed, 30 Nov 2022 03:35:06 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AF36A1FF94 for ; Wed, 30 Nov 2022 00:33:59 -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 046FFD6E; Wed, 30 Nov 2022 00:34:06 -0800 (PST) Received: from a077893.blr.arm.com (unknown [10.162.43.8]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E749C3F73B; Wed, 30 Nov 2022 00:33:56 -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] arm_pmu: Drop redundant armpmu->map_event() in armpmu_event_init() Date: Wed, 30 Nov 2022 14:03:50 +0530 Message-Id: <20221130083350.264583-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?1750910082815499594?= X-GMAIL-MSGID: =?utf-8?q?1750910082815499594?= __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 Signed-off-by: Anshuman Khandual Acked-by: Mark Rutland --- This applies on v6.1-rc6 drivers/perf/arm_pmu.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c index 6538cec1a601..4be6869005f1 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c @@ -529,10 +529,6 @@ static int armpmu_event_init(struct perf_event *event) return -EOPNOTSUPP; } } - - if (armpmu->map_event(event) == -ENOENT) - return -ENOENT; - return __hw_perf_event_init(event); }