Skip to content

Commit 49f5d6e

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 7fffe2c commit 49f5d6e

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

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;
@@ -188,7 +188,7 @@ void *mod_alloc_align(struct processing_module *mod, uint32_t size, uint32_t ali
188188
ptr = rmalloc_align(SOF_MEM_FLAG_USER, size, alignment);
189189

190190
if (!ptr) {
191-
comp_err(mod->dev, "Failed to alloc %d bytes %d alignment for comp %x.",
191+
comp_err(mod->dev, "Failed to alloc %zu bytes %zu alignment for comp %#x.",
192192
size, alignment, dev_comp_id(mod->dev));
193193
container_put(mod, container);
194194
return NULL;
@@ -216,7 +216,7 @@ EXPORT_SYMBOL(mod_alloc_align);
216216
* Like mod_alloc_align() but the alignment can not be specified. However,
217217
* rballoc() will always aligns the memory to PLATFORM_DCACHE_ALIGN.
218218
*/
219-
void *mod_alloc(struct processing_module *mod, uint32_t size)
219+
void *mod_alloc(struct processing_module *mod, size_t size)
220220
{
221221
return mod_alloc_align(mod, size, 0);
222222
}
@@ -230,7 +230,7 @@ EXPORT_SYMBOL(mod_alloc);
230230
*
231231
* Like mod_alloc() but the allocated memory is initialized to zero.
232232
*/
233-
void *mod_zalloc(struct processing_module *mod, uint32_t size)
233+
void *mod_zalloc(struct processing_module *mod, size_t size)
234234
{
235235
void *ret = mod_alloc(mod, size);
236236

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)