From: Hanna Linder <hannal@us.ibm.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Hanna Linder <hannal@us.ibm.com>,
linux-kernel@vger.kernel.org, kernel-janitors@lists.osdl.org,
benh@kernel.crashing.org, paulus@samba.org, greg@kroah.com
Subject: Re: [Kernel-janitors] [PATCH 2.6][1/12] arch/ppc/kernel/pci.c replace pci_find_device with pci_get_device
Date: Wed, 06 Oct 2004 13:23:21 -0700 [thread overview]
Message-ID: <3550000.1097094201@w-hlinder.beaverton.ibm.com> (raw)
In-Reply-To: <20041005104443.A16871@infradead.org>
--On Tuesday, October 05, 2004 10:44:43 AM +0100 Christoph Hellwig <hch@infradead.org> wrote:
> what about adding a for_each_pci_dev macro that nicely hides these AND_ID
> iterations?
>
OK. How about this? Following are two patches that I used to test this
new macro on my T23. I found roughly 54 other places this macro can
be used.
Hanna Linder
IBM Linux Technology Center
Signed-off-by: Hanna Linder <hannal@us.ibm.com>
---
diff -Nrup linux-2.6.9-rc3-mm2cln/include/linux/pci.h linux-2.6.9-rc3-mm2patch/include/linux/pci.h
--- linux-2.6.9-rc3-mm2cln/include/linux/pci.h 2004-10-04 11:38:51.000000000 -0700
+++ linux-2.6.9-rc3-mm2patch/include/linux/pci.h 2004-10-05 15:56:26.000000000 -0700
@@ -548,6 +548,7 @@ struct pci_dev {
#define pci_dev_g(n) list_entry(n, struct pci_dev, global_list)
#define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list)
#define to_pci_dev(n) container_of(n, struct pci_dev, dev)
+#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL)
/*
* For PCI devices, the region numbers are assigned this way:
next prev parent reply other threads:[~2004-10-06 21:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-04 22:58 Hanna Linder
2004-10-05 9:44 ` [Kernel-janitors] " Christoph Hellwig
2004-10-06 20:23 ` Hanna Linder [this message]
2004-10-07 13:17 ` Christoph Hellwig
2004-10-06 23:10 ` Hanna Linder
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=3550000.1097094201@w-hlinder.beaverton.ibm.com \
--to=hannal@us.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=greg@kroah.com \
--cc=hch@infradead.org \
--cc=kernel-janitors@lists.osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.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
all inboxes | Powered by JetHome®