Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1771681rdb; Mon, 9 Oct 2023 02:18:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGl3D/ydqcUm2iFOHbHuhvesT0Z8RJow9y09VOEzk7GRqoLY3T7VPmoJDV4ew5E5/690zjU X-Received: by 2002:a17:902:da88:b0:1c3:ed30:ce0a with SMTP id j8-20020a170902da8800b001c3ed30ce0amr19465362plx.19.1696843101445; Mon, 09 Oct 2023 02:18:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843101; cv=none; d=google.com; s=arc-20160816; b=nY25sFusns9qa9Bz/AwsIw/geIixsm8NzybsaGF6wqVblBEnWKgy3ALx5BU17ebjzY jFE1KUZLiK6CfbNC+9P9KfA/ZML48WbBVuNFMCYHVvwj6qfIJL6WYpz3VBl6MpQrXnyK VlhpRxWi55g+LUliXUoLTbaJgJFq9ZA7NaYVMV4LxRxJ/N/iaDAxuJQ9xZ5mHf8idx3O recxaHEU8eOZoT8uNdEUcBMWsO+ogGWV2soyLvC7sF63LVXWqsaIwA3Jo9X58pqMkfDo VYpyToq8wV7t2xxv+OqttcRoNWsTFS+31SgOpMozSMlqXTzXOxEH7bB6R1IhigVGzqLj urVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=ne4fpQMkpHHuoBo7/C+TlZIG7u4bap7JOJA0S2LMysM=; fh=Yfj9wRuyi9dks3ugNBrVXPqXwd2N5tvTgjL0FQJiUMA=; b=CyfqorIKPEgolmRVIX7ElRFUOBjRJsZj7Rir6LtqFcf7kIzMRC6frfqdjamL6lN5Am baA4cvmVYsgcL+i7qJ+T09Dhc4zL/gy/v5ZokcpvjLwGoC5I7mz50hrqz48eX5QZOH7o NglW3ul/7sRZojOBMEj4qGRiUDdoTYUv/a7d+i6cTQeGWfmlhdKgu+OdGQ94uSL6ghtp 3KkEIbp+jUgN99EZI1h4MHtBk0rbi7cLF5GfG9Q+x4w5rN9d/wvb0q+6ckoXWBWKbsKZ /mCFf7M1gDPbAd7aDFlMPotuMFNmlEI3rd0fnticTJw/n5Km2TxVGWR9N7q51KsXimUt 02wQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id c12-20020a170902724c00b001c4401a7e18si8927141pll.382.2023.10.09.02.18.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:18:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 9B1998065CBB; Mon, 9 Oct 2023 02:18:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345631AbjJIJSC (ORCPT + 99 others); Mon, 9 Oct 2023 05:18:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234477AbjJIJSC (ORCPT ); Mon, 9 Oct 2023 05:18:02 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3B16097 for ; Mon, 9 Oct 2023 02:18:00 -0700 (PDT) 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 7DBFA1FB; Mon, 9 Oct 2023 02:18:40 -0700 (PDT) Received: from [192.168.1.3] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 236423F7A6; Mon, 9 Oct 2023 02:17:59 -0700 (PDT) Message-ID: <896fc51e-2c74-29f7-2c7e-f14f29c401a4@arm.com> Date: Mon, 9 Oct 2023 10:17:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH] driver: perf: arm_pmu: Drop some unused arguments from armv8_pmu_init() Content-Language: en-US To: Anshuman Khandual , linux-arm-kernel@lists.infradead.org, Robin Murphy Cc: Will Deacon , Mark Rutland , linux-kernel@vger.kernel.org References: <20231009035638.165270-1-anshuman.khandual@arm.com> From: James Clark In-Reply-To: <20231009035638.165270-1-anshuman.khandual@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.5 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:18:18 -0700 (PDT) On 09/10/2023 04:56, Anshuman Khandual wrote: > There is just a single call site remaining for armv8_pmu_init(), passing on > NULL pointers for all custom 'struct attribute_group'. These arguments are > not really getting used and hence can just be dropped off, thus simplifying > the code further. > > Cc: Will Deacon > Cc: Mark Rutland > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Anshuman Khandual > --- > This applies on v6.6-rc5. > > drivers/perf/arm_pmuv3.c | 17 +++++------------ > 1 file changed, 5 insertions(+), 12 deletions(-) > > diff --git a/drivers/perf/arm_pmuv3.c b/drivers/perf/arm_pmuv3.c > index 8fcaa26f0f8a..fe4db1831662 100644 > --- a/drivers/perf/arm_pmuv3.c > +++ b/drivers/perf/arm_pmuv3.c > @@ -1187,10 +1187,7 @@ static void armv8_pmu_register_sysctl_table(void) > } > > static int armv8_pmu_init(struct arm_pmu *cpu_pmu, char *name, > - int (*map_event)(struct perf_event *event), > - const struct attribute_group *events, > - const struct attribute_group *format, > - const struct attribute_group *caps) > + int (*map_event)(struct perf_event *event)) > { > int ret = armv8pmu_probe_pmu(cpu_pmu); > if (ret) > @@ -1212,13 +1209,9 @@ static int armv8_pmu_init(struct arm_pmu *cpu_pmu, char *name, > > cpu_pmu->name = name; > cpu_pmu->map_event = map_event; > - cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_EVENTS] = events ? > - events : &armv8_pmuv3_events_attr_group; > - cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_FORMATS] = format ? > - format : &armv8_pmuv3_format_attr_group; > - cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_CAPS] = caps ? > - caps : &armv8_pmuv3_caps_attr_group; > - > + cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_EVENTS] = &armv8_pmuv3_events_attr_group; > + cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_FORMATS] = &armv8_pmuv3_format_attr_group; > + cpu_pmu->attr_groups[ARMPMU_ATTR_GROUP_CAPS] = &armv8_pmuv3_caps_attr_group; > armv8_pmu_register_sysctl_table(); > return 0; > } > @@ -1226,7 +1219,7 @@ static int armv8_pmu_init(struct arm_pmu *cpu_pmu, char *name, > static int armv8_pmu_init_nogroups(struct arm_pmu *cpu_pmu, char *name, > int (*map_event)(struct perf_event *event)) > { > - return armv8_pmu_init(cpu_pmu, name, map_event, NULL, NULL, NULL); > + return armv8_pmu_init(cpu_pmu, name, map_event); I think the whole point of the nogroups wrapper was to add the NULLs. If you remove them, then you can remove the nogroups function too and just call armv8_pmu_init() directly instead. And as it wasn't clear why they were there in the first place, I went to look and found this (e424b17) : Although nobody uses non-default sysfs attributes today, there's minimal impact to preserving the notion that maybe, some day, somebody might, so we may as well keep up appearances. It might be worth mentioning that the decision has now been made in the other way. > } > > #define PMUV3_INIT_SIMPLE(name) \