Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757501AbcDHAT1 (ORCPT ); Thu, 7 Apr 2016 20:19:27 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:35308 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757362AbcDHATT (ORCPT ); Thu, 7 Apr 2016 20:19:19 -0400 From: Yinghai Lu To: Bjorn Helgaas , David Miller , Benjamin Herrenschmidt , Linus Torvalds Cc: Wei Yang , TJ , Yijing Wang , Khalid Aziz , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Yinghai Lu Subject: [PATCH v11 40/60] PCI: Move comment to pci_need_to_release() Date: Thu, 7 Apr 2016 17:15:53 -0700 Message-Id: <1460074573-7481-41-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1460074573-7481-1-git-send-email-yinghai@kernel.org> References: <1460074573-7481-1-git-send-email-yinghai@kernel.org> X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2116 Lines: 56 Move comment from caller to pci_need_to_release(), as we will have one new caller for alt_size support. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 1571245..b4eb37d 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -414,6 +414,20 @@ static unsigned long pci_fail_res_type_mask(struct list_head *fail_head) static bool pci_need_to_release(unsigned long mask, struct resource *res) { + /* + * Separate three resource type checking if we need to release + * assigned resource. + * 1. if there is io port assign fail, will release assigned + * io port. + * 2. if there is pref mmio assign fail, release assigned + * pref mmio. + * if assigned pref mmio's parent is non-pref mmio and there + * is non-pref mmio assign fail, will release that assigned + * pref mmio. + * 3. if there is non-pref mmio assign fail or pref mmio + * assigned fail, will release assigned non-pref mmio. + */ + if (res->flags & IORESOURCE_IO) return !!(mask & IORESOURCE_IO); @@ -470,19 +484,8 @@ static void __assign_resources_sorted(struct list_head *head, * if could do that, could get out early. * if could not do that, we still try to assign requested at first, * then try to reassign add_size for some resources. - * - * Separate three resource type checking if we need to release - * assigned resource after requested + add_size try. - * 1. if there is io port assign fail, will release assigned - * io port. - * 2. if there is pref mmio assign fail, release assigned - * pref mmio. - * if assigned pref mmio's parent is non-pref mmio and there - * is non-pref mmio assign fail, will release that assigned - * pref mmio. - * 3. if there is non-pref mmio assign fail or pref mmio - * assigned fail, will release assigned non-pref mmio. */ + LIST_HEAD(save_head); LIST_HEAD(local_fail_head); struct pci_dev_resource *save_res; -- 1.8.4.5