/* Convert memory chunk array to a memory segment list so there is a single list that contains both r/w memory and shared memory segments.  */
static int __init vmem_convert_memory_chunk(void)
/* Convert memory chunk array to a memory segment list so there is a single list that contains both r/w memory and shared memory segments.  */
static int __init vmem_convert_memory_chunk(void)
{
	struct memory_segment *seg;
	int i;
	mutex_lock(&vmem_mutex);
	for (i = 0; i < MEMORY_CHUNKS; i++) {
		if (!memory_chunk[i].size)
			continue;
		seg = kzalloc(sizeof(*seg), GFP_KERNEL);
		if (!seg)
			panic("Out of memory...\n");
		seg->start = memory_chunk[i].addr;
		seg->size = memory_chunk[i].size;
		insert_memory_segment(seg);
	}
	mutex_unlock(&vmem_mutex);
	return 0;
}