Re: spinlocks, the GPL, and binary-only modules

From: Mark Mielke (mark@mark.mielke.cc)
Date: Fri Nov 22 2002 - 01:19:55 EST


On Thu, Nov 21, 2002 at 12:21:21PM -0500, Jeff Garzik wrote:
> Mark Mielke wrote:
> > #ifdef __GNUC__
> > # define INLINE extern inline
> > #else
> > # define INLINE inline
> > #endif
> [...]
> Please review prior posts in this thread, notably from Andrew Morton and
> Cort Dougan. They describe a much better method of doing this.
> It still doesn't handle macros, though they are much less of a worry
> since Linux kernel emphasizes inlines over macros.

I just scanned it over and it isn't exactly the same as what I suggested.

Re-stating for clarity: Header files should use 'extern inline'
('inline' for C99) to declare inline functions in "GPL-mode" and
'extern' (or no qualifer) should be used to declare only the prototype
in "non-GPL-mode". The benefit of this is that GPL code continues to
work as is with no speed degradation, but non-GPL source code will not
require GPL code in the object code.

Converting 'extern inline' to 'static inline' doesn't accomplish very much,
except to force referenced code to be inlined into each object code. This
is the opposite effect of 'ensure that no GPL code is compiled into a
non-GPL object file'.

mark

-- 
mark@mielke.cc/markm@ncf.ca/markm@nortelnetworks.com __________________________
.  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Neighbourhood Coder
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | 
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, Ontario, Canada

One ring to rule them all, one ring to find them, one ring to bring them all and in the darkness bind them...

http://mark.mielke.cc/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Nov 23 2002 - 22:00:39 EST