From patchwork Fri Apr 12 22:44:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 2438311 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 33CDB40060 for ; Fri, 12 Apr 2013 22:45:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755357Ab3DLWpW (ORCPT ); Fri, 12 Apr 2013 18:45:22 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:47249 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755334Ab3DLWpT (ORCPT ); Fri, 12 Apr 2013 18:45:19 -0400 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r3CMisKp032750 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 12 Apr 2013 22:44:55 GMT Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r3CMisOn024096 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 12 Apr 2013 22:44:54 GMT Received: from abhmt115.oracle.com (abhmt115.oracle.com [141.146.116.67]) by userz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r3CMir38010574; Fri, 12 Apr 2013 22:44:53 GMT Received: from linux-siqj.site (/10.132.126.191) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 12 Apr 2013 15:44:53 -0700 From: Yinghai Lu To: Bjorn Helgaas , Ram Pai Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Yinghai Lu , x86@kernel.org, Myron Stowe Subject: [PATCH v4 16/29] PCI, x86: Use for_each_pci_resource() with noassign_bars Date: Fri, 12 Apr 2013 15:44:30 -0700 Message-Id: <1365806683-26717-17-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1365806683-26717-1-git-send-email-yinghai@kernel.org> References: <1365806683-26717-1-git-send-email-yinghai@kernel.org> X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Replace those open code, and make code more readable. Signed-off-by: Yinghai Lu Cc: x86@kernel.org Cc: Myron Stowe --- arch/x86/pci/common.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index 901177d..a2afe2e 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c @@ -136,8 +136,7 @@ static void pcibios_fixup_device_resources(struct pci_dev *dev) * resource so the kernel doesn't attmept to assign * it later on in pci_assign_unassigned_resources */ - for (bar = 0; bar <= PCI_STD_RESOURCE_END; bar++) { - bar_r = &dev->resource[bar]; + for_each_pci_resource(dev, bar_r, bar, PCI_STD_RES) { if (bar_r->start == 0 && bar_r->end != 0) { bar_r->flags = 0; bar_r->end = 0;