The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Randy.Dunlap" <rddunlap@osdl.org>
To: maximilian attems <janitor@sternwelten.at>
Cc: lkml <linux-kernel@vger.kernel.org>, akpm <akpm@osdl.org>,
	B.Zolnierkiewicz@elka.pw.edu.pl, rusty@rustcorp.com.au
Subject: Re: [patch 2/3] hd eliminate bad section references
Date: Mon, 04 Apr 2005 15:12:21 -0700	[thread overview]
Message-ID: <4251BBC5.8000802@osdl.org> (raw)
In-Reply-To: <20050404181102.GB12394@sputnik.stro.at>

maximilian attems wrote:
> Fix hd section references:
> make parse_hd_setup() __init
> 
> Error: ./drivers/ide/legacy/hd.o .text refers to 00000943 R_386_PC32
> .init.text
> 
> Signed-off-by: maximilian attems <janitor@sternwelten.at>
> 
> 
> --- linux-2.6.12-rc1-bk5/drivers/ide/legacy/hd.c.orig	2005-04-04 18:39:04.000000000 +0200
> +++ linux-2.6.12-rc1-bk5/drivers/ide/legacy/hd.c	2005-04-04 19:02:57.908576221 +0200
> @@ -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.
-- 
~Randy

  reply	other threads:[~2005-04-04 22:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-04 18:11 [patch 2/3] hd eliminate bad section references maximilian attems
2005-04-04 22:12 ` Randy.Dunlap [this message]
2005-04-04 23:05   ` maximilian attems
2005-04-05  0:00     ` Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4251BBC5.8000802@osdl.org \
    --to=rddunlap@osdl.org \
    --cc=B.Zolnierkiewicz@elka.pw.edu.pl \
    --cc=akpm@osdl.org \
    --cc=janitor@sternwelten.at \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox