/* RETURNS: New target map allocation length if extension is necessary, 0 otherwise.  */
static int pcpu_need_to_extend(struct pcpu_chunk *chunk)
/* RETURNS: New target map allocation length if extension is necessary, 0 otherwise.  */
static int pcpu_need_to_extend(struct pcpu_chunk *chunk)
{
	int new_alloc;
	if (chunk->map_alloc >= chunk->map_used + 2)
		return 0;
	new_alloc = PCPU_DFL_MAP_ALLOC;
	while (new_alloc < chunk->map_used + 2)
		new_alloc *= 2;
	return new_alloc;
}