Re: [PATCH] bitops: simplify generic bit finding functions

From: Ingo Molnar
Date: Mon Apr 28 2008 - 17:56:39 EST



* Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> So we do have cases where the inlines are obviously worth it. But in
> general, I think we should try to move things from the header files
> into *.c files unless there is a really clear reason for keeping it
> that way.

there's another benefit, and in asm-x86 we prefer to move inlines to .c
files even in borderline cases because it simplifies the type
dependencies: not having to fully define all types at the function
prototype site avoids include file dependency hell.

Putting things like a task struct dereference into a lowlevel inline
file easily causes dependency problems that causes people to use macros
instead - which have their own set of readability and side-effect
problems.

a third argument is that inlines seldom get smaller. So if they are
borderline and we move them into a .c, and later on the function gets
larger, no harm is done. But if we keep the inline in a .h in the
borderline case and we grow the inline later on, the whole kernel bloats
in a multiplied way, without any apparent direct feedback to the
developer that something wrong and harmful just happened.

Ingo
--
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/