hd eliminate bad section references
PATCH 2/3 hd eliminate bad section references
Fix hd section references:
make parse_hd_setup() __init
Error: ./drivers/ide/legacy/hd.o .text refers to 00000943 R_386_PC32 .init.text
drivers/ide/legacy/hd.c renamed from drivers/ide/legacy/hd.c.orig +1 -1
@@ -851,7 +851,7 @@ goto out; } -static int parse_hd_setup (char *line) { +static int __init parse_hd_setup (char *line) {int ints[6 ]; (void )get_options (line,ARRAY_SIZE (ints), ints);
Quoted 12 lines · maximilian attems
Fix hd section references:
makeparse_hd_setup()__initError:
./drivers/ide/legacy/hd.o.text refers to 00000943R_386_PC32.init.textSigned-off-by maximilian attems <[email protected]>
drivers/ide/legacy/hd.c line 857
Quoted 8 lines
drivers/ide/legacy/hd.c renamed from drivers/ide/legacy/hd.c.orig +1
-1@@ -851,7 +851,7 @@ goto out; } -static int parse_hd_setup (char *line) { +static int __init parse_hd_setup (char *line) {int ints[6 ]; (void )get_options (line,ARRAY_SIZE (ints), ints);
This one is fairly interesting and needs some resolution by someone who knows....
On the surface, the patch is correct.
Rusty, can you explain when __setup functions are called relative to in-kernel init functions? or put another way, can a __setup function safely call in __init function?
Here's the function in question:
static int parse_hd_setup (char *line) {
int ints[6];
(void) get_options(line, ARRAY_SIZE(ints), ints);
hd_setup(NULL, ints);
return 1;
}__setup("hd=", parse_hd_setup);
Should we make parse_hd_setup() __init,
or make hd_setup() non-__init, or something else?
{time passes, he looks]
OK, I looked at include/linux/init.h. From what I can see there, __setup() causes an .init.setup section to be emitted, so marking __setup() function as __init would make sense. I think that this patch is good.
Thanks.
Signature · 1 line
~Randy
Quoted 2 lines · Randy.Dunlap
Quoted 2 lines
drivers/ide/legacy/hd.c renamed from drivers/ide/legacy/hd.c.orig +1
-1-static int parse_hd_setup (char *line) { +static int __init parse_hd_setup (char *line) {
..
Quoted 2 lines
This one is fairly interesting and needs some resolution by someone who knows....
thanks a lot for your quick and profund feedback.
Quoted 23 lines
On the surface, the patch is correct.
Rusty, can you explain when
__setupfunctions are called relative to in-kernel init functions? or put another way, can a__setupfunction safely call in__initfunction?Here's the function in question:
static int parse_hd_setup (char *line) { int ints[6]; (void) get_options(line, ARRAY_SIZE(ints), ints); hd_setup(NULL, ints); return 1; }
__setup("hd=", parse_hd_setup);Should we make
parse_hd_setup()__init,
or makehd_setup()non-__init, or something else?
Quoted 6 lines
{time passes, he looks]
OK, I looked at
include/linux/init.h. From what I can see there,__setup()causes an .init.setup section to be emitted, so marking__setup()function as__initwould make sense. I think that this patch is good.
i saw that ide_setup() is __init as a bunch of lots others. yes init.h confirms that. :)
--
maks
kernel janitor http://janitor.kernelnewbies.org/
Quoted 4 lines · maximilian attems
Quoted 3 lines · Randy.Dunlap
Rusty, can you explain when
__setupfunctions are called relative to in-kernel init functions? or put another way, can a__setupfunction safely call in__initfunction?
Yes. init sections are discarded just before "init" is exec'ed, ie. at the last moment in the boot process. __setup() functions are called at the same time as module_param() parsing, which is all done before the various initcall/module_init calls.
Cheers,
Rusty.
Signature · 1 line
A bad analogy is like a leaky screwdriver -- Richard Braakman