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]
Message-ID: <20240617060708.892981-8-tero.kristo@linux.intel.com>
Date: Mon, 17 Jun 2024 09:04:40 +0300
From: Tero Kristo <tero.kristo@...ux.intel.com>
To: hdegoede@...hat.com,
	srinivas.pandruvada@...ux.intel.com,
	ilpo.jarvinen@...ux.intel.com
Cc: linux-kernel@...r.kernel.org,
	platform-driver-x86@...r.kernel.org
Subject: [PATCH 7/7] platform/x86/intel-uncore-freq: Use generic helpers for current frequency

Use the generic sysfs helpers for reading the current frequency also,
and remove the custom ones.

No functional change intended.

Signed-off-by: Tero Kristo <tero.kristo@...ux.intel.com>
---
 .../uncore-frequency-common.c                 | 25 +------------------
 1 file changed, 1 insertion(+), 24 deletions(-)

diff --git a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c
index 9356a0f322e6..4e880585cbe4 100644
--- a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c
+++ b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c
@@ -76,20 +76,6 @@ static ssize_t store_attr(struct uncore_data *data, const char *buf, ssize_t cou
 	return count;
 }
 
-static ssize_t show_perf_status_freq_khz(struct uncore_data *data, char *buf)
-{
-	unsigned int freq;
-	int ret;
-
-	mutex_lock(&uncore_lock);
-	ret = uncore_read(data, &freq, UNCORE_INDEX_CURRENT_FREQ);
-	mutex_unlock(&uncore_lock);
-	if (ret)
-		return ret;
-
-	return sprintf(buf, "%u\n", freq);
-}
-
 #define store_uncore_attr(name, index)					\
 	static ssize_t store_##name(struct kobject *kobj,		\
 				     struct kobj_attribute *attr,	\
@@ -109,22 +95,13 @@ static ssize_t show_perf_status_freq_khz(struct uncore_data *data, char *buf)
 		return show_attr(data, buf, index);			\
 	}
 
-#define show_uncore_perf_status(name)					\
-	static ssize_t show_##name(struct kobject *kobj,		\
-				   struct kobj_attribute *attr, char *buf)\
-	{                                                               \
-		struct uncore_data *data = container_of(attr, struct uncore_data, name##_kobj_attr);\
-									\
-		return show_perf_status_freq_khz(data, buf); \
-	}
-
 store_uncore_attr(min_freq_khz, UNCORE_INDEX_MIN_FREQ);
 store_uncore_attr(max_freq_khz, UNCORE_INDEX_MAX_FREQ);
 
 show_uncore_attr(min_freq_khz, UNCORE_INDEX_MIN_FREQ);
 show_uncore_attr(max_freq_khz, UNCORE_INDEX_MAX_FREQ);
 
-show_uncore_perf_status(current_freq_khz);
+show_uncore_attr(current_freq_khz, UNCORE_INDEX_CURRENT_FREQ);
 
 #define show_uncore_data(member_name)					\
 	static ssize_t show_##member_name(struct kobject *kobj,	\
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ