Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1574528pxj; Wed, 19 May 2021 08:58:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9ZiEby59mNo8NJ48bmkzZRwhiU4Hhd2kMK+6Uywt6QgieTvGZDPMq6Y4ig/urf5ye7apG X-Received: by 2002:a02:92cc:: with SMTP id c12mr13332327jah.30.1621439895732; Wed, 19 May 2021 08:58:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621439895; cv=none; d=google.com; s=arc-20160816; b=bqgmWFwzwWrIBm/U8uWJXmvHtuomTwJOGrP1gXSHDvtYJwiUy1JlLm2fKUr161m2b1 0hzwAdp+e8rXlKTye/hN3XmpIrF1pQKrmX9EqdvYniMVep3epGgd3u21SHE+ZNi3CzZA RDlDg1xAUZ7hb6K4MdejlybXsyteuPCZYEgoYY6rgpadsZsN0W6ckxdWshz1SFP5FvDz RJzATbhiFBiMXx5M/5jqSbOdmF5VtW9RTpYdmm3ELigLoOy2UmgHMkUwj3UivERjOI+R N2RAiXKWkzq/0N9GtP3KEu4DE9epf+CRr3Ft9tN7aCuvd88cP8q3k0fEOWYa3juZ83h+ sWyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=+3wU1J8Liho9sDXYkIGBRERHXPlCdRjGdF7F51i40u4=; b=EEgwFjR+aZRj00Trz/lo9GMesCvNKSTSPNN1Lh6hrUnh14GEzNnsdjL7Y2fK5Sd2ys lQMtAXjfOgIv5ZVTwxXFQa9m9eGMD2IJtmZ/Kpmlt3eetLR2XPv3wbK1hit9coBuRkYg kXLLEzXg++CGrkTf+TudPYEqpFLYpmn4+rNd+/F5NdvBJ9MFox6UQMM3XhdS0fR9C3pN HiN54EqwXypGCcRK+EcRbp65FQZ6AnS+9baxL2y9AQdpoTp8ovQNtv4Lsk54GpNG6fSu JCdeY/v92yXfsx+jELl/Kgacl2hofqMJZ5828YmhqJ1KkVSHeihkPAQJFKBc0upjKdCe trWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p5si68339ilm.11.2021.05.19.08.58.02; Wed, 19 May 2021 08:58:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347196AbhERHZi (ORCPT + 99 others); Tue, 18 May 2021 03:25:38 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:4726 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241214AbhERHZO (ORCPT ); Tue, 18 May 2021 03:25:14 -0400 Received: from dggems706-chm.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FknTQ3mKFzmjCq; Tue, 18 May 2021 15:20:26 +0800 (CST) Received: from dggema757-chm.china.huawei.com (10.1.198.199) by dggems706-chm.china.huawei.com (10.3.19.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Tue, 18 May 2021 15:23:54 +0800 Received: from localhost.localdomain (10.69.192.56) by dggema757-chm.china.huawei.com (10.1.198.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Tue, 18 May 2021 15:23:54 +0800 From: Qi Liu To: , , CC: , , , Subject: [PATCH 8/9] drivers/perf: Remove redundant macro and functions in arm_dsu_pmu.c Date: Tue, 18 May 2021 15:23:47 +0800 Message-ID: <1621322628-9945-9-git-send-email-liuqi115@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1621322628-9945-1-git-send-email-liuqi115@huawei.com> References: <1621322628-9945-1-git-send-email-liuqi115@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggema757-chm.china.huawei.com (10.1.198.199) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove DSU_EVENT_ATTR and dsu_pmu_sysfs_event_show(), as there is a general function for this. Signed-off-by: Qi Liu --- drivers/perf/arm_dsu_pmu.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/drivers/perf/arm_dsu_pmu.c b/drivers/perf/arm_dsu_pmu.c index 196faea..33bb97e 100644 --- a/drivers/perf/arm_dsu_pmu.c +++ b/drivers/perf/arm_dsu_pmu.c @@ -81,9 +81,6 @@ } \ })[0].attr.attr) -#define DSU_EVENT_ATTR(_name, _config) \ - DSU_EXT_ATTR(_name, dsu_pmu_sysfs_event_show, (unsigned long)_config) - #define DSU_FORMAT_ATTR(_name, _config) \ DSU_EXT_ATTR(_name, dsu_pmu_sysfs_format_show, (char *)_config) @@ -130,15 +127,6 @@ static inline struct dsu_pmu *to_dsu_pmu(struct pmu *pmu) return container_of(pmu, struct dsu_pmu, pmu); } -static ssize_t dsu_pmu_sysfs_event_show(struct device *dev, - struct device_attribute *attr, - char *buf) -{ - struct dev_ext_attribute *eattr = container_of(attr, - struct dev_ext_attribute, attr); - return sysfs_emit(buf, "event=0x%lx\n", (unsigned long)eattr->var); -} - static ssize_t dsu_pmu_sysfs_format_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -183,14 +171,14 @@ static const struct attribute_group dsu_pmu_format_attr_group = { }; static struct attribute *dsu_pmu_event_attrs[] = { - DSU_EVENT_ATTR(cycles, 0x11), - DSU_EVENT_ATTR(bus_access, 0x19), - DSU_EVENT_ATTR(memory_error, 0x1a), - DSU_EVENT_ATTR(bus_cycles, 0x1d), - DSU_EVENT_ATTR(l3d_cache_allocate, 0x29), - DSU_EVENT_ATTR(l3d_cache_refill, 0x2a), - DSU_EVENT_ATTR(l3d_cache, 0x2b), - DSU_EVENT_ATTR(l3d_cache_wb, 0x2c), + PMU_EVENT_ATTR_ID(cycles, 0x11), + PMU_EVENT_ATTR_ID(bus_access, 0x19), + PMU_EVENT_ATTR_ID(memory_error, 0x1a), + PMU_EVENT_ATTR_ID(bus_cycles, 0x1d), + PMU_EVENT_ATTR_ID(l3d_cache_allocate, 0x29), + PMU_EVENT_ATTR_ID(l3d_cache_refill, 0x2a), + PMU_EVENT_ATTR_ID(l3d_cache, 0x2b), + PMU_EVENT_ATTR_ID(l3d_cache_wb, 0x2c), NULL, }; -- 2.7.4