[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1623123201-45634-3-git-send-email-liuqi115@huawei.com>
Date: Tue, 8 Jun 2021 11:33:14 +0800
From: Qi Liu <liuqi115@...wei.com>
To: <linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>
CC: <linuxarm@...wei.com>, Shaokun Zhang <zhangshaokun@...ilicon.com>,
"Will Deacon" <will@...nel.org>,
Mark Rutland <mark.rutland@....com>
Subject: [PATCH v3 2/9] drivers/perf: hisi: Simplify EVENT ATTR macro in HiSilicon PMU driver
Use common macro PMU_EVENT_ATTR_ID to simplify HISI_PMU_EVENT_ATTR.
Cc: Shaokun Zhang <zhangshaokun@...ilicon.com>
Cc: Will Deacon <will@...nel.org>
Cc: Mark Rutland <mark.rutland@....com>
Signed-off-by: Qi Liu <liuqi115@...wei.com>
---
drivers/perf/hisilicon/hisi_uncore_pmu.c | 7 +++----
drivers/perf/hisilicon/hisi_uncore_pmu.h | 2 +-
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.c b/drivers/perf/hisilicon/hisi_uncore_pmu.c
index 13c68b5..52e3bcb 100644
--- a/drivers/perf/hisilicon/hisi_uncore_pmu.c
+++ b/drivers/perf/hisilicon/hisi_uncore_pmu.c
@@ -43,11 +43,10 @@ EXPORT_SYMBOL_GPL(hisi_format_sysfs_show);
ssize_t hisi_event_sysfs_show(struct device *dev,
struct device_attribute *attr, char *page)
{
- struct dev_ext_attribute *eattr;
-
- eattr = container_of(attr, struct dev_ext_attribute, attr);
+ struct perf_pmu_events_attr *pmu_attr =
+ container_of(attr, struct perf_pmu_events_attr, attr);
- return sysfs_emit(page, "config=0x%lx\n", (unsigned long)eattr->var);
+ return sysfs_emit(page, "config=0x%llx\n", pmu_attr->id);
}
EXPORT_SYMBOL_GPL(hisi_event_sysfs_show);
diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.h b/drivers/perf/hisilicon/hisi_uncore_pmu.h
index ea9d89b..b2504d4 100644
--- a/drivers/perf/hisilicon/hisi_uncore_pmu.h
+++ b/drivers/perf/hisilicon/hisi_uncore_pmu.h
@@ -35,7 +35,7 @@
#define HISI_PMU_FORMAT_ATTR(_name, _config) \
HISI_PMU_ATTR(_name, hisi_format_sysfs_show, (void *)_config)
#define HISI_PMU_EVENT_ATTR(_name, _config) \
- HISI_PMU_ATTR(_name, hisi_event_sysfs_show, (unsigned long)_config)
+ PMU_EVENT_ATTR_ID(_name, hisi_event_sysfs_show, _config)
#define HISI_PMU_EVENT_ATTR_EXTRACTOR(name, config, hi, lo) \
static inline u32 hisi_get_##name(struct perf_event *event) \
--
2.7.4
Powered by blists - more mailing lists