From: Ram Pai <linuxram@us.ibm.com>
To: linux-pci@vger.kernel.org, jbarnes@virtuousgeek.org
Cc: Ram Pai <linuxram@us.ibm.com>,
linux-kernel@vger.kernel.org, clemens@ladisch.de,
Yinghai Lu <yinghai@kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Bjorn Helgaas <bjorn.helgaas@hp.com>
Subject: [PATCH 3/4] PCI: introduce reset_resource()
Date: Mon, 14 Feb 2011 17:43:19 -0800 [thread overview]
Message-ID: <1297734200-23327-4-git-send-email-linuxram@us.ibm.com> (raw)
In-Reply-To: <1297734200-23327-1-git-send-email-linuxram@us.ibm.com>
introduced reset_resource() which factors out resource reset logic.
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
---
drivers/pci/setup-bus.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
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;
--
1.6.5.2
next prev parent reply other threads:[~2011-02-15 1:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-15 1:43 [PATCH 0/4] PCI: preallocate resource patch series Ram Pai
2011-02-15 1:43 ` [PATCH 1/4] PCI: refactor io size calculation code Ram Pai
2011-02-15 1:43 ` [PATCH 2/4] PCI: data structure agnostic free list function Ram Pai
2011-02-15 1:43 ` Ram Pai [this message]
2011-02-25 22:56 ` [PATCH 3/4] PCI: introduce reset_resource() Jesse Barnes
2011-02-15 1:43 ` [PATCH 4/4] PCI: pre-allocate additional resources to devices only after successful allocation of essential resources Ram Pai
2011-03-04 18:47 ` Jesse Barnes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1297734200-23327-4-git-send-email-linuxram@us.ibm.com \
--to=linuxram@us.ibm.com \
--cc=bjorn.helgaas@hp.com \
--cc=clemens@ladisch.de \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=yinghai@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.