lkml.org 
[lkml]   [2008]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] bitops: simplify generic bit finding functions

* Linus Torvalds <torvalds@linux-foundation.org> 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


\
 
 \ /
  Last update: 2008-04-28 23:59    [W:0.211 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site