linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: David Miller <davem@davemloft.net>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-next@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	netdev@vger.kernel.org, Randy Dunlap <rdunlap@xenotime.net>
Subject: [PATCH] net sysctl: Add place holder functions for when sysctl support is compiled out of the kernel.
Date: Mon, 23 Apr 2012 15:13:02 -0700	[thread overview]
Message-ID: <m1lilmt7v5.fsf_-_@fess.ebiederm.org> (raw)
In-Reply-To: <4F958598.6080305@xenotime.net> (Randy Dunlap's message of "Mon, 23 Apr 2012 09:38:48 -0700")


Randy Dunlap <rdunlap@xenotime.net> reported:
> On 04/23/2012 12:07 AM, Stephen Rothwell wrote:
>
>> Hi all,
>>
>> Changes since 20120420:
>
>
>
> ERROR: "unregister_net_sysctl_table" [net/phonet/phonet.ko] undefined!
> ERROR: "register_net_sysctl" [net/phonet/phonet.ko] undefined!
>
> when CONFIG_SYSCTL is not enabled.

Add static inline stub functions to gracefully handle the case when sysctl
support is not present.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 include/net/net_namespace.h |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 3ee4a3d..ac9195e 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -284,11 +284,20 @@ struct ctl_table_header;
 
 #ifdef CONFIG_SYSCTL
 extern int net_sysctl_init(void);
-#else
-static inline int net_sysctl_init(void) { return 0; }
-#endif
 extern struct ctl_table_header *register_net_sysctl(struct net *net,
 	const char *path, struct ctl_table *table);
 extern void unregister_net_sysctl_table(struct ctl_table_header *header);
+#else
+static inline int net_sysctl_init(void) { return 0; }
+static inline struct ctl_table_header *register_net_sysctl(struct net *net,
+	const char *path, struct ctl_table *table)
+{
+	return NULL;
+}
+static inline void unregister_net_sysctl_table(struct ctl_table_header *header)
+{
+}
+#endif
+
 
 #endif /* __NET_NET_NAMESPACE_H */
-- 
1.7.2.5

  reply	other threads:[~2012-04-23 22:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23  7:07 linux-next: Tree for Apr 23 Stephen Rothwell
2012-04-23 16:25 ` linux-next: Tree for Apr 23 (ax.25 sysctl) Randy Dunlap
2012-04-24  0:16   ` Eric W. Biederman
2012-04-24  0:23   ` [PATCH] net ax25: Fix the build when sysctl support is disabled Eric W. Biederman
2012-04-24  0:25   ` Eric W. Biederman
2012-04-24  1:28     ` Randy Dunlap
2012-04-24  2:15       ` David Miller
2012-04-23 16:38 ` linux-next: Tree for Apr 23 (phonet sysctl) Randy Dunlap
2012-04-23 22:13   ` Eric W. Biederman [this message]
2012-04-23 22:38     ` [PATCH] net sysctl: Add place holder functions for when sysctl support is compiled out of the kernel Randy Dunlap
2012-04-23 23:24       ` David Miller

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=m1lilmt7v5.fsf_-_@fess.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    --cc=sfr@canb.auug.org.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;
as well as URLs for NNTP newsgroup(s).