On Mon, 22 Nov 2004 11:04:04 -0800, Greg KH <[EMAIL PROTECTED]> wrote:

> Surely some of these forward declarations can be removed by just
> shuffling the code around?

Hmm. I always felt this better, because otherwise you allow your code
to look pasqual-ish, when the language dictates the textual order.
General order for decent drivers is:

- structs
- protos
- statics and sometimes tables such as usb_device_id[]
- little helpers
- out and up facing interfaces, such as block queues, open/release/ioctl
- (exception: file_operations)
- meat functions
- N-th level in anti-pasqual order (e.g. if you call something, it's
  located BELOW YOU, scroll DOWN to see)
- initiations
- module
- pci_driver {}

What do you think? Did you notice that most reasonable drivers follow
a similar pattern?

-- Pete


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to