diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2022-07-09 16:10:52 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2022-08-01 22:15:32 +0200 |
commit | 6be6f8529bd7f3eb40a5f061badfc230e6a9fc9c (patch) | |
tree | 922bc22e4d19839100aa006eee68a05362590048 /drivers/pci/controller/dwc/pcie-designware-ep.c | |
parent | PCI: dwc: Fix MSI msi_msg DMA mapping (diff) | |
download | linux-6be6f8529bd7f3eb40a5f061badfc230e6a9fc9c.tar.xz linux-6be6f8529bd7f3eb40a5f061badfc230e6a9fc9c.zip |
PCI: dwc: Use the bitmap API to allocate bitmaps
Use devm_bitmap_zalloc() instead of hand-writing them.
It is less verbose and it improves the semantic.
Link: https://lore.kernel.org/r/bc6586a603abc0db7d4531308b698fbe7a6d7083.1657375829.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/controller/dwc/pcie-designware-ep.c')
-rw-r--r-- | drivers/pci/controller/dwc/pcie-designware-ep.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c index 627c4b69878c..cf1627679716 100644 --- a/drivers/pci/controller/dwc/pcie-designware-ep.c +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c @@ -715,17 +715,13 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) dw_pcie_iatu_detect(pci); - ep->ib_window_map = devm_kcalloc(dev, - BITS_TO_LONGS(pci->num_ib_windows), - sizeof(long), - GFP_KERNEL); + ep->ib_window_map = devm_bitmap_zalloc(dev, pci->num_ib_windows, + GFP_KERNEL); if (!ep->ib_window_map) return -ENOMEM; - ep->ob_window_map = devm_kcalloc(dev, - BITS_TO_LONGS(pci->num_ob_windows), - sizeof(long), - GFP_KERNEL); + ep->ob_window_map = devm_bitmap_zalloc(dev, pci->num_ob_windows, + GFP_KERNEL); if (!ep->ob_window_map) return -ENOMEM; |