Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754489AbbLKFKb (ORCPT ); Fri, 11 Dec 2015 00:10:31 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:41004 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752607AbbLKFKV (ORCPT ); Fri, 11 Dec 2015 00:10:21 -0500 From: Yinghai Lu To: Bjorn Helgaas , David Miller , Benjamin Herrenschmidt , Wei Yang , TJ , Yijing Wang , Khalid Aziz Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Yinghai Lu Subject: [PATCH v9 52/60] PCI: Kill macro checking for bus io port sizing Date: Thu, 10 Dec 2015 21:06:48 -0800 Message-Id: <1449810416-2950-53-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1449810416-2950-1-git-send-email-yinghai@kernel.org> References: <1449810416-2950-1-git-send-email-yinghai@kernel.org> X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1765 Lines: 56 We can use new generic version skip_isa_ioresource_align() instead of macro, and then kill the marco. Signed-off-by: Yinghai Lu --- 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 a329efe..cfded80 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/