linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] /fs/proc/meminfo.c: fix compilation error
@ 2011-11-03 16:27 Claudio Scordino
  2011-11-17  5:06 ` David Rientjes
  0 siblings, 1 reply; 3+ messages in thread
From: Claudio Scordino @ 2011-11-03 16:27 UTC (permalink / raw)
  To: viro; +Cc: Linux Kernel, linux-fsdevel

Hi all,

	the current mainline kernel gives a "directives may not be used inside a 
macro argument" error message when compiled for the cris architecture.

The error is located in the /fs/proc/meminfo.c file.

The attached patch fixed this error.

Best regards,

	Claudio Scordino



Subject: /fs/proc/meminfo.c: fix compilation error
From: Claudio Scordino <claudio@evidence.eu.com>

Patch to fix the error message "directives may not be used inside a macro
argument" which appears when the kernel is compiled for the cris architecture.

Signed-off-by: Claudio Scordino <claudio@evidence.eu.com>
---
 fs/proc/meminfo.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
index 5861741..80e4645 100644
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
@@ -131,12 +131,13 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
 		K(i.freeswap),
 		K(global_page_state(NR_FILE_DIRTY)),
 		K(global_page_state(NR_WRITEBACK)),
-		K(global_page_state(NR_ANON_PAGES)
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
+		K(global_page_state(NR_ANON_PAGES)
 		  + global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
-		  HPAGE_PMD_NR
+		  HPAGE_PMD_NR),
+#else
+		K(global_page_state(NR_ANON_PAGES)),
 #endif
-		  ),
 		K(global_page_state(NR_FILE_MAPPED)),
 		K(global_page_state(NR_SHMEM)),
 		K(global_page_state(NR_SLAB_RECLAIMABLE) +
-- 
1.7.1

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

* Re: [PATCH] /fs/proc/meminfo.c: fix compilation error
  2011-11-03 16:27 [PATCH] /fs/proc/meminfo.c: fix compilation error Claudio Scordino
@ 2011-11-17  5:06 ` David Rientjes
  2011-11-17  8:43   ` Claudio Scordino
  0 siblings, 1 reply; 3+ messages in thread
From: David Rientjes @ 2011-11-17  5:06 UTC (permalink / raw)
  To: Claudio Scordino; +Cc: Andrew Morton, viro, Linux Kernel, linux-fsdevel

On Thu, 3 Nov 2011, Claudio Scordino wrote:

> diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
> index 5861741..80e4645 100644
> --- a/fs/proc/meminfo.c
> +++ b/fs/proc/meminfo.c
> @@ -131,12 +131,13 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
>  		K(i.freeswap),
>  		K(global_page_state(NR_FILE_DIRTY)),
>  		K(global_page_state(NR_WRITEBACK)),
> -		K(global_page_state(NR_ANON_PAGES)
>  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
> +		K(global_page_state(NR_ANON_PAGES)
>  		  + global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
> -		  HPAGE_PMD_NR
> +		  HPAGE_PMD_NR),
> +#else
> +		K(global_page_state(NR_ANON_PAGES)),
>  #endif
> -		  ),
>  		K(global_page_state(NR_FILE_MAPPED)),
>  		K(global_page_state(NR_SHMEM)),
>  		K(global_page_state(NR_SLAB_RECLAIMABLE) +

Looks like this needs to be fixed for the per-node sysfs meminfo files as 
well?  See node_read_meminfo() in drivers/base/node.c.

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

* Re: [PATCH] /fs/proc/meminfo.c: fix compilation error
  2011-11-17  5:06 ` David Rientjes
@ 2011-11-17  8:43   ` Claudio Scordino
  0 siblings, 0 replies; 3+ messages in thread
From: Claudio Scordino @ 2011-11-17  8:43 UTC (permalink / raw)
  To: David Rientjes; +Cc: Andrew Morton, viro, Linux Kernel, linux-fsdevel

Il 17/11/2011 06:06, David Rientjes ha scritto:
> On Thu, 3 Nov 2011, Claudio Scordino wrote:
> 
>> diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
>> index 5861741..80e4645 100644
>> --- a/fs/proc/meminfo.c
>> +++ b/fs/proc/meminfo.c
>> @@ -131,12 +131,13 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
>>   		K(i.freeswap),
>>   		K(global_page_state(NR_FILE_DIRTY)),
>>   		K(global_page_state(NR_WRITEBACK)),
>> -		K(global_page_state(NR_ANON_PAGES)
>>   #ifdef CONFIG_TRANSPARENT_HUGEPAGE
>> +		K(global_page_state(NR_ANON_PAGES)
>>   		  + global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
>> -		  HPAGE_PMD_NR
>> +		  HPAGE_PMD_NR),
>> +#else
>> +		K(global_page_state(NR_ANON_PAGES)),
>>   #endif
>> -		  ),
>>   		K(global_page_state(NR_FILE_MAPPED)),
>>   		K(global_page_state(NR_SHMEM)),
>>   		K(global_page_state(NR_SLAB_RECLAIMABLE) +
> 
> Looks like this needs to be fixed for the per-node sysfs meminfo files as
> well?  See node_read_meminfo() in drivers/base/node.c.

Hi David,

	that file cannot be compiled for the cris architecture
(therefore, with the compiler that gave me the error) because
CONFIG_NUMA cannot be defined for the cris architecture.

However, I forced make to build also that file, and actually I got the
same error (i.e., "directives may not be used inside a macro argument").

Since Andrew already took the patch for the meminfo.c file, I'm going to
send a further patch for this specific file.

Let me know if instead you prefer to have a single patch for both files.

Best regards,

	Claudio

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

end of thread, other threads:[~2011-11-17  8:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-03 16:27 [PATCH] /fs/proc/meminfo.c: fix compilation error Claudio Scordino
2011-11-17  5:06 ` David Rientjes
2011-11-17  8:43   ` Claudio Scordino

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).