]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drivers: staging: zcache: fix compile error
authorBob Liu <lliubbo@gmail.com>
Tue, 2 Apr 2013 02:47:42 +0000 (10:47 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Apr 2013 19:43:41 +0000 (12:43 -0700)
Because 'ramster_debugfs_init' is not defined if !CONFIG_DEBUG_FS, there is
compile error:

$ make drivers/staging/zcache/
staging/zcache/ramster/ramster.c: In function ‘ramster_init’:
staging/zcache/ramster/ramster.c:981:2: error: implicit declaration of
function ‘ramster_debugfs_init’ [-Werror=implicit-function-declaration]

This patch fix it and reduce some #ifdef CONFIG_DEBUG_FS in .c files the same
way.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Bob Liu <bob.liu@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/zcache/ramster/ramster.c
drivers/staging/zcache/zbud.c
drivers/staging/zcache/zcache-main.c

index bf96a1cbf7c11024a455d2e15c8c4a90d856840a..01fc672399fe4b3a837eb3e7344b0cadc393e356 100644 (file)
@@ -134,6 +134,11 @@ static int __init ramster_debugfs_init(void)
 }
 #undef zdebugfs
 #undef zdfs64
+#else
+static inline int ramster_debugfs_init(void)
+{
+       return 0;
+}
 #endif
 
 static LIST_HEAD(ramster_rem_op_list);
index fdff5c6a02396382a7d765461daa257a77f159ed..6cda4ed9ed31106781335e7f9ab8daee1903714f 100644 (file)
@@ -342,6 +342,11 @@ static int zbud_debugfs_init(void)
 }
 #undef zdfs
 #undef zdfs64
+#else
+static inline int zbud_debugfs_init(void)
+{
+       return 0;
+}
 #endif
 
 /* protects the buddied list and all unbuddied lists */
@@ -1051,9 +1056,7 @@ void zbud_init(void)
 {
        int i;
 
-#ifdef CONFIG_DEBUG_FS
        zbud_debugfs_init();
-#endif
        BUG_ON((sizeof(struct tmem_handle) * 2 > CHUNK_SIZE));
        BUG_ON(sizeof(struct zbudpage) > sizeof(struct page));
        for (i = 0; i < NCHUNKS; i++) {
index 7a6dd966931bb78fba747d132b130d2718df3f49..cf3001c1f407bc6062a1ae1e7edc7bc1872bd688 100644 (file)
@@ -1733,9 +1733,7 @@ static int __init zcache_init(void)
                namestr = "ramster";
                ramster_register_pamops(&zcache_pamops);
        }
-#ifdef CONFIG_DEBUG_FS
        zcache_debugfs_init();
-#endif
        if (zcache_enabled) {
                unsigned int cpu;