netdev
[Top] [All Lists]

Re: Bug in recent net driver skeleton ?

To: Andi Kleen <ak@xxxxxx>
Subject: Re: Bug in recent net driver skeleton ?
From: Keith Owens <kaos@xxxxxxxxxx>
Date: Fri, 26 Nov 1999 16:44:16 +1100
Cc: becker@xxxxxxxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: Your message of "Fri, 26 Nov 1999 06:18:21 BST." <19991126061821.64483@xxxxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
On Fri, 26 Nov 1999 06:18:21 +0100, 
Andi Kleen <ak@xxxxxx> wrote:
>The recent ethernet drivers of yours (3c59x 0.99L, tulip 0.91g2,
>eepro100 etc.) have this line:
>
>#if (LINUX_VERSION_CODE >= 0x20100)
>char kernel_version[] = UTS_RELEASE;
>#endif
>
>Now this breaks when I try to compile multiple of these drivers statically
>into a kernel. The linker rightfully complains about multiple definitions
>of kernel_version. I think the right fix is to change it into:
>
>#if defined(MODULE) && (LINUX_VERSION_CODE >= 0x20100)
>char kernel_version[] = UTS_RELEASE;
>#endif
>
>kernel_version makes no sense without a module anyways. Or is there some
>deep reason I'm missing?

It may be redundant anyway.  #include <modules.h> defines
kernel_version[] in 2.0 kernels and __module_kernel_version[] for 2.1
(starting around 2.1.90 I think).  Any module should include modules.h
which will insert the correct definition.

You only get a problem if you need to link two or more objects into a
single module and more than one of the the inputs includes <module.h>,
it results in duplicate definitions of kernel_version.  In this case,
all but one of the inputs should either not include modules.h or should
#define __NO_VERSION__ before modules.h.


<Prev in Thread] Current Thread [Next in Thread>