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

On 04/23/2012 03:13 PM, Eric W. Biederman wrote:

> 
> 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>


Yep, that works.

Acked-by: Randy Dunlap <rdunlap@xenotime.net>

Thanks.

> ---
>  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 */



-- 
~Randy

  reply	other threads:[~2012-04-23 22:38 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   ` [PATCH] net sysctl: Add place holder functions for when sysctl support is compiled out of the kernel Eric W. Biederman
2012-04-23 22:38     ` Randy Dunlap [this message]
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=4F95D9F5.3040407@xenotime.net \
    --to=rdunlap@xenotime.net \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --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 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.