lkml.org 
[lkml]   [2009]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH v2] module: fix build for CONFIG_SYSFS=n
Date
On Thursday 19 February 2009 05:45:29 Ingo Molnar wrote:
>
> * Randy Dunlap <randy.dunlap@oracle.com> 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 <randy.dunlap@oracle.com>
> >
> > Fix this build error when CONFIG_SYSFS=n:

Thanks for the find Randy. I chose to put it in the header. People who turn
off SYSFS probably appreciate a few bytes saved:

diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -139,7 +139,14 @@ extern int parse_args(const char *name,
int (*unknown)(char *param, char *val));

/* Called by module remove. */
+#ifdef CONFIG_SYSFS
extern void destroy_params(const struct kernel_param *params, unsigned num);
+#else
+static inline void destroy_params(const struct kernel_param *params,
+ unsigned num)
+{
+}
+#endif /* !CONFIG_SYSFS */

/* All the helper functions */
/* The macros to do compile-time type checking stolen from Jakub
Cheers,
Rusty.


\
 
 \ /
  Last update: 2009-02-19 11:53    [W:0.090 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site