/* RETURNS: Pointer to the allocated pcpu_alloc_info on success, NULL on failure.  */
struct pcpu_alloc_info* __init pcpu_alloc_alloc_info(int nr_groups, int nr_units)
/* RETURNS: Pointer to the allocated pcpu_alloc_info on success, NULL on failure.  */
struct pcpu_alloc_info* __init pcpu_alloc_alloc_info(int nr_groups, int nr_units)
{
	struct pcpu_alloc_info *ai;
	size_t base_size, ai_size;
	void *ptr;
	int unit;
	base_size = ALIGN(sizeof(*ai) + nr_groups * sizeof(ai->groups[0]),
			  __alignof__(ai->groups[0].cpu_map[0]));
	ai_size = base_size + nr_units * sizeof(ai->groups[0].cpu_map[0]);
	ptr = alloc_bootmem_nopanic(PFN_ALIGN(ai_size));
	if (!ptr)
		return NULL;
	ai = ptr;
	ptr += base_size;
	ai->groups[0].cpu_map = ptr;
	for (unit = 0; unit < nr_units; unit++)
		ai->groups[0].cpu_map[unit] = NR_CPUS;
	ai->nr_groups = nr_groups;
	ai->__ai_size = PFN_ALIGN(ai_size);
	return ai;
}