Re: what is the problem with this incomplete module?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 01, 2002 at 09:01:58AM -0700, Michael G. Janicki wrote:
> On Mon, 1 Jul 2002, Halil Demirezen wrote:
>   Beginning around kernel 2.1 modules began containing a license
> which can be set with the macro MODULE_LICENSE.  Currently
> accepted licenses are listed in include/linux/module.h.  I usually
> use a template like this to handle the basic stuff for test
> modules:
> 
> #if defined(CONFIG_MODVERSIONS) && ! defined(MODVERSIONS)
>         #include <linux/modversions.h>
>         #define MODVERSIONS
> #endif
> 
> #ifndef KERNEL_VERSION
> #define KERNEL_VERSION(ver,rel,seq) (((ver)<<16) | ((rel)<<8) | (seq))
> #endif
> 
> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
>         MODULE_AUTHOR("Some Author");
>         MODULE_DESCRIPTION("Some Description");
>         MODULE_LICENSE("GPL");
> #endif
> 
> #include <linux/kernel.h>
> #include <linux/module.h>

Note that these includes must go first, because its where KERNEL_VERSION
and MODULE_LICENCE are defined.

Also note, that

#ifdef MODULE_LICENCE
        MODULE_AUTHOR("Some Author");
        MODULE_DESCRIPTION("Some Description");
        MODULE_LICENSE("GPL");
#endif

would suffice without the need to know in which version these were
introduced.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux