From: Andreas Herrmann <aherrman@arcor.de>
To: roel <12o3l@tiscali.nl>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Eric Van Hensbergen <ericvh@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 9p: fix compile error if !CONFIG_SYSCTL
Date: Tue, 18 Sep 2007 22:15:26 +0200 [thread overview]
Message-ID: <20070918201526.GB5279@devil> (raw)
In-Reply-To: <46F01E9F.3010307@tiscali.nl>
On Tue, Sep 18, 2007 at 08:53:19PM +0200, roel wrote:
> Andreas Herrmann wrote:
> > Fix compile error if !CONFIG_SYSCTL:
> >
> > ...
> > LD .tmp_vmlinux1
> > net/built-in.o: In function `init_p9':
> > net/9p/mod.c:59: undefined reference to `p9_sysctl_register'
> > net/built-in.o: In function `exit_p9':
> > net/9p/mod.c:75: undefined reference to `p9_sysctl_unregister'
> > make: *** [.tmp_vmlinux1] Error 1
> > ...
> >
> isn't it nicer to do something like this instead?
No.
> diff --git a/net/9p/sysctl.c b/net/9p/sysctl.c
> index 8b61027..e199865 100644
> --- a/net/9p/sysctl.c
> +++ b/net/9p/sysctl.c
> @@ -68,14 +68,17 @@ static struct ctl_table_header *p9_table_header;
>
> int __init p9_sysctl_register(void)
> {
> +#ifdef CONFIG_SYSCTL
> p9_table_header = register_sysctl_table(p9_ctl_table);
> if (!p9_table_header)
> return -ENOMEM;
> -
> +#endif
> return 0;
> }
>
> void __exit p9_sysctl_unregister(void)
> {
> +#ifdef CONFIG_SYSCTL
> unregister_sysctl_table(p9_table_header);
> +#endif
> }
The problem is not that (un)register_sysctl_table were not defined
if !CONFIG_SYSCTL. There are stubs in kernel/sysctl.c for this case.
I.e. your patch is superfluous.
The point is, 9p/sysctl.c is compiled iff CONFIG_SYSCTL is set.
See net/9p/Makefile ...
Regards,
Andreas
next prev parent reply other threads:[~2007-09-18 20:14 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-18 8:05 [PATCH] 9p: fix compile error if !CONFIG_SYSCTL Andreas Herrmann
2007-09-18 18:53 ` roel
2007-09-18 20:15 ` Andreas Herrmann [this message]
2007-09-20 6:31 ` Andrew Morton
2007-09-20 7:23 ` Andreas Herrmann
2007-09-27 21:40 ` Nick Piggin
2007-09-28 14:34 ` Linus Torvalds
2007-09-28 0:05 ` Nick Piggin
2007-09-28 17:11 ` Arjan van de Ven
2007-09-28 17:12 ` Elyse M. Grasso
2007-10-01 7:27 ` A bit of kconfig rewrite (Re: [PATCH] 9p: fix compile error if !CONFIG_SYSCTL) Oleg Verych
2007-10-01 8:05 ` Sam Ravnborg
2007-10-01 12:53 ` Elyse M. Grasso
2007-10-05 2:35 ` [kbuild-devel] " Roman Zippel
2007-10-06 15:26 ` Oleg Verych
2007-10-06 16:03 ` Linus Torvalds
2007-10-06 17:51 ` Oleg Verych
2007-10-06 18:59 ` Sam Ravnborg
2007-10-06 20:47 ` Oleg Verych
2007-10-06 21:10 ` Sam Ravnborg
2007-10-06 22:07 ` Oleg Verych
2007-10-07 9:49 ` Geert Uytterhoeven
2007-10-08 20:22 ` Sam Ravnborg
2007-10-08 21:25 ` Oleg Verych
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=20070918201526.GB5279@devil \
--to=aherrman@arcor.de \
--cc=12o3l@tiscali.nl \
--cc=akpm@linux-foundation.org \
--cc=ericvh@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.