From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI patches for 2.6.10
Date: Mon, 10 Jan 2005 09:20:56 -0800 [thread overview]
Message-ID: <11053776562095@kroah.com> (raw)
In-Reply-To: <11053776561347@kroah.com>
ChangeSet 1.1938.439.46, 2005/01/07 10:33:32-08:00, eike-hotplug@sf-tec.de
[PATCH] PCI Hotplug: use PCI_DEVFN in ibmphp_pci.c
This patch changes ibmphp_pci.c to use the PCI_DEVFN makro where possible
instead of doing the match itself.
Signed-off-by: Rolf Eike Beer <eike-hotplug@sf-tec.de>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/pci/hotplug/ibmphp_pci.c | 23 ++++++++++++++---------
1 files changed, 14 insertions(+), 9 deletions(-)
diff -Nru a/drivers/pci/hotplug/ibmphp_pci.c b/drivers/pci/hotplug/ibmphp_pci.c
--- a/drivers/pci/hotplug/ibmphp_pci.c 2005-01-10 08:58:49 -08:00
+++ b/drivers/pci/hotplug/ibmphp_pci.c 2005-01-10 08:58:49 -08:00
@@ -414,7 +414,7 @@
memset (io[count], 0, sizeof (struct resource_node));
io[count]->type = IO;
io[count]->busno = func->busno;
- io[count]->devfunc = ((func->device << 3) | (func->function & 0x7));
+ io[count]->devfunc = PCI_DEVFN(func->device, func->function);
io[count]->len = len[count];
if (ibmphp_check_resource(io[count], 0) == 0) {
ibmphp_add_resource (io[count]);
@@ -452,7 +452,8 @@
memset (pfmem[count], 0, sizeof (struct resource_node));
pfmem[count]->type = PFMEM;
pfmem[count]->busno = func->busno;
- pfmem[count]->devfunc = ((func->device << 3) | (func->function & 0x7));
+ pfmem[count]->devfunc = PCI_DEVFN(func->device,
+ func->function);
pfmem[count]->len = len[count];
pfmem[count]->fromMem = FALSE;
if (ibmphp_check_resource (pfmem[count], 0) == 0) {
@@ -519,7 +520,8 @@
memset (mem[count], 0, sizeof (struct resource_node));
mem[count]->type = MEM;
mem[count]->busno = func->busno;
- mem[count]->devfunc = ((func->device << 3) | (func->function & 0x7));
+ mem[count]->devfunc = PCI_DEVFN(func->device,
+ func->function);
mem[count]->len = len[count];
if (ibmphp_check_resource (mem[count], 0) == 0) {
ibmphp_add_resource (mem[count]);
@@ -685,7 +687,8 @@
memset (bus_io[count], 0, sizeof (struct resource_node));
bus_io[count]->type = IO;
bus_io[count]->busno = func->busno;
- bus_io[count]->devfunc = ((func->device << 3) | (func->function & 0x7));
+ bus_io[count]->devfunc = PCI_DEVFN(func->device,
+ func->function);
bus_io[count]->len = len[count];
if (ibmphp_check_resource (bus_io[count], 0) == 0) {
ibmphp_add_resource (bus_io[count]);
@@ -717,7 +720,8 @@
memset (bus_pfmem[count], 0, sizeof (struct resource_node));
bus_pfmem[count]->type = PFMEM;
bus_pfmem[count]->busno = func->busno;
- bus_pfmem[count]->devfunc = ((func->device << 3) | (func->function & 0x7));
+ bus_pfmem[count]->devfunc = PCI_DEVFN(func->device,
+ func->function);
bus_pfmem[count]->len = len[count];
bus_pfmem[count]->fromMem = FALSE;
if (ibmphp_check_resource (bus_pfmem[count], 0) == 0) {
@@ -775,7 +779,8 @@
memset (bus_mem[count], 0, sizeof (struct resource_node));
bus_mem[count]->type = MEM;
bus_mem[count]->busno = func->busno;
- bus_mem[count]->devfunc = ((func->device << 3) | (func->function & 0x7));
+ bus_mem[count]->devfunc = PCI_DEVFN(func->device,
+ func->function);
bus_mem[count]->len = len[count];
if (ibmphp_check_resource (bus_mem[count], 0) == 0) {
ibmphp_add_resource (bus_mem[count]);
@@ -846,7 +851,7 @@
memset (io, 0, sizeof (struct resource_node));
io->type = IO;
io->busno = func->busno;
- io->devfunc = ((func->device << 3) | (func->function & 0x7));
+ io->devfunc = PCI_DEVFN(func->device, func->function);
io->len = amount_needed->io;
if (ibmphp_check_resource (io, 1) == 0) {
debug ("were we able to add io\n");
@@ -869,7 +874,7 @@
memset (mem, 0, sizeof (struct resource_node));
mem->type = MEM;
mem->busno = func->busno;
- mem->devfunc = ((func->device << 3) | (func->function & 0x7));
+ mem->devfunc = PCI_DEVFN(func->device, func->function);
mem->len = amount_needed->mem;
if (ibmphp_check_resource (mem, 1) == 0) {
ibmphp_add_resource (mem);
@@ -892,7 +897,7 @@
memset (pfmem, 0, sizeof (struct resource_node));
pfmem->type = PFMEM;
pfmem->busno = func->busno;
- pfmem->devfunc = ((func->device << 3) | (func->function & 0x7));
+ pfmem->devfunc = PCI_DEVFN(func->device, func->function);
pfmem->len = amount_needed->pfmem;
pfmem->fromMem = FALSE;
if (ibmphp_check_resource (pfmem, 1) == 0) {
next prev parent reply other threads:[~2005-01-10 17:48 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-10 17:18 [BK PATCH] PCI patches for 2.6.10-rc2 Greg KH
2005-01-10 17:19 ` Greg KH
2005-01-10 17:20 ` [PATCH] PCI patches for 2.6.10 Greg KH
2005-01-10 17:20 ` Greg KH
2005-01-10 17:20 ` Greg KH [this message]
2005-01-10 17:20 ` Greg KH
2005-01-10 17:20 ` Greg KH
2005-01-10 17:20 ` Greg KH
2005-01-10 17:20 ` Greg KH
2005-01-10 17:20 ` Greg KH
2005-01-10 17:20 ` Greg KH
2005-01-10 17:20 ` Greg KH
2005-01-10 17:20 ` Greg KH
2005-01-10 17:20 ` Greg KH
2005-01-10 17:20 ` Greg KH
2005-01-10 17:20 ` Greg KH
2005-01-10 17:20 ` Greg KH
2005-01-10 17:20 ` Greg KH
2005-01-10 17:20 ` Greg KH
2005-01-10 17:20 ` Greg KH
2005-01-10 17:20 ` Greg KH
2005-01-10 17:20 ` Greg KH
2005-01-10 17:20 ` Greg KH
2005-01-10 17:20 ` Greg KH
2005-01-10 17:20 ` Greg KH
2005-01-10 17:20 ` Greg KH
2005-01-11 22:39 ` Matt Mackall
2005-01-11 22:44 ` Greg KH
2005-01-12 13:09 ` Domen Puncer
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=11053776562095@kroah.com \
--to=greg@kroah.com \
--cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).