From patchwork Tue Feb 15 01:43:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ram Pai X-Patchwork-Id: 557461 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1F1i4Qm017582 for ; Tue, 15 Feb 2011 01:44:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754071Ab1BOBnn (ORCPT ); Mon, 14 Feb 2011 20:43:43 -0500 Received: from e6.ny.us.ibm.com ([32.97.182.146]:58996 "EHLO e6.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754055Ab1BOBnm (ORCPT ); Mon, 14 Feb 2011 20:43:42 -0500 Received: from d01dlp02.pok.ibm.com (d01dlp02.pok.ibm.com [9.56.224.85]) by e6.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p1F1TcrQ024153; Mon, 14 Feb 2011 20:29:38 -0500 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 5810C4DE8026; Mon, 14 Feb 2011 20:42:41 -0500 (EST) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p1F1hfUN166748; Mon, 14 Feb 2011 20:43:41 -0500 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p1F1herS019316; Mon, 14 Feb 2011 18:43:41 -0700 Received: from us.ibm.com (ram-laptop.beaverton.ibm.com [9.47.25.174]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id p1F1hcqM019223; Mon, 14 Feb 2011 18:43:38 -0700 Received: by us.ibm.com (sSMTP sendmail emulation); Mon, 14 Feb 2011 17:43:37 -0800 From: Ram Pai To: linux-pci@vger.kernel.org, jbarnes@virtuousgeek.org Cc: Ram Pai , linux-kernel@vger.kernel.org, clemens@ladisch.de, Yinghai Lu , Linus Torvalds , Bjorn Helgaas Subject: [PATCH 3/4] PCI: introduce reset_resource() Date: Mon, 14 Feb 2011 17:43:19 -0800 Message-Id: <1297734200-23327-4-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1297734200-23327-1-git-send-email-linuxram@us.ibm.com> References: <1297734200-23327-1-git-send-email-linuxram@us.ibm.com> X-Content-Scanned: Fidelis XPS MAILER Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 15 Feb 2011 01:44:04 +0000 (UTC) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index bcf5752..a94ecc1 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -88,6 +88,13 @@ static void __dev_sort_resources(struct pci_dev *dev, pdev_sort_resources(dev, head); } +static inline void reset_resource(struct resource *res) +{ + res->start = 0; + res->end = 0; + res->flags = 0; +} + static void __assign_resources_sorted(struct resource_list *head, struct resource_list_x *fail_head) { @@ -109,9 +116,7 @@ static void __assign_resources_sorted(struct resource_list *head, (!(res->flags & IORESOURCE_ROM_ENABLE)))) add_to_failed_list(fail_head, list->dev, res); } - res->start = 0; - res->end = 0; - res->flags = 0; + reset_resource(res); } tmp = list; list = list->next;