Skip to content

Commit 389e7e1

Browse files
author
Jyri Sarha
committed
modules: mod_alloc: mod_alloc size and alignment parameter to size_t
Change mod_alloc_align and friends size and alignment parameters type to size_t. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
1 parent e278ee7 commit 389e7e1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/audio/module_adapter/module/generic.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ static void container_put(struct processing_module *mod, struct module_resource
168168
*
169169
* The allocated memory is automatically freed when the module is unloaded.
170170
*/
171-
void *mod_alloc_align(struct processing_module *mod, uint32_t size, uint32_t alignment)
171+
void *mod_alloc_align(struct processing_module *mod, size_t size, size_t alignment)
172172
{
173173
struct module_resource *container = container_get(mod);
174174
struct module_resources *res = &mod->priv.resources;
@@ -191,7 +191,7 @@ void *mod_alloc_align(struct processing_module *mod, uint32_t size, uint32_t ali
191191
ptr = rmalloc_align(SOF_MEM_FLAG_USER, size, alignment);
192192
#endif
193193
if (!ptr) {
194-
comp_err(mod->dev, "Failed to alloc %d bytes %d alignment for comp %x.",
194+
comp_err(mod->dev, "Failed to alloc %zu bytes %zu alignment for comp %#x.",
195195
size, alignment, dev_comp_id(mod->dev));
196196
container_put(mod, container);
197197
return NULL;
@@ -219,7 +219,7 @@ EXPORT_SYMBOL(mod_alloc_align);
219219
* Like mod_alloc_align() but the alignment can not be specified. However,
220220
* rballoc() will always aligns the memory to PLATFORM_DCACHE_ALIGN.
221221
*/
222-
void *mod_alloc(struct processing_module *mod, uint32_t size)
222+
void *mod_alloc(struct processing_module *mod, size_t size)
223223
{
224224
return mod_alloc_align(mod, size, 0);
225225
}
@@ -233,7 +233,7 @@ EXPORT_SYMBOL(mod_alloc);
233233
*
234234
* Like mod_alloc() but the allocated memory is initialized to zero.
235235
*/
236-
void *mod_zalloc(struct processing_module *mod, uint32_t size)
236+
void *mod_zalloc(struct processing_module *mod, size_t size)
237237
{
238238
void *ret = mod_alloc(mod, size);
239239

src/include/sof/audio/module_adapter/module/generic.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ struct module_processing_data {
188188
/*****************************************************************************/
189189
int module_load_config(struct comp_dev *dev, const void *cfg, size_t size);
190190
int module_init(struct processing_module *mod);
191-
void *mod_alloc_align(struct processing_module *mod, uint32_t size, uint32_t alignment);
192-
void *mod_alloc(struct processing_module *mod, uint32_t size);
193-
void *mod_zalloc(struct processing_module *mod, uint32_t size);
191+
void *mod_alloc_align(struct processing_module *mod, size_t size, size_t alignment);
192+
void *mod_alloc(struct processing_module *mod, size_t size);
193+
void *mod_zalloc(struct processing_module *mod, size_t size);
194194
int mod_free(struct processing_module *mod, const void *ptr);
195195
#if CONFIG_COMP_BLOB
196196
struct comp_data_blob_handler *mod_data_blob_handler_new(struct processing_module *mod);

0 commit comments

Comments
 (0)