* [PATCH] PCI: cadence: Fix find_first_zero_bit() limit
@ 2022-03-15 6:58 Dan Carpenter
2022-04-08 13:39 ` Lorenzo Pieralisi
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2022-03-15 6:58 UTC (permalink / raw)
To: Tom Joseph, Cyrille Pitchen
Cc: Lorenzo Pieralisi, Rob Herring, Krzysztof Wilczyński,
Bjorn Helgaas, linux-pci, kernel-janitors
The ep->ob_region_map bitmap is a long and it has BITS_PER_LONG bits.
Fixes: 37dddf14f1ae ("PCI: cadence: Add EndPoint Controller driver for Cadence PCIe controller")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/pci/controller/cadence/pcie-cadence-ep.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/pci/controller/cadence/pcie-cadence-ep.c b/drivers/pci/controller/cadence/pcie-cadence-ep.c
index 88e05b9c2e5b..18e32b8ffd5e 100644
--- a/drivers/pci/controller/cadence/pcie-cadence-ep.c
+++ b/drivers/pci/controller/cadence/pcie-cadence-ep.c
@@ -187,8 +187,7 @@ static int cdns_pcie_ep_map_addr(struct pci_epc *epc, u8 fn, u8 vfn,
struct cdns_pcie *pcie = &ep->pcie;
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);
if (r >= ep->max_regions - 1) {
dev_err(&epc->dev, "no free outbound region\n");
return -EINVAL;
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] PCI: cadence: Fix find_first_zero_bit() limit
2022-03-15 6:58 [PATCH] PCI: cadence: Fix find_first_zero_bit() limit Dan Carpenter
@ 2022-04-08 13:39 ` Lorenzo Pieralisi
0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Pieralisi @ 2022-04-08 13:39 UTC (permalink / raw)
To: Cyrille Pitchen, Dan Carpenter, Tom Joseph
Cc: Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas,
Krzysztof Wilczyński, kernel-janitors, linux-pci
On Tue, 15 Mar 2022 09:58:29 +0300, Dan Carpenter wrote:
> The ep->ob_region_map bitmap is a long and it has BITS_PER_LONG bits.
>
>
Applied to pci/cadence, thanks!
[1/1] PCI: cadence: Fix find_first_zero_bit() limit
https://git.kernel.org/lpieralisi/pci/c/0aa3a0937f
Thanks,
Lorenzo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-08 13:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-15 6:58 [PATCH] PCI: cadence: Fix find_first_zero_bit() limit Dan Carpenter
2022-04-08 13:39 ` Lorenzo Pieralisi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox