We can merge region B onto region A only if base of region A is
aligned to region A order + 1.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Xiang W <wxjstz@126.com>
if (!nreg1->order)
continue;
- if ((nreg->base + BIT(nreg->order)) == nreg1->base &&
+ if (!(nreg->base & (BIT(nreg->order + 1) - 1)) &&
+ (nreg->base + BIT(nreg->order)) == nreg1->base &&
nreg->order == nreg1->order &&
nreg->flags == nreg1->flags) {
nreg->order++;