Skip to content

Commit 3262bf6

Browse files
committed
userspace: proxy: Rename variables from user to user_ctx
Update variable names to use user_ctx instead of user to improve clarity. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
1 parent fc73f9d commit 3262bf6

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

src/audio/module_adapter/library/userspace_proxy.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ DECLARE_TR_CTX(userspace_proxy_tr, SOF_UUID(userspace_proxy_uuid), LOG_LEVEL_INF
4444

4545
static const struct module_interface userspace_proxy_interface;
4646

47-
static int userspace_proxy_memory_init(struct userspace_context *user,
47+
static int userspace_proxy_memory_init(struct userspace_context *user_ctx,
4848
const struct comp_driver *drv)
4949
{
5050
/* Add module private heap to memory partitions */
@@ -79,10 +79,10 @@ static int userspace_proxy_memory_init(struct userspace_context *user,
7979
&heap_part
8080
};
8181

82-
return k_mem_domain_init(user->comp_dom, ARRAY_SIZE(parts_ptr), parts_ptr);
82+
return k_mem_domain_init(user_ctx->comp_dom, ARRAY_SIZE(parts_ptr), parts_ptr);
8383
}
8484

85-
static int userspace_proxy_add_sections(struct userspace_context *user, uint32_t instance_id,
85+
static int userspace_proxy_add_sections(struct userspace_context *user_ctx, uint32_t instance_id,
8686
const struct sof_man_module *const mod)
8787
{
8888
struct k_mem_partition mem_partition;
@@ -103,7 +103,7 @@ static int userspace_proxy_add_sections(struct userspace_context *user, uint32_t
103103
mem_partition.start = mod->segment[idx].v_base_addr;
104104
mem_partition.size = mod->segment[idx].flags.r.length * CONFIG_MM_DRV_PAGE_SIZE;
105105

106-
ret = k_mem_domain_add_partition(user->comp_dom, &mem_partition);
106+
ret = k_mem_domain_add_partition(user_ctx->comp_dom, &mem_partition);
107107

108108
tr_dbg(&userspace_proxy_tr, "Add mod partition %p + %zx, attr = %u, ret = %d",
109109
UINT_TO_POINTER(mem_partition.start), mem_partition.size,
@@ -116,7 +116,7 @@ static int userspace_proxy_add_sections(struct userspace_context *user, uint32_t
116116
lib_manager_get_instance_bss_address(instance_id, mod, &va_base, &mem_partition.size);
117117
mem_partition.start = POINTER_TO_UINT(va_base);
118118
mem_partition.attr = K_MEM_PARTITION_P_RW_U_RW;
119-
ret = k_mem_domain_add_partition(user->comp_dom, &mem_partition);
119+
ret = k_mem_domain_add_partition(user_ctx->comp_dom, &mem_partition);
120120

121121
tr_dbg(&userspace_proxy_tr, "Add bss partition %p + %zx, attr = %u, ret = %d",
122122
UINT_TO_POINTER(mem_partition.start), mem_partition.size,
@@ -130,14 +130,14 @@ int userspace_proxy_create(struct userspace_context **user_ctx, const struct com
130130
const struct system_agent_params *agent_params,
131131
const void **agent_interface, const struct module_interface **ops)
132132
{
133-
struct userspace_context *user;
133+
struct userspace_context *context;
134134
struct k_mem_domain *domain;
135135
int ret;
136136

137137
tr_dbg(&userspace_proxy_tr, "userspace create");
138138

139-
user = k_heap_alloc(drv->user_heap, sizeof(struct userspace_context), K_FOREVER);
140-
if (!user)
139+
context = k_heap_alloc(drv->user_heap, sizeof(struct userspace_context), K_FOREVER);
140+
if (!context)
141141
return -ENOMEM;
142142

143143
/* Allocate memory domain struct */
@@ -146,13 +146,13 @@ int userspace_proxy_create(struct userspace_context **user_ctx, const struct com
146146
ret = -ENOMEM;
147147
goto error;
148148
}
149-
user->comp_dom = domain;
149+
context->comp_dom = domain;
150150

151-
ret = userspace_proxy_memory_init(user, drv);
151+
ret = userspace_proxy_memory_init(context, drv);
152152
if (ret)
153153
goto error_dom;
154154

155-
ret = userspace_proxy_add_sections(user, agent_params->instance_id, manifest);
155+
ret = userspace_proxy_add_sections(context, agent_params->instance_id, manifest);
156156
if (ret)
157157
goto error_dom;
158158

@@ -166,15 +166,15 @@ int userspace_proxy_create(struct userspace_context **user_ctx, const struct com
166166
}
167167
}
168168

169-
*user_ctx = user;
169+
*user_ctx = context;
170170

171171
/* Store a pointer to the module's interface. For the LMDK modules, the agent places a
172172
* pointer to the module interface at the address specified by agent_interface. Since this
173173
* points to ops, the assignment of the module interface used by this proxy must occur
174174
* after the agent has been started. For other module types, the ops parameter points to a
175175
* valid module interface.
176176
*/
177-
user->interface = *ops;
177+
context->interface = *ops;
178178

179179
/* All calls to the module interface must pass through the proxy. Set up our own interface.
180180
*/
@@ -185,7 +185,7 @@ int userspace_proxy_create(struct userspace_context **user_ctx, const struct com
185185
error_dom:
186186
rfree(domain);
187187
error:
188-
k_heap_free(drv->user_heap, user);
188+
k_heap_free(drv->user_heap, context);
189189
return ret;
190190
}
191191

0 commit comments

Comments
 (0)