提交 6be6f852 编写于 作者: C Christophe JAILLET 提交者: Bjorn Helgaas

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.frSigned-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
上级 35797e67
...@@ -715,17 +715,13 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) ...@@ -715,17 +715,13 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep)
dw_pcie_iatu_detect(pci); dw_pcie_iatu_detect(pci);
ep->ib_window_map = devm_kcalloc(dev, ep->ib_window_map = devm_bitmap_zalloc(dev, pci->num_ib_windows,
BITS_TO_LONGS(pci->num_ib_windows), GFP_KERNEL);
sizeof(long),
GFP_KERNEL);
if (!ep->ib_window_map) if (!ep->ib_window_map)
return -ENOMEM; return -ENOMEM;
ep->ob_window_map = devm_kcalloc(dev, ep->ob_window_map = devm_bitmap_zalloc(dev, pci->num_ob_windows,
BITS_TO_LONGS(pci->num_ob_windows), GFP_KERNEL);
sizeof(long),
GFP_KERNEL);
if (!ep->ob_window_map) if (!ep->ob_window_map)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册