On Fri, May 21, 2010 at 8:03 AM, Patrick Georgi patrick@georgi-clan.de wrote:
Am 21.05.2010 01:08, schrieb Myles Watson:
static void free_resource(device_t dev, struct resource *res, struct
resource *prev)
...
- res->next = free_resources;
- free_resources = res->next;
Shouldn't that be
- res->next = free_resources;
- free_resources = res;
to add res to the free_resources?
Yes. Thanks for catching it. It's too bad to leak the memory you're saving :) Fixed.
Other than that, this is great! Smaller, cleaner, faster code, that uses less memory to achieve the same result - wonderful!
Thanks. If we do the same thing with links we could save another ~150 bytes per device. There are 8 links per device when few of them have any at all.
With the above thing cleared up, this is Acked-by: Patrick Georgi patrick.georgi@coresystems.de
Rev 5576.
Thanks, Myles