From akpm@osdl.org Mon Aug 14 22:43:54 2006 Message-Id: <200608150543.k7F5hNxG011765@shell0.pdx.osdl.net> Subject: sysfs: add proper sysfs_init() prototype To: greg@kroah.com Cc: akpm@osdl.org, rdunlap@xenotime.net From: akpm@osdl.org Date: Mon, 14 Aug 2006 22:43:23 -0700 From: Andrew Morton Don't be crufty. Mark it __must_check too. Cc: "Randy.Dunlap" Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- fs/namespace.c | 10 +--------- include/linux/sysfs.h | 7 +++++++ 2 files changed, 8 insertions(+), 9 deletions(-) --- gregkh-2.6.orig/fs/namespace.c +++ gregkh-2.6/fs/namespace.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -28,15 +29,6 @@ extern int __init init_rootfs(void); -#ifdef CONFIG_SYSFS -extern int __init sysfs_init(void); -#else -static inline int sysfs_init(void) -{ - return 0; -} -#endif - /* spinlock for vfsmount related operations, inplace of dcache_lock */ __cacheline_aligned_in_smp DEFINE_SPINLOCK(vfsmount_lock); --- gregkh-2.6.orig/include/linux/sysfs.h +++ gregkh-2.6/include/linux/sysfs.h @@ -123,6 +123,8 @@ int __must_check sysfs_create_group(stru void sysfs_remove_group(struct kobject *, const struct attribute_group *); void sysfs_notify(struct kobject * k, char *dir, char *attr); +extern int __must_check sysfs_init(void); + #else /* CONFIG_SYSFS */ static inline int sysfs_create_dir(struct kobject * k) @@ -194,6 +196,11 @@ static inline void sysfs_notify(struct k { } +static inline int __must_check sysfs_init(void) +{ + return 0; +} + #endif /* CONFIG_SYSFS */ #endif /* _SYSFS_H_ */