/* Initialize kernel memory slab subsystem. 
Perform any initialization of memory slabs that wasn't done at build time. Currently this just involves creating the list of free blocks for each slab. */
static int create_free_list(struct k_mem_slab *slab)
/* Initialize kernel memory slab subsystem. 
Perform any initialization of memory slabs that wasn't done at build time. Currently this just involves creating the list of free blocks for each slab. */
static int create_free_list(struct k_mem_slab *slab)
{
	uint32_t j;
	char *p;
	CHECKIF(((slab->info.block_size | (uintptr_t)slab->buffer) &
				(sizeof(void *) - 1)) != 0U) {
		return -EINVAL;
	}
	slab->free_list = NULL;
	p = slab->buffer;
	for (j = 0U; j < slab->info.num_blocks; j++) {
		*(char **)p = slab->free_list;
		slab->free_list = p;
		p += slab->info.block_size;
	}
	return 0;
}