lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 18 May 2021 15:23:47 +0800
From:   Qi Liu <liuqi115@...wei.com>
To:     <will@...nel.org>, <mark.rutland@....com>, <john.garry@...wei.com>
CC:     <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, <linuxarm@...wei.com>,
        <zhangshaokun@...ilicon.com>
Subject: [PATCH 8/9] drivers/perf: Remove redundant macro and functions in arm_dsu_pmu.c

Remove DSU_EVENT_ATTR and dsu_pmu_sysfs_event_show(), as there is
a general function for this.

Signed-off-by: Qi Liu <liuqi115@...wei.com>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ