X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=include%2Flinux%2Fmoduleparam.h;h=c83588c8d08b25aacbc72edc2d3529912c674248;hb=541010e4b8921cd781ff02ae68028501457045b6;hp=b5c98c43779e4ada67ae76132ed0279967a48f9a;hpb=0a0fc0ddbe732779366ab6b1b879f62195e65967;p=linux-2.6-omap-h63xx.git diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index b5c98c43779..c83588c8d08 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__ \ @@ -162,21 +165,26 @@ extern int param_array_get(char *buffer, struct kernel_param *kp); extern int param_set_copystring(const char *val, struct kernel_param *kp); extern int param_get_string(char *buffer, struct kernel_param *kp); -int param_array(const char *name, - const char *val, - unsigned int min, unsigned int max, - void *elem, int elemsize, - int (*set)(const char *, struct kernel_param *kp), - int *num); - /* for exporting parameters in /sys/parameters */ 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 */