PCI: brcmstb: Fix build on 32bit ARM platforms with older compilers
authorMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 27 Feb 2020 11:51:46 +0000 (12:51 +0100)
committerpopcornmix <popcornmix@gmail.com>
Wed, 1 Jul 2020 15:33:26 +0000 (16:33 +0100)
commit57028414e11b82b415269445d7e1be8a222d0d8f
tree3d4423e28d31cc3de917882416b300a6fa40efcc
parente96ae6856ca75e1375dc0bd5951593868071ec2b
PCI: brcmstb: Fix build on 32bit ARM platforms with older compilers

commit 73a7a271b3eee7b83f29b13866163776f1cbef89 upstream.

Some older compilers have no implementation for the helper for 64-bit
unsigned division/modulo, so linking pcie-brcmstb driver causes the
"undefined reference to `__aeabi_uldivmod'" error.

*rc_bar2_size is always a power of two, because it is calculated as:
"1ULL << fls64(entry->res->end - entry->res->start)", so the modulo
operation in the subsequent check can be replaced by a simple logical
AND with a proper mask.

Link: https://lore.kernel.org/r/20200227115146.24515-1-m.szyprowski@samsung.com
Fixes: c0452137034b ("PCI: brcmstb: Add Broadcom STB PCIe host controller driver")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
drivers/pci/controller/pcie-brcmstb.c