Skip to contentSkip to conversation

2.5 fix link with fbcon built-in

PATCH Applied Benjamin Herrenschmidt 3 participants 5 messages Dec 30, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.5 fix link with fbcon built-in

In current bk 2.5, drivers/video/console/fonts.c exports an init_module() symbol when built-in, which prevents the kernel from linking. Here's a quick fix.

Ben.

drivers/video/console/fonts.c Mon Dec 30 11:36:42 2002 renamed from drivers/video/console/fonts.c Fri Nov 29 18:37:57 2002 +2 -0
@@ -130,8 +130,10 @@
     return g;
 }
  
+#ifdef MODULE
 int init_module(void) { return 0; };
 void cleanup_module(void) {};
+#endif
  
 EXPORT_SYMBOL(fonts);
 EXPORT_SYMBOL(find_font);
Signature · 1 line
Benjamin Herrenschmidt <[email protected]>
#1 lore raw
Quoted 10 lines

In current bk 2.5, drivers/video/console/fonts.c exports an init_module() symbol when built-in, which prevents the kernel from linking. Here's a quick fix.

Ben.

drivers/video/console/fonts.c Mon Dec 30 11:36:42 2002 line 139

Quoted 10 lines
drivers/video/console/fonts.c Mon Dec 30 11:36:42 2002 renamed from drivers/video/console/fonts.c Fri Nov 29 18:37:57 2002 +2 -0
@@ -130,8 +130,10 @@
     return g;
 }
 
+#ifdef MODULE
 int init_module(void) { return 0; };
 void cleanup_module(void) {};
+#endif
 
 EXPORT_SYMBOL(fonts);
 EXPORT_SYMBOL(find_font);

Applied to BK tree.

#2 lore raw
In reply to Benjamin Herrenschmidt
Quoted 4 lines · Benjamin Herrenschmidt

In current bk 2.5, drivers/video/console/fonts.c exports an init_module() symbol when built-in, which prevents the kernel from linking. Here's a quick fix.

This is not correct.

The functions should either be removed completely (preferred, since they aren't even proper C syntax in the first place - since when do we put semicolons at the end of a function?) or the file should be taught to use proper "module_init()/module_exit()" semantics that work _correctly_ for both modules and built-in.

The patch just hides just _how_ crap this file is, and as such should not be applied. Crap doesn't get better from being hidden.

Linus

Quoted 4 lines
drivers/video/console/fonts.c Mon Dec 30 11:36:42 2002 renamed from drivers/video/console/fonts.c Fri Nov 29 18:37:57 2002 +2 -0
+#ifdef MODULE
 int init_module(void) { return 0; };
 void cleanup_module(void) {};
+#endif
#3 lore raw
Quoted 8 lines · Linus Torvalds
Quoted 4 lines · Benjamin Herrenschmidt

In current bk 2.5, drivers/video/console/fonts.c exports an init_module() symbol when built-in, which prevents the kernel from linking. Here's a quick fix.

This is not correct.

Quoted 8 lines

The functions should either be removed completely (preferred, since they aren't even proper C syntax in the first place - since when do we put semicolons at the end of a function?) or the file should be taught to use proper "module_init()/module_exit()" semantics that work _correctly_ for both modules and built-in.

The patch just hides just _how_ crap this file is, and as such should not be applied. Crap doesn't get better from being hidden.

Right, though weren't those empty functions just workarounds for a time where new module stuff didn't grok modules without module init/exit ? Is this still the case ? If not, then we should indeed just remove the function completely.

Ben.

#4 lore raw
Quoted 9 lines
Quoted 9 lines

This is not correct.

The functions should either be removed completely (preferred, since they aren't even proper C syntax in the first place - since when do we put semicolons at the end of a function?) or the file should be taught to use proper "module_init()/module_exit()" semantics that work _correctly_ for both modules and built-in.

Quoted 7 lines
Quoted 2 lines

The patch just hides just _how_ crap this file is, and as such should not be applied. Crap doesn't get better from being hidden.

Right, though weren't those empty functions just workarounds for a time where new module stuff didn't grok modules without module init/exit ? Is this still the case ? If not, then we should indeed just remove the function completely.

Correct. I added them while the module code was in a state of flux so it would get it working. Now that the module code is stable what do we do? I like to see those functions go away.