X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=include%2Flinux%2Fmoduleparam.h;h=c83588c8d08b25aacbc72edc2d3529912c674248;hb=1497943ee692aa7519fa972d0e3a339649bf3a96;hp=7c0c2c198f1f64400cb269d2e9608031e690ea30;hpb=86579dd06deecfa6ac88d5e84e4d63c397cd6f6d;p=powerpc.git diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 7c0c2c198f..c83588c8d0 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h @@ -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 */