All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: domen@coderock.org
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org, hannal@us.ibm.com,
	janitor@sternwelten.at
Subject: Re: [patch 03/11] arch/i386/pci/i386.c: Use new for_each_pci_dev macro
Date: Tue, 11 Jan 2005 19:46:19 -0500	[thread overview]
Message-ID: <20050112004618.GT29712@redhat.com> (raw)
In-Reply-To: <20050111233458.9B8E01F228@trashy.coderock.org>

On Wed, Jan 12, 2005 at 12:34:58AM +0100, domen@coderock.org wrote:

 > As requested by Christoph Hellwig I've created a new macro called
 > for_each_pci_dev. It is a wrapper for this common use of pci_get/find_device:
 > 
 > (while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL))
 > 
 > This macro will return the pci_dev *for all pci devices.  Here is the first patch I 
 > used to test this macro with. Compiled and booted on my T23. There will be
 > 53 more patches using this new macro.

Which looks just like the pci_for_each_dev we used to have.
That function got removed due some shortcoming or other that I never
fully understood, but ISTR it had something to do with locking.
(why it couldnt be hidden inside for_each_pci_dev is a mystery to me)

We've had lots of code in the kernel go from this..

pci_for_each_dev(loop_dev) {

to the disgustingly unreadable..

while ((loop_dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, loop_dev)) != NULL) {

and now its going to ..

for_each_pci_dev(loop_dev) {

So,.. what has all this churn bought us, and where does it end ?
With four words in the function name, we've enough possibilities
for quite a few more iterations yet.

		Dave


  reply	other threads:[~2005-01-12  0:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-11 23:34 [patch 03/11] arch/i386/pci/i386.c: Use new for_each_pci_dev macro domen
2005-01-12  0:46 ` Dave Jones [this message]
2005-01-12  1:16   ` Greg KH

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=20050112004618.GT29712@redhat.com \
    --to=davej@redhat.com \
    --cc=akpm@osdl.org \
    --cc=domen@coderock.org \
    --cc=hannal@us.ibm.com \
    --cc=janitor@sternwelten.at \
    --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 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.