linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: zcache: fix compile error
@ 2013-04-01  3:50 Bob Liu
  2013-04-01 12:17 ` Konrad Rzeszutek Wilk
  2013-04-07  1:14 ` Ric Mason
  0 siblings, 2 replies; 6+ messages in thread
From: Bob Liu @ 2013-04-01  3:50 UTC (permalink / raw)
  To: gregkh; +Cc: konrad.wilk, dan.magenheimer, fengguang.wu, linux-mm, Bob Liu

Because 'ramster_debugfs_init' is not defined if !CONFIG_DEBUG_FS, there is
compile error like:

$ make drivers/staging/zcache/

staging/zcache/zbud.c:291:16: warning: a??zbud_pers_evicted_pageframesa?? defined
but not used [-Wunused-variable]
staging/zcache/ramster/ramster.c: In function a??ramster_inita??:
staging/zcache/ramster/ramster.c:981:2: error: implicit declaration of
function a??ramster_debugfs_inita?? [-Werror=implicit-function-declaration]

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

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Bob Liu <bob.liu@oracle.com>
---
 drivers/staging/zcache/ramster/ramster.c |    4 ++++
 drivers/staging/zcache/zbud.c            |    6 ++++--
 drivers/staging/zcache/zcache-main.c     |    2 --
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/zcache/ramster/ramster.c b/drivers/staging/zcache/ramster/ramster.c
index 4f715c7..e562c14 100644
--- a/drivers/staging/zcache/ramster/ramster.c
+++ b/drivers/staging/zcache/ramster/ramster.c
@@ -134,6 +134,10 @@ static int ramster_debugfs_init(void)
 }
 #undef	zdebugfs
 #undef	zdfs64
+#else
+static int ramster_debugfs_init(void)
+{
+}
 #endif
 
 static LIST_HEAD(ramster_rem_op_list);
diff --git a/drivers/staging/zcache/zbud.c b/drivers/staging/zcache/zbud.c
index fdff5c6..2d38c96 100644
--- a/drivers/staging/zcache/zbud.c
+++ b/drivers/staging/zcache/zbud.c
@@ -342,6 +342,10 @@ static int zbud_debugfs_init(void)
 }
 #undef	zdfs
 #undef	zdfs64
+#else
+static int zbud_debugfs_init(void)
+{
+}
 #endif
 
 /* protects the buddied list and all unbuddied lists */
@@ -1051,9 +1055,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++) {
diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcache/zcache-main.c
index 4e52a94..ac75670 100644
--- a/drivers/staging/zcache/zcache-main.c
+++ b/drivers/staging/zcache/zcache-main.c
@@ -1753,9 +1753,7 @@ static int zcache_init(void)
 		namestr = "ramster";
 		ramster_register_pamops(&zcache_pamops);
 	}
-#ifdef CONFIG_DEBUG_FS
 	zcache_debugfs_init();
-#endif
 	if (zcache_enabled) {
 		unsigned int cpu;
 
-- 
1.7.10.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] staging: zcache: fix compile error
  2013-04-01  3:50 [PATCH] staging: zcache: fix compile error Bob Liu
@ 2013-04-01 12:17 ` Konrad Rzeszutek Wilk
  2013-04-01 17:56   ` Greg KH
  2013-04-07  1:14 ` Ric Mason
  1 sibling, 1 reply; 6+ messages in thread
From: Konrad Rzeszutek Wilk @ 2013-04-01 12:17 UTC (permalink / raw)
  To: Bob Liu; +Cc: gregkh, dan.magenheimer, fengguang.wu, linux-mm, Bob Liu

On Mon, Apr 01, 2013 at 11:50:47AM +0800, Bob Liu wrote:
> Because 'ramster_debugfs_init' is not defined if !CONFIG_DEBUG_FS, there is
> compile error like:
> 
> $ make drivers/staging/zcache/
> 
> staging/zcache/zbud.c:291:16: warning: ‘zbud_pers_evicted_pageframes’ defined
> but not used [-Wunused-variable]
> 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 with the
> same way.
> 
> Reported-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Bob Liu <bob.liu@oracle.com>
> ---
>  drivers/staging/zcache/ramster/ramster.c |    4 ++++
>  drivers/staging/zcache/zbud.c            |    6 ++++--
>  drivers/staging/zcache/zcache-main.c     |    2 --
>  3 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/zcache/ramster/ramster.c b/drivers/staging/zcache/ramster/ramster.c
> index 4f715c7..e562c14 100644
> --- a/drivers/staging/zcache/ramster/ramster.c
> +++ b/drivers/staging/zcache/ramster/ramster.c
> @@ -134,6 +134,10 @@ static int ramster_debugfs_init(void)
>  }
>  #undef	zdebugfs
>  #undef	zdfs64
> +#else
> +static int ramster_debugfs_init(void)
> +{
> +}

That is not going to work. It will complain about not returning a proper value.
Also you can use inline in it.
>  #endif
>  
>  static LIST_HEAD(ramster_rem_op_list);
> diff --git a/drivers/staging/zcache/zbud.c b/drivers/staging/zcache/zbud.c
> index fdff5c6..2d38c96 100644
> --- a/drivers/staging/zcache/zbud.c
> +++ b/drivers/staging/zcache/zbud.c
> @@ -342,6 +342,10 @@ static int zbud_debugfs_init(void)
>  }
>  #undef	zdfs
>  #undef	zdfs64
> +#else
> +static int zbud_debugfs_init(void)
> +{
> +}

Ditto. You need to return 0 and you can make it inline.

>  #endif
>  
>  /* protects the buddied list and all unbuddied lists */
> @@ -1051,9 +1055,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++) {
> diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcache/zcache-main.c
> index 4e52a94..ac75670 100644
> --- a/drivers/staging/zcache/zcache-main.c
> +++ b/drivers/staging/zcache/zcache-main.c
> @@ -1753,9 +1753,7 @@ static int zcache_init(void)
>  		namestr = "ramster";
>  		ramster_register_pamops(&zcache_pamops);
>  	}
> -#ifdef CONFIG_DEBUG_FS
>  	zcache_debugfs_init();
> -#endif
>  	if (zcache_enabled) {
>  		unsigned int cpu;
>  

That looks OK, and should be as a seperate patch - as there are no compilation
failures with zcache-main.c

> -- 
> 1.7.10.4
> 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] staging: zcache: fix compile error
  2013-04-01 12:17 ` Konrad Rzeszutek Wilk
@ 2013-04-01 17:56   ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2013-04-01 17:56 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: Bob Liu, dan.magenheimer, fengguang.wu, linux-mm, Bob Liu

On Mon, Apr 01, 2013 at 08:17:36AM -0400, Konrad Rzeszutek Wilk wrote:
> On Mon, Apr 01, 2013 at 11:50:47AM +0800, Bob Liu wrote:
> > --- a/drivers/staging/zcache/zcache-main.c
> > +++ b/drivers/staging/zcache/zcache-main.c
> > @@ -1753,9 +1753,7 @@ static int zcache_init(void)
> >  		namestr = "ramster";
> >  		ramster_register_pamops(&zcache_pamops);
> >  	}
> > -#ifdef CONFIG_DEBUG_FS
> >  	zcache_debugfs_init();
> > -#endif
> >  	if (zcache_enabled) {
> >  		unsigned int cpu;
> >  
> 
> That looks OK, and should be as a seperate patch - as there are no compilation
> failures with zcache-main.c

No, make it in the same patch, it is relevant here.

greg k-h

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] staging: zcache: fix compile error
  2013-04-01  3:50 [PATCH] staging: zcache: fix compile error Bob Liu
  2013-04-01 12:17 ` Konrad Rzeszutek Wilk
@ 2013-04-07  1:14 ` Ric Mason
  2013-04-07  8:06   ` Bob Liu
  1 sibling, 1 reply; 6+ messages in thread
From: Ric Mason @ 2013-04-07  1:14 UTC (permalink / raw)
  To: Bob Liu
  Cc: gregkh, konrad.wilk, dan.magenheimer, fengguang.wu, linux-mm,
	Bob Liu

Hi Bob,
On 04/01/2013 11:50 AM, Bob Liu wrote:
> Because 'ramster_debugfs_init' is not defined if !CONFIG_DEBUG_FS, there is

How you configure ramster? I can't find "Cross-machine RAM capacity 
sharing, aka peer-to-peer tmem" option in Device Drivers->Staging drivers->

  a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a?? 
Search Results 
a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??
   a?? Symbol: RAMSTER [=n] a??
   a?? Type  : boolean a??
   a?? Prompt: Cross-machine RAM capacity sharing, aka peer-to-peer tmem a??
   a??   Defined at drivers/staging/zcache/Kconfig:13 a??
   a??   Depends on: STAGING [=y] && CONFIGFS_FS [=m]=y && SYSFS [=y] && 
!HIGHMEM [=n] && ZCACHE [=y] && NET [=y] a??
   a?? Location: a??
   a??     -> Device Drivers a??
   a??       -> Staging drivers (STAGING [=y]) a??
   a?? (1)     -> Dynamic compression of swap pages and clean pagecache 
pages (ZCACHE [=y]) a??
   a??   Selects: HAVE_ALIGNED_STRUCT_PAGE [=y]

> compile error like:
>
> $ make drivers/staging/zcache/
>
> staging/zcache/zbud.c:291:16: warning: a??zbud_pers_evicted_pageframesa?? defined
> but not used [-Wunused-variable]
> staging/zcache/ramster/ramster.c: In function a??ramster_inita??:
> staging/zcache/ramster/ramster.c:981:2: error: implicit declaration of
> function a??ramster_debugfs_inita?? [-Werror=implicit-function-declaration]
>
> This patch fix it and reduce some #ifdef CONFIG_DEBUG_FS in .c files with the
> same way.
>
> Reported-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Bob Liu <bob.liu@oracle.com>
> ---
>   drivers/staging/zcache/ramster/ramster.c |    4 ++++
>   drivers/staging/zcache/zbud.c            |    6 ++++--
>   drivers/staging/zcache/zcache-main.c     |    2 --
>   3 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/zcache/ramster/ramster.c b/drivers/staging/zcache/ramster/ramster.c
> index 4f715c7..e562c14 100644
> --- a/drivers/staging/zcache/ramster/ramster.c
> +++ b/drivers/staging/zcache/ramster/ramster.c
> @@ -134,6 +134,10 @@ static int ramster_debugfs_init(void)
>   }
>   #undef	zdebugfs
>   #undef	zdfs64
> +#else
> +static int ramster_debugfs_init(void)
> +{
> +}
>   #endif
>   
>   static LIST_HEAD(ramster_rem_op_list);
> diff --git a/drivers/staging/zcache/zbud.c b/drivers/staging/zcache/zbud.c
> index fdff5c6..2d38c96 100644
> --- a/drivers/staging/zcache/zbud.c
> +++ b/drivers/staging/zcache/zbud.c
> @@ -342,6 +342,10 @@ static int zbud_debugfs_init(void)
>   }
>   #undef	zdfs
>   #undef	zdfs64
> +#else
> +static int zbud_debugfs_init(void)
> +{
> +}
>   #endif
>   
>   /* protects the buddied list and all unbuddied lists */
> @@ -1051,9 +1055,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++) {
> diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcache/zcache-main.c
> index 4e52a94..ac75670 100644
> --- a/drivers/staging/zcache/zcache-main.c
> +++ b/drivers/staging/zcache/zcache-main.c
> @@ -1753,9 +1753,7 @@ static int zcache_init(void)
>   		namestr = "ramster";
>   		ramster_register_pamops(&zcache_pamops);
>   	}
> -#ifdef CONFIG_DEBUG_FS
>   	zcache_debugfs_init();
> -#endif
>   	if (zcache_enabled) {
>   		unsigned int cpu;
>   

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] staging: zcache: fix compile error
  2013-04-07  1:14 ` Ric Mason
@ 2013-04-07  8:06   ` Bob Liu
  2013-04-07  8:11     ` Ric Mason
  0 siblings, 1 reply; 6+ messages in thread
From: Bob Liu @ 2013-04-07  8:06 UTC (permalink / raw)
  To: Ric Mason
  Cc: Bob Liu, gregkh, konrad.wilk, dan.magenheimer, fengguang.wu,
	linux-mm


On 04/07/2013 09:14 AM, Ric Mason wrote:
> Hi Bob,
> On 04/01/2013 11:50 AM, Bob Liu wrote:
>> Because 'ramster_debugfs_init' is not defined if !CONFIG_DEBUG_FS,
>> there is
> 
> How you configure ramster? I can't find "Cross-machine RAM capacity
> sharing, aka peer-to-peer tmem" option in Device Drivers->Staging drivers->
> 
>  a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??
> Search Results
> a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??
>   a?? Symbol: RAMSTER [=n] a??
>   a?? Type  : boolean a??
>   a?? Prompt: Cross-machine RAM capacity sharing, aka peer-to-peer tmem a??
>   a??   Defined at drivers/staging/zcache/Kconfig:13 a??
>   a??   Depends on: STAGING [=y] && CONFIGFS_FS [=m]=y && SYSFS [=y] &&
> !HIGHMEM [=n] && ZCACHE [=y] && NET [=y] a??
>   a?? Location: a??
>   a??     -> Device Drivers a??
>   a??       -> Staging drivers (STAGING [=y]) a??
>   a?? (1)     -> Dynamic compression of swap pages and clean pagecache
> pages (ZCACHE [=y]) a??
>   a??   Selects: HAVE_ALIGNED_STRUCT_PAGE [=y]
> 

Please confirm:
CONFIG_X86_32=y
CONFIG_NOHIGHMEM=y
CONFIG_CONFIGFS_FS=y

Thanks,
-Bob

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] staging: zcache: fix compile error
  2013-04-07  8:06   ` Bob Liu
@ 2013-04-07  8:11     ` Ric Mason
  0 siblings, 0 replies; 6+ messages in thread
From: Ric Mason @ 2013-04-07  8:11 UTC (permalink / raw)
  To: Bob Liu
  Cc: Bob Liu, gregkh, konrad.wilk, dan.magenheimer, fengguang.wu,
	linux-mm

On 04/07/2013 04:06 PM, Bob Liu wrote:
> On 04/07/2013 09:14 AM, Ric Mason wrote:
>> Hi Bob,
>> On 04/01/2013 11:50 AM, Bob Liu wrote:
>>> Because 'ramster_debugfs_init' is not defined if !CONFIG_DEBUG_FS,
>>> there is
>> How you configure ramster? I can't find "Cross-machine RAM capacity
>> sharing, aka peer-to-peer tmem" option in Device Drivers->Staging drivers->
>>
>>   a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??
>> Search Results
>> a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??a??
>>    a?? Symbol: RAMSTER [=n] a??
>>    a?? Type  : boolean a??
>>    a?? Prompt: Cross-machine RAM capacity sharing, aka peer-to-peer tmem a??
>>    a??   Defined at drivers/staging/zcache/Kconfig:13 a??
>>    a??   Depends on: STAGING [=y] && CONFIGFS_FS [=m]=y && SYSFS [=y] &&
>> !HIGHMEM [=n] && ZCACHE [=y] && NET [=y] a??
>>    a?? Location: a??
>>    a??     -> Device Drivers a??
>>    a??       -> Staging drivers (STAGING [=y]) a??
>>    a?? (1)     -> Dynamic compression of swap pages and clean pagecache
>> pages (ZCACHE [=y]) a??
>>    a??   Selects: HAVE_ALIGNED_STRUCT_PAGE [=y]
>>
> Please confirm:
> CONFIG_X86_32=y
> CONFIG_NOHIGHMEM=y
> CONFIG_CONFIGFS_FS=y

Got it, thanks.

>
> Thanks,
> -Bob

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-04-07  8:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-01  3:50 [PATCH] staging: zcache: fix compile error Bob Liu
2013-04-01 12:17 ` Konrad Rzeszutek Wilk
2013-04-01 17:56   ` Greg KH
2013-04-07  1:14 ` Ric Mason
2013-04-07  8:06   ` Bob Liu
2013-04-07  8:11     ` Ric Mason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).