Subject: Re: [PATCH v2] module: fix build for CONFIG_SYSFS=n

From: Takashi Iwai <[email-masked]>
Date: Thu, 19 Feb 2009 08:32:09 +0100

At Wed, 18 Feb 2009 10:35:20 -0800,
Randy Dunlap wrote:
> 
> > Is destroy_params() dependent on SYSFS? If yes then it would be 
> 
> Yes.
> 
> > far cleaner if there was a NOP destroy_params() inline for the 
> > !SYSFS case.
> 
> 
> 
> 
> From: Randy Dunlap <[email-masked]>
> 
> Fix this build error when CONFIG_SYSFS=n:
> 
> kernel/built-in.o: In function `free_module':
> module.c:(.text+0x4f8a2): undefined reference to `destroy_params'
> 
> Signed-off-by: Randy Dunlap <[email-masked]>
> cc: Rusty Russell <[email-masked]>
> ---
>  kernel/params.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> --- linux-next-20090218.orig/kernel/params.c
> +++ linux-next-20090218/kernel/params.c
> @@ -761,6 +761,12 @@ static int __init param_sysfs_init(void)
>  }
>  subsys_initcall(param_sysfs_init);
>  
> +#else	/* !CONFIG_SYSFS */
> +
> +inline void destroy_params(const struct kernel_param *params, unsigned num)
> +{
> +}

Just wondering whether any need to be (external) inline at this place,
supposing it just to be called from other files.
If inlining, isn't it better in include/linux/moduleparam.h?

thanks,

Takashi