Skip to content

Commit

Permalink
regions_mm: Use static initialization of the vmh_list list head
Browse files Browse the repository at this point in the history
A macro was used to statically initialize the vmh_list list head. This
allowed to resign from calling a function whose only task was to initialize
the list header. This function was removed as no needed anymore.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
  • Loading branch information
softwarecki authored and kv2019i committed May 24, 2024
1 parent 00664d0 commit cabc2e8
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions zephyr/lib/regions_mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
*/

#include <zephyr/init.h>

#include <sof/lib/regions_mm.h>

/* list of vmh_heap objects created */
static struct list_item vmh_list;
static struct list_item vmh_list = LIST_INIT(vmh_list);

/**
* @brief Initialize new heap
Expand Down Expand Up @@ -677,23 +676,6 @@ void vmh_get_default_heap_config(const struct sys_mm_drv_region *region,
}
}

/**
* @brief Initialization of static objects in virtual heaps API
*
* This will initialize lists of allocations and physical mappings.
*
* @param unused Variable is unused - needed by arch to clear warning.
*
* @retval Returns 0 on success
*/
static int virtual_heaps_init(void)
{
list_init(&vmh_list);
return 0;
}

SYS_INIT(virtual_heaps_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY);

/**
* @brief Gets pointer to already created heap identified by
* provided attribute.
Expand Down

0 comments on commit cabc2e8

Please sign in to comment.