lkml.org 
[lkml]   [2000]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ISA PnP (2.4.0-test9)
On Mon, 9 Oct 2000, Keith Owens wrote:

> On Mon, 9 Oct 2000 12:55:28 +0200 (MEST),
> Jaroslav Kysela <perex@suse.cz> wrote:
> >I fully understand your point, but I don't want to have a special
> >case for ISA PnP. What about this change:
> >
> >#define MODULE_GENERIC_TABLE(gtype,name) \
> >const struct gtype##_id * __module_##gtype##_table = name
> >
> >to
> >
> >#define MODULE_GENERIC_TABLE(gtype,name) \
> >const unsigned long __module_##gtype_size = sizeof(struct gtype##_id); \
> >const struct gtype##_id * __module_##gtype##_table = name
>
> Make that
>
> #define MODULE_GENERIC_TABLE(gtype,name) \
> static const unsigned long __module_##gtype##_size \
> __attribute__ ((unused)) = sizeof(struct gtype##_id); \
> static const struct gtype##_id * __module_##gtype##_table = name
>
> and you've got a deal. The _size must be static to avoid name clashes
> when two or more objects that use MODULE_GENERIC_TABLE(sametype,..) are
> linked together. __attribute__ ((unused)) stops the compiler
> complaining about unused static variables; we know that they are used
> by modutils, not by the code itself.

Regarding static: Are you sure, that I'll have to do this change?
I think that MODULE_GENERIC_TABLE(gtype,...) may be only one per kernel
module, so we can leave this variable as global. The scope of this
variable should be same as __this_module symbol.

Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
SuSE Linux http://www.suse.com
ALSA project http://www.alsa-project.org

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

\
 
 \ /
  Last update: 2005-03-22 12:39    [W:0.031 / U:3.020 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site