From: Matt Domsch <Matt_Domsch@dell.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-pci@atrey.karlin.mff.cuni.cz, Greg KH <greg@kroah.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.18-rc5] PCI: sort device lists breadth-first
Date: Fri, 8 Sep 2006 13:52:29 -0500 [thread overview]
Message-ID: <20060908185228.GA16197@humbolt.us.dell.com> (raw)
In-Reply-To: <20060908112035.f7a83983.akpm@osdl.org>
On Fri, Sep 08, 2006 at 11:20:35AM -0700, Andrew Morton wrote:
> On Thu, 7 Sep 2006 22:14:22 -0500
> Matt Domsch <Matt_Domsch@dell.com> wrote:
>
> > @@ -189,6 +189,8 @@ static int __init pcibios_init(void)
> >
> > pcibios_resource_survey();
> >
> > + if (!(pci_probe & PCI_NO_SORT))
> > + pci_sort_breadthfirst();
> >
> > ...
> >
> > --- a/drivers/pci/probe.c
> > +++ b/drivers/pci/probe.c
> > @@ -1055,3 +1055,95 @@ EXPORT_SYMBOL(pci_scan_bridge);
> > EXPORT_SYMBOL(pci_scan_single_device);
> > EXPORT_SYMBOL_GPL(pci_scan_child_bus);
> > #endif
> > +
> > +static int pci_sort_bf_cmp(const struct pci_dev *a, const struct pci_dev *b)
> > +static void pci_insertion_sort_klist(struct pci_dev *a, struct list_head *list,
> > +static void pci_sort_breadthfirst_klist(void)
> > +static void pci_insertion_sort_devices(struct pci_dev *a, struct list_head *list,
> > +static void pci_sort_breadthfirst_devices(void)
> > +void pci_sort_breadthfirst(void)
>
> I think all these functions can+should be __init?
>
> > +extern void pci_sort_breadthfirst(void);
>
> In which case this needs the __init tag too (new rule, due to frv (at least)).
Will fix up immediately. I also see that it's making indirect calls
through the (*cmp)() pointer, which is interesting only of there's
other code that's going to be doing insertion sorting. For now, a
direct call to the comparison function would be a little cleaner.
Thanks for the review!
Matt
--
Matt Domsch
Software Architect
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com
next prev parent reply other threads:[~2006-09-08 18:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-08 3:14 Matt Domsch
2006-09-08 15:56 ` Dave Jones
2006-09-08 16:18 ` Matt Domsch
2006-09-08 16:55 ` Arjan van de Ven
2006-09-11 19:36 ` Bill Davidsen
2006-09-12 3:08 ` Matt Domsch
2006-09-12 21:06 ` Bill Davidsen
2006-09-08 16:45 ` Greg KH
2006-09-08 18:20 ` Andrew Morton
2006-09-08 18:52 ` Matt Domsch [this message]
2006-09-08 18:59 ` Alexey Dobriyan
2006-09-09 9:05 ` Jeff Garzik
2006-09-09 12:11 ` Pavel Machek
2006-09-10 11:26 ` Stefan Richter
2006-09-10 13:02 ` Greg KH
2006-09-15 3:53 ` Dan Carpenter
2006-09-15 13:02 ` Matt Domsch
2006-09-16 2:39 ` Dan Carpenter
2006-09-08 3:18 Matt Domsch
2006-09-08 19:34 Matt Domsch
2006-09-09 14:37 Ragnar Kjørstad
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=20060908185228.GA16197@humbolt.us.dell.com \
--to=matt_domsch@dell.com \
--cc=akpm@osdl.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
/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
Powered by JetHome