Commit 6be6f852 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Bjorn Helgaas
Browse files

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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 35797e67
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -715,16 +715,12 @@ 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),
	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),
	ep->ob_window_map = devm_bitmap_zalloc(dev, pci->num_ob_windows,
					       GFP_KERNEL);
	if (!ep->ob_window_map)
		return -ENOMEM;