Skip to contentSkip to conversation

list_for_each: arch-alpha-kernel-pci.c

Kernel-janitors Domen Puncer 2 participants 3 messages Aug 20, 2004 Kernel janitors

lore
Share & tools
lore
#0 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 3 lines · Domen Puncer

Hi.

Change for loops with list_for_each().

Please go directly to list_for_each_entry in all your patches where possible.

Well, i did that on Jul 29. (these and those patches are forward ports from an old patchset).

Quoted 4 lines

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 3 lines · Domen Puncer

Hi.

Change for loops with list_for_each().

Please go directly to list_for_each_entry in all your patches where possible.

Or are you implying that code like:

        list_for_each(ln, &bus->devices) {
                struct pci_dev *dev = pci_dev_b(ln);

could be list_for_each_entry, since pci_dev_b is basically a list_entry? If that is the case, what was the reason for pci_dev_b in first place? More readability or maybe abstraction of pci code?

Thanks,

Domen

Quoted 4 lines

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#2 lore raw
In reply to Domen Puncer
Quoted 6 lines · Domen Puncer
Quoted 5 lines · Christoph Hellwig
Quoted 3 lines · Domen Puncer

Hi.

Change for loops with list_for_each().

Quoted 7 lines
Quoted 1 line

Please go directly to list_for_each_entry in all your patches where possible.

Or are you implying that code like:

        list_for_each(ln, &bus->devices) {
                struct pci_dev *dev = pci_dev_b(ln);

could be list_for_each_entry, since pci_dev_b is basically a list_entry?

Yes.

Quoted 2 lines

If that is the case, what was the reason for pci_dev_b in first place? More readability or maybe abstraction of pci code?

It predactes list_for_each_entry

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors