Skip to content

Commit 73a7a27

Browse files
mszyprowbjorn-helgaas
authored andcommitted
PCI: brcmstb: Fix build on 32bit ARM platforms with older compilers
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/[email protected] Fixes: c045213 ("PCI: brcmstb: Add Broadcom STB PCIe host controller driver") Signed-off-by: Marek Szyprowski <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Nicolas Saenz Julienne <[email protected]> Acked-by: Lorenzo Pieralisi <[email protected]>
1 parent bb6d3fb commit 73a7a27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/controller/pcie-brcmstb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ static inline int brcm_pcie_get_rc_bar2_size_and_offset(struct brcm_pcie *pcie,
670670
* outbound memory @ 3GB). So instead it will start at the 1x
671671
* multiple of its size
672672
*/
673-
if (!*rc_bar2_size || *rc_bar2_offset % *rc_bar2_size ||
673+
if (!*rc_bar2_size || (*rc_bar2_offset & (*rc_bar2_size - 1)) ||
674674
(*rc_bar2_offset < SZ_4G && *rc_bar2_offset > SZ_2G)) {
675675
dev_err(dev, "Invalid rc_bar2_offset/size: size 0x%llx, off 0x%llx\n",
676676
*rc_bar2_size, *rc_bar2_offset);

0 commit comments

Comments
 (0)