Re: Worst recursion in the kernel

From: Jörn Engel
Date: Thu Dec 04 2003 - 08:49:26 EST


On Wed, 3 December 2003 15:08:04 -0800, David Hinds wrote:
>
> The issue is that validate_mem() doesn't need to use read_cis_mem's
> functionality directly (so it can't just be modified to use the __*
> form). It calls other stuff, which calls other stuff, which
> eventually calls read_cis_mem(), and all that other stuff is used by
> other callers. So there isn't an obvious place to insert this
> bifurcation.

This explanation sounds a bit like "that mess is too fragile, there is
no way to touch it without everything falling apart." Just one more
reason to change it and make it more maintainable. I agree, it is a
big piece of work waiting for 2.7 to open up, but your only excuse not
to do it eventually is lack of time. ;)

> inv_probe() is pretty comprehensible, it calls itself directly, in
> order to traverse a short linked list from tail to head.

Sounds like a valid candidate for <list.h>, but if you can prove the
list to always be short, it is ok.

Jörn

--
Write programs that do one thing and do it well. Write programs to work
together. Write programs to handle text streams, because that is a
universal interface.
-- Doug MacIlroy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/