Re: Linux 2.3.18ac5

Chipzz (xp@Ace.ULYSSIS.Student.KULeuven.Ac.Be)
Fri, 17 Sep 1999 11:02:35 +0200 (CEST)


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/