* [PATCH] drivers/base/node.c: fix compilation error
@ 2011-11-17 10:08 Claudio Scordino
2011-11-17 17:52 ` Greg KH
2011-11-17 21:34 ` David Rientjes
0 siblings, 2 replies; 5+ messages in thread
From: Claudio Scordino @ 2011-11-17 10:08 UTC (permalink / raw)
To: Greg KH, Andrew Morton; +Cc: viro, Linux Kernel, David Rientjes
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.
It happened for the /fs/proc/meminfo.c file, for which a patch has been
already sent to LKML.
It happens for drivers/base/node.c too. The patch below fixes the
problem.
Best regards,
Claudio
Subject: /drivers/base/node.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>
---
drivers/base/node.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/base/node.c b/drivers/base/node.c
index 793f796..5693ece 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -127,12 +127,13 @@ static ssize_t node_read_meminfo(struct sys_device * dev,
nid, K(node_page_state(nid, NR_WRITEBACK)),
nid, K(node_page_state(nid, NR_FILE_PAGES)),
nid, K(node_page_state(nid, NR_FILE_MAPPED)),
- nid, K(node_page_state(nid, NR_ANON_PAGES)
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+ nid, K(node_page_state(nid, NR_ANON_PAGES)
+ node_page_state(nid, NR_ANON_TRANSPARENT_HUGEPAGES) *
- HPAGE_PMD_NR
+ HPAGE_PMD_NR),
+#else
+ nid, K(node_page_state(nid, NR_ANON_PAGES)),
#endif
- ),
nid, K(node_page_state(nid, NR_SHMEM)),
nid, node_page_state(nid, NR_KERNEL_STACK) *
THREAD_SIZE / 1024,
@@ -143,13 +144,14 @@ static ssize_t node_read_meminfo(struct sys_device * dev,
nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE) +
node_page_state(nid, NR_SLAB_UNRECLAIMABLE)),
nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE)),
- nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE))
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+ nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE))
, nid,
K(node_page_state(nid, NR_ANON_TRANSPARENT_HUGEPAGES) *
- HPAGE_PMD_NR)
+ HPAGE_PMD_NR));
+#else
+ nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE)));
#endif
- );
n += hugetlb_report_node_meminfo(nid, buf + n);
return n;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drivers/base/node.c: fix compilation error
2011-11-17 10:08 [PATCH] drivers/base/node.c: fix compilation error Claudio Scordino
@ 2011-11-17 17:52 ` Greg KH
2011-11-17 21:38 ` David Rientjes
2011-11-18 9:53 ` Claudio Scordino
2011-11-17 21:34 ` David Rientjes
1 sibling, 2 replies; 5+ messages in thread
From: Greg KH @ 2011-11-17 17:52 UTC (permalink / raw)
To: Claudio Scordino; +Cc: Andrew Morton, viro, Linux Kernel, David Rientjes
On Thu, Nov 17, 2011 at 11:08:32AM +0100, Claudio Scordino wrote:
> 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.
Is this because cris is using an older version of gcc, or is it due to
something else?
Is this a recent problem, or one that has been around for a long time
(i.e. this fix should go to the -stable trees?)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drivers/base/node.c: fix compilation error
2011-11-17 10:08 [PATCH] drivers/base/node.c: fix compilation error Claudio Scordino
2011-11-17 17:52 ` Greg KH
@ 2011-11-17 21:34 ` David Rientjes
1 sibling, 0 replies; 5+ messages in thread
From: David Rientjes @ 2011-11-17 21:34 UTC (permalink / raw)
To: Claudio Scordino; +Cc: Greg KH, Andrew Morton, viro, Linux Kernel
On Thu, 17 Nov 2011, Claudio Scordino wrote:
> Subject: /drivers/base/node.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>
Acked-by: David Rientjes <rientjes@google.com>
Thanks Claudio!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drivers/base/node.c: fix compilation error
2011-11-17 17:52 ` Greg KH
@ 2011-11-17 21:38 ` David Rientjes
2011-11-18 9:53 ` Claudio Scordino
1 sibling, 0 replies; 5+ messages in thread
From: David Rientjes @ 2011-11-17 21:38 UTC (permalink / raw)
To: Greg KH; +Cc: Claudio Scordino, Andrew Morton, viro, Linux Kernel
On Thu, 17 Nov 2011, Greg KH wrote:
> Is this a recent problem, or one that has been around for a long time
> (i.e. this fix should go to the -stable trees?)
>
The equivalent patch for /proc/meminfo in the -mm tree,
fs-proc-meminfoc-fix-compilation-error.patch, was cc'd to stable. This
one would have to go back to 2.6.38+.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drivers/base/node.c: fix compilation error
2011-11-17 17:52 ` Greg KH
2011-11-17 21:38 ` David Rientjes
@ 2011-11-18 9:53 ` Claudio Scordino
1 sibling, 0 replies; 5+ messages in thread
From: Claudio Scordino @ 2011-11-18 9:53 UTC (permalink / raw)
To: Greg KH; +Cc: Andrew Morton, viro, Linux Kernel, David Rientjes
Il 17/11/2011 18:52, Greg KH ha scritto:
> On Thu, Nov 17, 2011 at 11:08:32AM +0100, Claudio Scordino wrote:
>> 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.
>
> Is this because cris is using an older version of gcc, or is it due to
> something else?
Hi Greg.
The compiler I used it's still the same I used in the past (i.e., gcc 3.2.1):
/usr/local/cris/bin/cris-axis-linux-gnu-gcc -v
Reading specs from /usr/local/cris/lib/gcc-lib/cris-axis-linux-gnu/3.2.1/specs
Configured with: /home/cii/cris-dist/./gnu-toplev/configure --enable-version-specific-runtime-libs --disable-nls --target=cris-axis-linux-gnu --without-newlib --with-headers=installed --enable-languages=c,c++ --enable-shared --enable-threads=posix --prefix=/usr/local/cris
Thread model: posix
gcc version 3.2.1 Axis release R64/1.64
It's contained inside the cris-dist_1.64-1_i386.deb package. I don't
know if a newer compiler has been made available by the Axis group.
However, I never found this issue when compiling /fs/proc/meminfo.c in
the past. Therefore, I couldn't find the same error in
drivers/base/node.c either.
I suspect that /fs/proc/meminfo.c has been recently changed, and then the
same (old) compiler started complaining.
The two patches I have sent are very trivial, but allow to fix those
build problems.
Best regards,
Claudio
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-11-18 9:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-17 10:08 [PATCH] drivers/base/node.c: fix compilation error Claudio Scordino
2011-11-17 17:52 ` Greg KH
2011-11-17 21:38 ` David Rientjes
2011-11-18 9:53 ` Claudio Scordino
2011-11-17 21:34 ` David Rientjes
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).