Path: csiph.com!news.mixmin.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod From: Yinghai Lu Newsgroups: linux.kernel Subject: [PATCH v11 25/60] PCI: Reuse res_to_dev_res() in reassign_resources_sorted() Date: Fri, 08 Apr 2016 02:30:03 +0200 Message-ID: References: X-Original-To: Bjorn Helgaas , David Miller , Benjamin Herrenschmidt , Linus Torvalds X-Mailer: git-send-email 1.8.4.5 X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 42 Organization: linux.* mail to news gateway X-Original-Cc: Wei Yang , TJ , Yijing Wang , Khalid Aziz , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Yinghai Lu X-Original-Date: Thu, 7 Apr 2016 17:15:38 -0700 X-Original-Message-ID: <1460074573-7481-26-git-send-email-yinghai@kernel.org> X-Original-References: <1460074573-7481-1-git-send-email-yinghai@kernel.org> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1373868 Now res_to_dev_res() does not print out debug message anymore, so we can reuse it in reassign_resource_sorted() without confusing printout. 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 dd33234..fc30f80 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -239,26 +239,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