On Thu, Dec 30, 2010 at 07:55:27PM +0200, Gleb Natapov wrote:
On Thu, Dec 30, 2010 at 12:20:17PM -0500, Kevin O'Connor wrote:
On Thu, Dec 30, 2010 at 08:01:15AM +0200, Gleb Natapov wrote:
For me it looks more complicated (may be because I am more familiar with my own code ;))
The basic idea is to completely build the search string in the bootprio_find_X() function and then have it call find_prio() to return the priority.
I understand the code, I just don't see why this is easier.
It does seem a little more compact to me. Shrug - it's probably because I'm more familiar with my code. :-)
Your code also uses a lot of stack is this OK?
It's ~600 bytes - since the code runs in 32-bit flat mode, it shouldn't be a problem. (The closest limit would be each "thread" stack of 4K.)
There's a tool to try and scan stack usage (it's for the 16-bit code, but it can also run on the 32bit code):
objdump -m i386 -M suffix -d out/rom.o | tools/checkstack.py | less
Nothing is close to 4k.
It also assumes that device path is no greater then 256 bytes long. With multiple bridges we can go over this limit.
Assuming each bridge takes 15 bytes to describe, one would need around 12 layers of bridges before this was an issue. I don't think that's realistic.
-Kevin