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

From: Mark Mielke (mark@mark.mielke.cc)
Date: Thu Nov 21 2002 - 12:02:24 EST


On Thu, Nov 21, 2002 at 05:08:45AM -0800, Andre Hedrick wrote:
> On 21 Nov 2002, Arjan van de Ven wrote:
> > It is if the AUTHOR then decides to distribute the resulting binary
> > which would contain a mix of GPL and non GPL work..
> The mix is a direct result of developers knowingly inlining critical C
> code into the headers. If this code was placed in proper .c files and not
> set in a .h then the potential for accidental mixing is removed.
> This would limit and restrict the headers to being structs and extern
> functions to call.

Some (not all) of the inlined functions are 'inline' to accelerate the
kernel.

Perhaps, though, the inlined functions should be declared:

   #ifdef __GNUC__
   # define INLINE extern inline
   #else
   # define INLINE inline
   #endif

   #ifdef GPL
   INLINE type function (arguments)
   {
      ...
   }
   #else
   INLINE type function (arguments);
   #endif

This would be neat in that no real additional code would be brought into
the module, however, there is a possibility that the module would run a little
bit slower - a small incentive to GPL the module...

Of course, this would mean that any #define's still sitting around that
contributed code of significance should be replaced with possibly inlined
functions...

Would this make everybody happy?

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:37 EST