2002-10-18 03:22:51

by dijital1

[permalink] [raw]
Subject: referencing other modules

Does anyone have any ideas as to why this following 3 lines of code
don't work? The kernel version is 2.5.43 and I have several other modules
loaded before I load the module containing this code. From what I can
discern in linux/kernel/module.c new modules are added to the head of the
list to it seems that my code would work. Any help or suggestions would be
appreciated. Incidentally, this code is being called from the module
initialisation function.

struct module *next_mod;
next_mod=THIS_MODULE->next;
printk(KERN_DEBUG"%s\n", next_mod->name);


Ron Henry

"the illiterate of the future are not those who can neither read
or write; but those who cannot learn, unlearn, and relearn..."


2002-10-18 16:40:17

by Gianni Tedesco

[permalink] [raw]
Subject: Re: referencing other modules

On Thu, 2002-10-17 at 04:25, dijital1 wrote:
> Does anyone have any ideas as to why this following 3 lines of code
> don't work? The kernel version is 2.5.43 and I have several other modules
> loaded before I load the module containing this code. From what I can
> discern in linux/kernel/module.c new modules are added to the head of the
> list to it seems that my code would work. Any help or suggestions would be
> appreciated. Incidentally, this code is being called from the module
> initialisation function.
>
> struct module *next_mod;
> next_mod=THIS_MODULE->next;
> printk(KERN_DEBUG"%s\n", next_mod->name);

presumably next_mod==NULL, items may be inserted backwards in to the
list (that is usual for singly linked lists).

--
// Gianni Tedesco (gianni at ecsc dot co dot uk)
lynx --source http://www.scaramanga.co.uk/gianni-at-ecsc.asc | gpg --import
8646BE7D: 6D9F 2287 870E A2C9 8F60 3A3C 91B5 7669 8646 BE7D


Attachments:
signature.asc (232.00 B)
This is a digitally signed message part