Jeff Garzik wrote:
Randy Dunlap wrote:
On Sat, 01 Sep 2007 18:40:27 -0400 Jeff Garzik wrote:

Andi Kleen wrote:
The second function is redundant?
No, it's a hook we must implement, when CONFIG_PCI_DOMAINS is enabled.
Then the other function is redundant.
No, both functions are required by the interface.

by what interface? and why, please? (instead of just stating "required")

grep for CONFIG_PCI_DOMAINS in arch code and include/linux/pci.h.

Thanks, I get it.

This is normal "arch" interface: you enable a define, and a group of functions is assumed to be present. Otherwise (!defined), a set of stub no-ops is activated for your arch.

I have implemented the [small] group of functions the code assumes to be present, when CONFIG_PCI_DOMAINS is enabled, like all the other arches that implement PCI domain support.


+#ifdef CONFIG_PCI_DOMAINS
+static inline int pci_domain_nr(struct pci_bus *bus)
+{
+       struct pci_sysdata *sd = bus->sysdata;
+       return sd->domain;
+}
+
+static inline int pci_proc_domain(struct pci_bus *bus)
+{
+       return pci_domain_nr(bus);
+}
+#endif /* CONFIG_PCI_DOMAINS */

So if CONFIG_PCI_DOMAINS=y, proc_proc_domain() decides to print the domain nr
in /proc iff the domain nr != 0 ?  so that the /proc file format is
different depending on the domain nr (0 vs. !0) ?

I suppose that is similar to what arch/powerpc/kernel/pci_64.c does
with hose->buid.  I think that I had rather see the domain nr printed
whenever CONFIG_PCI_DOMAINS=y... oh well.


--
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to