lkml.org 
[lkml]   [2006]   [Jun]   [11]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateSun, 11 Jun 2006 12:23:49 +0200 (MEST)
FromJan Engelhardt <>
SubjectRe: [PATCH] [2.6.17-rc6] Section mismatch in drivers/net/ne.o during modpost
>> Doesn't look serious.  init_module() is not __init, but it calls
>> some __init functions and touches some __initdata.
>
>This is the typical case with inconsistent tagging.
>
Worse yet, I once experienced a double-definition error, that is, I had

  __init int init_module(void)  {
      /* module1 */
  }
and, in another .c file,

  __init int init_module(void) {
      /* module2 */
  }
and making them both CONFIG_...=y gave a typical double-definition link 
time error in vmlinux. The proper way (IMO) is

  static __init int blah_init(void) { ... }
  module_init(blah_init);
Then it does not even matter if blah_init is defined in two different 
modules.

>> 
>> -int init_module(void)
>> +int __init init_module(void)
>>  {
>>  	int this_dev, found = 0;
>
>When you anyway touches the driver I suggest to name the function
><module>_init, <module>_cleanup and use module_init(), module_cleanup().


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

\
 
 \ /
  Last update: 2006-06-11 12:26    [from the cache]
©2003-2008