Skip to contentSkip to conversation

PCI: rockchip: fix find_first_zero_bit() limit

PATCH Applied Dan Carpenter 2 participants 2 messages Mar 15, 2022 – Apr 8, 2022

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: rockchip: fix find_first_zero_bit() limit

The ep->ob_region_map bitmap is a long and it has BITS_PER_LONG bits.

Fixes cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller")
---
 drivers/pci/controller/pcie-rockchip-ep.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pci/controller/pcie-rockchip-ep.c +1 -2
index 5fb9ce6e536e..d1a200b93b2b 100644
@@ -264,8 +264,7 @@ static int rockchip_pcie_ep_map_addr(struct pci_epc *epc, u8 fn, u8 vfn,
 	struct rockchip_pcie *pcie = &ep->rockchip;
 	u32 r;
 
-	r = find_first_zero_bit(&ep->ob_region_map,
-				sizeof(ep->ob_region_map) * BITS_PER_LONG);
+	r = find_first_zero_bit(&ep->ob_region_map, BITS_PER_LONG);
 	/*
 	 * Region 0 is reserved for configuration space and shouldn't
 	 * be used elsewhere per TRM, so leave it out.
Signature · 7 lines
2.20.1


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip