Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1257373

[PATCH v8 53/61] PCI: Kill macro checking for bus io port sizing

From Yinghai Lu <yinghai@kernel.org>
Newsgroups linux.kernel
Subject [PATCH v8 53/61] PCI: Kill macro checking for bus io port sizing
Date 2015-10-27 23:00 +0100
Message-ID <qokrI-25s-87@gated-at.bofh.it> (permalink)
References <qojvA-1tZ-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


We can use new generic version skip_isa_ioresource_align() instead
of macro, and then kill the marco.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 drivers/pci/setup-bus.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index f1c7b46..419eaaf 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -1160,15 +1160,12 @@ int skip_isa_ioresource_align(struct pci_bus *bus)
 	return 0;
 }
 
-static resource_size_t size_aligned_for_isa(resource_size_t size)
+static resource_size_t size_aligned_for_isa(resource_size_t size,
+					    struct pci_bus *bus)
 {
-	/*
-	 * To be fixed in 2.5: we should have sort of HAVE_ISA
-	 *  flag in the struct pci_bus.
-	 */
-#if defined(CONFIG_ISA) || defined(CONFIG_EISA)
-	size = (size & 0xff) + ((size & ~0xffUL) << 2);
-#endif
+	if (!skip_isa_ioresource_align(bus))
+		size = (size & 0xff) + ((size & ~0xffUL) << 2);
+
 	return size;
 }
 
@@ -1237,12 +1234,12 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size,
 		}
 	}
 
-	size = size_aligned_for_isa(size);
+	size = size_aligned_for_isa(size, bus);
 	size += size1;
 	if (size || min_size)
 		size0 = calculate_size(size, min_size,
 					resource_size(b_res), min_align);
-	sum_add_size = size_aligned_for_isa(sum_add_size);
+	sum_add_size = size_aligned_for_isa(sum_add_size, bus);
 	sum_add_size += sum_add_size1;
 	if (sum_add_size < min_sum_size)
 		sum_add_size = min_sum_size;
-- 
1.8.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v8 00/61] PCI: Resource allocation cleanup for v4.4 Yinghai Lu <yinghai@kernel.org> - 2015-10-27 22:20 +0100
  [PATCH v8 26/61] PCI: Use correct align for optional only resources during sorting Yinghai Lu <yinghai@kernel.org> - 2015-10-27 22:20 +0100
  [PATCH v8 30/61] PCI: Reorder resources list for required/optional resources Yinghai Lu <yinghai@kernel.org> - 2015-10-27 22:20 +0100
  [PATCH v8 15/61] PCI: Only treat non-pref mmio64 as pref if host bridge has mmio64 Yinghai Lu <yinghai@kernel.org> - 2015-10-27 22:20 +0100
  [PATCH v8 33/61] PCI: Treat ROM resource as optional during realloc Yinghai Lu <yinghai@kernel.org> - 2015-10-27 22:20 +0100
  [PATCH v8 07/61] PCI: Kill wrong quirk about M7101 Yinghai Lu <yinghai@kernel.org> - 2015-10-27 22:20 +0100
  [PATCH v8 08/61] PCI: Ignore BAR for ALi M1533 PCI-ISA bridge Yinghai Lu <yinghai@kernel.org> - 2015-10-27 22:20 +0100
  [PATCH v8 05/61] sparc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsing Yinghai Lu <yinghai@kernel.org> - 2015-10-27 22:20 +0100
  [PATCH v8 29/61] PCI: Don't add too much optional size for hotplug bridge MMIO Yinghai Lu <yinghai@kernel.org> - 2015-10-27 22:20 +0100
  [PATCH v8 23/61] PCI: Don't release sibling bridge resources during hotplug Yinghai Lu <yinghai@kernel.org> - 2015-10-27 22:20 +0100
  [PATCH v8 50/61] PCI: Unify calculate_size() for io port and MMIO Yinghai Lu <yinghai@kernel.org> - 2015-10-27 23:00 +0100
  [PATCH v8 32/61] PCI: Rename pdev_sort_resources() to pdev_assign_resources_prepare() Yinghai Lu <yinghai@kernel.org> - 2015-10-27 23:00 +0100
  [PATCH v8 53/61] PCI: Kill macro checking for bus io port sizing Yinghai Lu <yinghai@kernel.org> - 2015-10-27 23:00 +0100
  Re: [PATCH v8 00/61] PCI: Resource allocation cleanup for v4.4 Yinghai Lu <yinghai@kernel.org> - 2015-10-31 03:00 +0100

csiph-web