<br><br><div class="gmail_quote">On Thu, Jun 18, 2009 at 2:06 PM, Peter Stuge <span dir="ltr"><<a href="mailto:peter@stuge.se">peter@stuge.se</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">ron minnich wrote:<br>
> I think we ought to not bring over the v3 stage numbering.<br>
> I've gotten very mixed reactions to the stage1 etc. naming.<br>
> It seemed like a good idea but in the end it did not seem that<br>
> essential.<br>
<br>
</div>It really helps me too in understanding the code. And it helps<br>
explaining the code flow to new people.<br>
<br>
Numbers are not critical, but I liked them as a way to not have to<br>
deal with finding perfect names for every single function.<br>
<br>
I'd like to have either great names for all functions and good<br>
consistent structure, or some kind of numbering scheme.</blockquote><div>I'd be happy with having the functions ordered correctly in the structures as a first step.<br><br>In other words, if .init always came last, that would help.<br>
<br>// from src/include/device/device.h: <br><br>struct device_operations {<br>    void (*read_resources)(device_t dev);<br>    void (*set_resources)(device_t dev);<br>    void (*enable_resources)(device_t dev);<br>    void (*init)(device_t dev);<br>
    unsigned int (*scan_bus)(device_t bus, unsigned int max);<br>    void (*enable)(device_t dev);<br>    void (*set_link)(device_t dev, unsigned int link);<br>    void (*reset_bus)(struct bus *bus);<br>    const struct pci_operations *ops_pci;<br>
    const struct smbus_bus_operations *ops_smbus_bus;<br>    const struct pci_bus_operations *ops_pci_bus;<br>};<br><br>It's hard to tell from there that the order is:<br>1. Enable<br>2. Scan bus<br>3. Read resources<br>
4. Set resources<br>5. Enable resources<br>6. Init<br><br>( I could have gotten something wrong there.)<br><br>I admit I don't know what<br>1. set_link<br>2. reset_bus<br><br>are good for or when they're called.  This seems like the place to document it, though.<br>
<br>Thanks,<br>Myles <br></div></div><br>