Skip to content

Commit

Permalink
drivers: staging: zcache: fix compile error
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Bob Liu <[email protected]>
Reviewed-by: Konrad Rzeszutek Wilk <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
aet00 authored and gregkh committed Apr 2, 2013
1 parent 6d3a637 commit 555ee46
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions drivers/staging/zcache/ramster/ramster.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 5 additions & 2 deletions drivers/staging/zcache/zbud.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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++) {
Expand Down
2 changes: 0 additions & 2 deletions drivers/staging/zcache/zcache-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 555ee46

Please sign in to comment.