lkml.org 
[lkml]   [1999]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Linux 2.3.18ac5
On Fri, 17 Sep 1999, Richard Guenther wrote:

> From: Richard Guenther <zxmpm11@student.uni-tuebingen.de>
> Subject: Re: Linux 2.3.18ac5
>
> On Fri, 17 Sep 1999, Jeff Garzik wrote:
>
> > Richard Guenther wrote:
> > > Caveats: you dont have control over MODULE_NAME - it gets
> > > created out of the source file name.
> >
> > That's not very friendly... instead of messing with the kernel compile
> > flags, why not do this:
> >
> > #ifndef MODULE_NAME
> > #define MODULE_NAME __FILE__
> > #endif
>
> Because MODULE_NAME then gets foobar.c !? which is not a
> usable/suitable prefix either? (The Makefile would create
> foobar_ as prefix)
> Or because you have to do it _before_ the #include of the
> module.h header, which is messy and error-prone?
> Hey, I really did think before I started modifying the
> makefile. And - the filename is not such a bad choice either
> in most cases. And the biggest advantage is that it works
> without changing any driver source.
>
> Richard.

The solution seems very obvious:
let's say you change the makefile to use _MODULE_NAME as the define, then
do:

#ifndef MODULE_NAME
#define MODULE_NAME _MODULE_NAME
#endif

That way, you can give other names to your module too if the filename
isn't quite suitable.

Chipzz AKA
Jan Van Buggenhout

--------------------------------------------------------------------------
UNIX isn't dead - It just smells funny
Xp@Ace.ULYSSIS.Student.KULeuven.Ac.Be
--------------------------------------------------------------------------


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

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.055 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site