mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 16:00:39 +01:00
[v0.98][Refactoring] Do not use hv_present in get_freq_from_file
This commit is contained in:
@@ -28,15 +28,11 @@ char* read_file(char* path, int* len) {
|
||||
return buf;
|
||||
}
|
||||
|
||||
long get_freq_from_file(char* path, bool hv_present) {
|
||||
long get_freq_from_file(char* path) {
|
||||
int filelen;
|
||||
char* buf;
|
||||
if((buf = read_file(path, &filelen)) == NULL) {
|
||||
if(hv_present)
|
||||
printWarn("Could not open '%s' (HV is present)", path);
|
||||
else
|
||||
printWarn("Could not open '%s'", path);
|
||||
|
||||
printWarn("Could not open '%s'", path);
|
||||
return UNKNOWN_FREQ;
|
||||
}
|
||||
|
||||
@@ -86,16 +82,16 @@ long get_cache_size_from_file(char* path) {
|
||||
return ret * 1024;
|
||||
}
|
||||
|
||||
long get_max_freq_from_file(uint32_t core, bool hv_present) {
|
||||
long get_max_freq_from_file(uint32_t core) {
|
||||
char path[_PATH_FREQUENCY_MAX_LEN];
|
||||
sprintf(path, "%s%s/cpu%d%s%s", _PATH_SYS_SYSTEM, _PATH_SYS_CPU, core, _PATH_FREQUENCY, _PATH_FREQUENCY_MAX);
|
||||
return get_freq_from_file(path, hv_present);
|
||||
return get_freq_from_file(path);
|
||||
}
|
||||
|
||||
long get_min_freq_from_file(uint32_t core, bool hv_present) {
|
||||
long get_min_freq_from_file(uint32_t core) {
|
||||
char path[_PATH_FREQUENCY_MAX_LEN];
|
||||
sprintf(path, "%s%s/cpu%d%s%s", _PATH_SYS_SYSTEM, _PATH_SYS_CPU, core, _PATH_FREQUENCY, _PATH_FREQUENCY_MIN);
|
||||
return get_freq_from_file(path, hv_present);
|
||||
return get_freq_from_file(path);
|
||||
}
|
||||
|
||||
long get_l1i_cache_size(uint32_t core) {
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
#define DEFAULT_FILE_SIZE 4096
|
||||
|
||||
char* read_file(char* path, int* len);
|
||||
long get_max_freq_from_file(uint32_t core, bool hv_present);
|
||||
long get_min_freq_from_file(uint32_t core, bool hv_present);
|
||||
long get_max_freq_from_file(uint32_t core);
|
||||
long get_min_freq_from_file(uint32_t core);
|
||||
long get_l1i_cache_size(uint32_t core);
|
||||
long get_l1d_cache_size(uint32_t core);
|
||||
long get_l2_cache_size(uint32_t core);
|
||||
|
||||
Reference in New Issue
Block a user