On Wed, Mar 26, 2008 at 02:41:44PM -0700, Linus Torvalds wrote:
Good point - even though 1-byte size/alignment is invalid for a regular BAR
(minimum is 8 bytes for IO and 16 bytes for MEM, IIRC), nothing prevents
us from using this code for non-standard stuff, including single-byte
resources.
Agreed, this looks better...
Well, at this point (pdev_sort_resources call) bridge resource->start
has nothing to do with a bus address, it just a temporary storage for
required alignment, filled by sizing routines (and 0 is definitely invalid
here). I know, this is quite confusing, but I didn't want to add extra
fields to existing structures or create temporary per-bus trees...
But after pci_assign_resource() that resource can certainly be at 0,
depending on PCIBIOS_MIN_{IO,MEM} and free slots in the resource tree.
Must be end - start + 1
Yes, absolutely.
Extra 4 or 8 bytes per resource? Well, if you think that people won't start
complain too much about that, I'll be absolutely happy with that.
It'd vastly improve readability.
If the new "align" field (and then, maybe, "size" instead of "end"?)
is OK, then I'm definitely willing to give it a try.
Ivan.
--