From 4cc60f2bd05b4e8a32b1d6494d277adc0d0a3f5d Mon Sep 17 00:00:00 2001 From: Dongwoo Lee Date: Mon, 7 Feb 2022 21:41:36 +0900 Subject: [PATCH] util: resource: Remove unnecessary passing user_data parameter Change-Id: Ie867d19c667c3a7a273d31719161d74137d3cf84 Signed-off-by: Dongwoo Lee --- include/util/resource.h | 4 ++-- src/resource/resource-bus.c | 12 ++++++------ src/resource/resource-cpu.c | 16 ++++++++-------- src/resource/resource-gpu.c | 14 +++++++------- src/resource/resource-memory.c | 6 +++--- src/util/resource.c | 2 +- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/include/util/resource.h b/include/util/resource.h index c4bd599..5c7fd8f 100644 --- a/include/util/resource.h +++ b/include/util/resource.h @@ -52,10 +52,10 @@ struct resource_attribute_value { struct resource_attribute_ops { int (*set)(const struct resource *res, const struct resource_attribute *attr, - const void *data, int count, void *user_data); + const void *data, int count); int (*get)(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data); + void **data); }; struct resource_attribute { diff --git a/src/resource/resource-bus.c b/src/resource/resource-bus.c index 826f209..f76f047 100644 --- a/src/resource/resource-bus.c +++ b/src/resource/resource-bus.c @@ -34,7 +34,7 @@ static int bus_get_cur_freq(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { int val; @@ -52,7 +52,7 @@ static int bus_get_cur_freq(const struct resource *res, static int bus_get_min_freq(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { int val; @@ -70,7 +70,7 @@ static int bus_get_min_freq(const struct resource *res, static int bus_get_max_freq(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { int val; @@ -88,7 +88,7 @@ static int bus_get_max_freq(const struct resource *res, static int bus_get_available_min_freq(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { int val; @@ -106,7 +106,7 @@ static int bus_get_available_min_freq(const struct resource *res, static int bus_get_available_max_freq(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { int val; @@ -124,7 +124,7 @@ static int bus_get_available_max_freq(const struct resource *res, static int bus_get_curr_governor(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { char buf[BUFF_MAX]; int val; diff --git a/src/resource/resource-cpu.c b/src/resource/resource-cpu.c index de30d38..8d288f4 100644 --- a/src/resource/resource-cpu.c +++ b/src/resource/resource-cpu.c @@ -34,7 +34,7 @@ static int cpu_get_cur_freq(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { int val; @@ -52,7 +52,7 @@ static int cpu_get_cur_freq(const struct resource *res, static int cpu_get_min_freq(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { int val; @@ -70,7 +70,7 @@ static int cpu_get_min_freq(const struct resource *res, static int cpu_get_max_freq(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { int val; @@ -88,7 +88,7 @@ static int cpu_get_max_freq(const struct resource *res, static int cpu_get_available_min_freq(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { int val; @@ -106,7 +106,7 @@ static int cpu_get_available_min_freq(const struct resource *res, static int cpu_get_available_max_freq(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { int val; @@ -124,7 +124,7 @@ static int cpu_get_available_max_freq(const struct resource *res, static int cpu_get_curr_governor(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { char buf[BUFF_MAX]; int val; @@ -145,14 +145,14 @@ static int cpu_get_curr_governor(const struct resource *res, static int cpu_get_online_cpu(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { return 0; } static int cpu_get_temperature(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { return 0; } diff --git a/src/resource/resource-gpu.c b/src/resource/resource-gpu.c index 87acc82..e7afa19 100644 --- a/src/resource/resource-gpu.c +++ b/src/resource/resource-gpu.c @@ -34,7 +34,7 @@ static int gpu_get_cur_freq(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { int val; @@ -52,7 +52,7 @@ static int gpu_get_cur_freq(const struct resource *res, static int gpu_get_min_freq(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { int val; @@ -70,7 +70,7 @@ static int gpu_get_min_freq(const struct resource *res, static int gpu_get_max_freq(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { int val; @@ -88,7 +88,7 @@ static int gpu_get_max_freq(const struct resource *res, static int gpu_get_available_min_freq(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { int val; @@ -106,7 +106,7 @@ static int gpu_get_available_min_freq(const struct resource *res, static int gpu_get_available_max_freq(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { int val; @@ -124,7 +124,7 @@ static int gpu_get_available_max_freq(const struct resource *res, static int gpu_get_curr_governor(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { char buf[BUFF_MAX]; int val; @@ -145,7 +145,7 @@ static int gpu_get_curr_governor(const struct resource *res, static int gpu_get_temperature(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { return 0; } diff --git a/src/resource/resource-memory.c b/src/resource/resource-memory.c index 5d5742f..b4ef902 100644 --- a/src/resource/resource-memory.c +++ b/src/resource/resource-memory.c @@ -74,7 +74,7 @@ static inline int memory_read_val_from_proc_node(uint32_t val_id) static int memory_get_total_memory(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { int val; @@ -92,7 +92,7 @@ static int memory_get_total_memory(const struct resource *res, static int memory_get_available_memory(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { int val; @@ -110,7 +110,7 @@ static int memory_get_available_memory(const struct resource *res, static int memory_get_free_memory(const struct resource *res, const struct resource_attribute *attr, - void **data, void *user_data) + void **data) { int val; diff --git a/src/util/resource.c b/src/util/resource.c index f3f927e..7bc52a6 100644 --- a/src/util/resource.c +++ b/src/util/resource.c @@ -200,7 +200,7 @@ int update_resource_attr(struct resource *resource, u_int64_t attr_id) if (!attr->ops.get) return -EINVAL; - ret = attr->ops.get(resource, attr, &(attr_value->data), resource->user_data); + ret = attr->ops.get(resource, attr, &(attr_value->data)); if (ret < 0) return ret; -- 2.7.4