Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d5096850 authored by Konrad Rzeszutek Wilk's avatar Konrad Rzeszutek Wilk
Browse files

xen/p2m: Collapse early_alloc_p2m_middle redundant checks.



At the start of the function we were checking for idx != 0
and bailing out. And later calling extend_brk if idx != 0.

That is unnecessary so remove that checks.

Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent cef4cca5
Loading
Loading
Loading
Loading
+12 −13
Original line number Diff line number Diff line
@@ -502,6 +502,8 @@ static bool alloc_p2m(unsigned long pfn)
static bool __init early_alloc_p2m_middle(unsigned long pfn, bool check_boundary)
{
	unsigned topidx, mididx, idx;
	unsigned long *p2m;
	unsigned long *mid_mfn_p;

	topidx = p2m_top_index(pfn);
	mididx = p2m_mid_index(pfn);
@@ -522,9 +524,7 @@ static bool __init early_alloc_p2m_middle(unsigned long pfn, bool check_boundary
		return false;

	/* Boundary cross-over for the edges: */
	if (idx) {
		unsigned long *p2m = extend_brk(PAGE_SIZE, PAGE_SIZE);
		unsigned long *mid_mfn_p;
	p2m = extend_brk(PAGE_SIZE, PAGE_SIZE);

	p2m_init(p2m);

@@ -538,8 +538,7 @@ static bool __init early_alloc_p2m_middle(unsigned long pfn, bool check_boundary
		topidx, mididx);
	mid_mfn_p[mididx] = virt_to_mfn(p2m);

	}
	return idx != 0;
	return true;
}

static bool __init early_alloc_p2m(unsigned long pfn)