lkml.org 
[lkml]   [2003]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] PCI code cleanup
On 18 Feb 2003, Louis Zhuang wrote:

> The patch clean up some old-style usage of list_head. Pls apply if you
> like it. Thanks

> ===== drivers/pci/probe.c 1.26 vs edited =====
> -- 1.26/drivers/pci/probe.c Mon Jan 13 11:44:26 2003
> +++ edited/drivers/pci/probe.c Tue Feb 18 09:28:40 2003
> @@ -533,7 +533,7 @@
> {
> const struct list_head *l;
>
> - for(l=list->next; l != list; l = l->next) {
> + list_for_each(l, list) {
> const struct pci_bus *b = pci_bus_b(l);
> if (b->number == nr || pci_bus_exists(&b->children, nr))
> return 1;

Well, if you're changing that anyway, you could as well use

{
const struct pci_bus *b;

list_for_each_entry(b, list) {
if (b->number ...

which looks even nicer ;-)

--Kai


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:33    [W:0.036 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site