Thread (36 messages) 36 messages, 5 authors, 2024-08-20

Re: [PATCH 8/9] vdap: solidrun: Replace deprecated PCI functions

From: Andy Shevchenko <andy@kernel.org>
Date: 2024-08-19 18:32:13
Also in: linux-arm-kernel, linux-block, linux-doc, linux-fpga, linux-gpio, linux-pci, lkml, virtualization

On Mon, Aug 19, 2024 at 06:51:48PM +0200, Philipp Stanner wrote:
solidrun utilizes pcim_iomap_regions(), which has been deprecated by the
PCI subsystem in commit e354bb84a4c1 ("PCI: Deprecate
pcim_iomap_table(), pcim_iomap_regions_request_all()"), among other
things because it forces usage of quite a complicated bitmask mechanism.
The bitmask handling code can entirely be removed by replacing
pcim_iomap_regions() and pcim_iomap_table().

Replace pcim_iomap_regions() and pcim_iomap_table() with
pci_iomap_region().
...
-	int ret, i, mask = 0;
+	int i;
Make it signed?

...
 	for (i = 0; i < PCI_STD_NUM_BARS; i++) {
+		if (pci_resource_len(pdev, i)) {
+			psnet->bars[i] = pcim_iomap_region(pdev, i, name);
+			if (IS_ERR(psnet->bars[i])) {
+				SNET_ERR(pdev, "Failed to request and map PCI BARs\n");
+				return PTR_ERR(psnet->bars[i]);
+			}
+		}
 
Blank line leftover.
 	}
-- 
With Best Regards,
Andy Shevchenko

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help