Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756136AbbGFXkc (ORCPT ); Mon, 6 Jul 2015 19:40:32 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:17100 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756016AbbGFXkX (ORCPT ); Mon, 6 Jul 2015 19:40:23 -0400 From: Yinghai Lu To: Bjorn Helgaas , David Miller , David Ahern , Benjamin Herrenschmidt , Wei Yang , TJ , Yijing Wang Cc: Andrew Morton , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Yinghai Lu Subject: [PATCH 02/36] PCI: Reuse res_to_dev_res in reassign_resources_sorted Date: Mon, 6 Jul 2015 16:38:52 -0700 Message-Id: <1436225966-27247-3-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1436225966-27247-1-git-send-email-yinghai@kernel.org> References: <1436225966-27247-1-git-send-email-yinghai@kernel.org> X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1411 Lines: 48 Now res_to_dev_res() does not print out debug message anymore, so reuse it in reassign_resource_sorted(). Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index f0fa705..247d8fe 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -240,26 +240,17 @@ static void reassign_resources_sorted(struct list_head *realloc_head, { struct resource *res; struct pci_dev_resource *add_res, *tmp; - struct pci_dev_resource *dev_res; resource_size_t add_size, align; int idx; list_for_each_entry_safe(add_res, tmp, realloc_head, list) { - bool found_match = false; - res = add_res->res; /* skip resource that has been reset */ if (!res->flags) goto out; /* skip this resource if not found in head list */ - list_for_each_entry(dev_res, head, list) { - if (dev_res->res == res) { - found_match = true; - break; - } - } - if (!found_match)/* just skip */ + if (!res_to_dev_res(head, res)) continue; idx = res - &add_res->dev->resource[0]; -- 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/