@@ -43,8 +43,7 @@ static ssize_t show_package_id(struct kobject *kobj, struct kobj_attribute *attr
43
43
return sprintf (buf , "%u\n" , data -> package_id );
44
44
}
45
45
46
- static ssize_t show_min_max_freq_khz (struct uncore_data * data ,
47
- char * buf , enum uncore_index index )
46
+ static ssize_t show_attr (struct uncore_data * data , char * buf , enum uncore_index index )
48
47
{
49
48
unsigned int value ;
50
49
int ret ;
@@ -58,9 +57,8 @@ static ssize_t show_min_max_freq_khz(struct uncore_data *data,
58
57
return sprintf (buf , "%u\n" , value );
59
58
}
60
59
61
- static ssize_t store_min_max_freq_khz (struct uncore_data * data ,
62
- const char * buf , ssize_t count ,
63
- enum uncore_index index )
60
+ static ssize_t store_attr (struct uncore_data * data , const char * buf , ssize_t count ,
61
+ enum uncore_index index )
64
62
{
65
63
unsigned int input ;
66
64
int ret ;
@@ -92,24 +90,23 @@ static ssize_t show_perf_status_freq_khz(struct uncore_data *data, char *buf)
92
90
return sprintf (buf , "%u\n" , freq );
93
91
}
94
92
95
- #define store_uncore_min_max (name , min_max ) \
93
+ #define store_uncore_attr (name , index ) \
96
94
static ssize_t store_##name(struct kobject *kobj, \
97
95
struct kobj_attribute *attr, \
98
96
const char *buf, size_t count) \
99
97
{ \
100
98
struct uncore_data *data = container_of(attr, struct uncore_data, name##_kobj_attr);\
101
99
\
102
- return store_min_max_freq_khz(data, buf, count, \
103
- min_max); \
100
+ return store_attr(data, buf, count, index); \
104
101
}
105
102
106
- #define show_uncore_min_max (name , min_max ) \
103
+ #define show_uncore_attr (name , index ) \
107
104
static ssize_t show_##name(struct kobject *kobj, \
108
105
struct kobj_attribute *attr, char *buf)\
109
106
{ \
110
107
struct uncore_data *data = container_of(attr, struct uncore_data, name##_kobj_attr);\
111
108
\
112
- return show_min_max_freq_khz (data, buf, min_max); \
109
+ return show_attr (data, buf, index); \
113
110
}
114
111
115
112
#define show_uncore_perf_status (name ) \
@@ -121,11 +118,11 @@ static ssize_t show_perf_status_freq_khz(struct uncore_data *data, char *buf)
121
118
return show_perf_status_freq_khz(data, buf); \
122
119
}
123
120
124
- store_uncore_min_max (min_freq_khz , UNCORE_INDEX_MIN_FREQ );
125
- store_uncore_min_max (max_freq_khz , UNCORE_INDEX_MAX_FREQ );
121
+ store_uncore_attr (min_freq_khz , UNCORE_INDEX_MIN_FREQ );
122
+ store_uncore_attr (max_freq_khz , UNCORE_INDEX_MAX_FREQ );
126
123
127
- show_uncore_min_max (min_freq_khz , UNCORE_INDEX_MIN_FREQ );
128
- show_uncore_min_max (max_freq_khz , UNCORE_INDEX_MAX_FREQ );
124
+ show_uncore_attr (min_freq_khz , UNCORE_INDEX_MIN_FREQ );
125
+ show_uncore_attr (max_freq_khz , UNCORE_INDEX_MAX_FREQ );
129
126
130
127
show_uncore_perf_status (current_freq_khz );
131
128
0 commit comments