If there are no memory allocations for a given type then the "max" bar
size is zero. However, ALIGN_DOWN does not handle an alignment of
zero properly. Catch and handle the zero case.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
}
}
-#define ROOT_BASE(top, sum, align) ALIGN_DOWN((top)-(sum),(align))
+#define ROOT_BASE(top, sum, max) ALIGN_DOWN((top)-(sum),(max) ?: 1)
static int pci_bios_init_root_regions(u32 start, u32 end)
{