]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/linux/moduleparam.h
drivers/edac: new inte 30x0 MC driver
[karo-tx-linux.git] / include / linux / moduleparam.h
index 7c0c2c198f1f64400cb269d2e9608031e690ea30..c83588c8d08b25aacbc72edc2d3529912c674248 100644 (file)
@@ -59,10 +59,13 @@ struct kparam_array
 };
 
 /* This is the fundamental function for registering boot/module
-   parameters.  perm sets the visibility in driverfs: 000 means it's
+   parameters.  perm sets the visibility in sysfs: 000 means it's
    not there, read bits mean it's readable, write bits mean it's
    writable. */
 #define __module_param_call(prefix, name, set, get, arg, perm)         \
+       /* Default value instead of permissions? */                     \
+       static int __param_perm_check_##name __attribute__((unused)) =  \
+       BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)); \
        static char __param_str_##name[] = prefix #name;                \
        static struct kernel_param const __param_##name                 \
        __attribute_used__                                              \
@@ -166,10 +169,22 @@ extern int param_get_string(char *buffer, struct kernel_param *kp);
 
 struct module;
 
+#if defined(CONFIG_SYSFS) && defined(CONFIG_MODULES)
 extern int module_param_sysfs_setup(struct module *mod,
                                    struct kernel_param *kparam,
                                    unsigned int num_params);
 
 extern void module_param_sysfs_remove(struct module *mod);
+#else
+static inline int module_param_sysfs_setup(struct module *mod,
+                            struct kernel_param *kparam,
+                            unsigned int num_params)
+{
+       return 0;
+}
+
+static inline void module_param_sysfs_remove(struct module *mod)
+{ }
+#endif
 
 #endif /* _LINUX_MODULE_PARAMS_H */