[Intel-gfx] [PATCH 1/3] lib: Always build and export interval_tree

Michel Lespinasse walken at google.com
Sat Jan 25 05:42:18 CET 2014


Hi Chris,

On Tue, Jan 21, 2014 at 7:07 AM, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> lib/interval_tree.c provides a simple interface for an interval-tree
> (an augmented red-black tree) but is only built when testing the generic
> macros for building interval-trees. For drivers with modest needs,
> export the simple interval-tree library as is.

Thanks for suggesting this. I did plan for this use case, and thought
it would show up earlier.

My only concern is that I think we should keep the code under a config
option (unless a use case shows up in core kernel). So I would
suggest:

in lib/Kconfig:
config INTERVAL_TREE
       bool

in lib/Kconfig.debug:
make INTERVAL_TREE_TEST depend on m && DEBUG_KERNEL && INTERVAL_TREE

in lib/Makefile:
obj-$(CONFIG_INTERVAL_TREE) += interval_tree.o

You would probably also need to add #include <linux/module.h> in
lib/interval_tree.c to plan for that code being configured as a
module.

Hope this helps,

-- 
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.



More information about the Intel-gfx mailing list